@Override public GWCConfig clone() { GWCConfig clone; try { clone = (GWCConfig) super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } clone.setDefaultCachingGridSetIds(getDefaultCachingGridSetIds()); clone.setDefaultCoverageCacheFormats(getDefaultCoverageCacheFormats()); clone.setDefaultVectorCacheFormats(getDefaultVectorCacheFormats()); clone.setDefaultOtherCacheFormats(getDefaultOtherCacheFormats()); return clone; }
@Override public GWCConfig clone() { GWCConfig clone; try { clone = (GWCConfig) super.clone(); } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } clone.setDefaultCachingGridSetIds(getDefaultCachingGridSetIds()); clone.setDefaultCoverageCacheFormats(getDefaultCoverageCacheFormats()); clone.setDefaultVectorCacheFormats(getDefaultVectorCacheFormats()); clone.setDefaultOtherCacheFormats(getDefaultOtherCacheFormats()); clone.setCacheConfigurations(getCacheConfigurations()); return clone; }
public static GeoServerTileLayerInfoImpl loadOrCreate(final LayerInfo layerInfo, final GWCConfig defaults) { GeoServerTileLayerInfoImpl info = LegacyTileLayerInfoLoader.load(layerInfo); if (info == null) { info = create(defaults); final ResourceInfo resource = layerInfo.getResource(); if (resource instanceof FeatureTypeInfo) { info.getMimeFormats().clear(); info.getMimeFormats().addAll(defaults.getDefaultVectorCacheFormats()); } else if (resource instanceof CoverageInfo) { info.getMimeFormats().clear(); info.getMimeFormats().addAll(defaults.getDefaultCoverageCacheFormats()); } checkAutomaticStyles(layerInfo, info); } info.setName(tileLayerName(layerInfo)); info.setId(layerInfo.getId()); return info; }
/** * Creates a cached tile layer from the given Layer * * @param layerInfo the layer to cache * @param defaults default configuration */ public static GeoServerTileLayerInfoImpl loadOrCreate( final LayerInfo layerInfo, final GWCConfig defaults) { GeoServerTileLayerInfoImpl info = LegacyTileLayerInfoLoader.load(layerInfo); if (info == null) { info = create(defaults); final ResourceInfo resource = layerInfo.getResource(); if (resource instanceof FeatureTypeInfo) { info.getMimeFormats().clear(); info.getMimeFormats().addAll(defaults.getDefaultVectorCacheFormats()); } else if (resource instanceof CoverageInfo) { info.getMimeFormats().clear(); info.getMimeFormats().addAll(defaults.getDefaultCoverageCacheFormats()); } checkAutomaticStyles(layerInfo, info); } info.setName(tileLayerName(layerInfo)); info.setId(layerInfo.getId()); return info; }
public void testClone() { GWCConfig clone = config.clone(); assertEquals(config, clone); assertNotSame(config.getDefaultCachingGridSetIds(), clone.getDefaultCachingGridSetIds()); assertNotSame(config.getDefaultCoverageCacheFormats(), clone.getDefaultCoverageCacheFormats()); assertNotSame(config.getDefaultOtherCacheFormats(), clone.getDefaultOtherCacheFormats()); assertNotSame(config.getDefaultVectorCacheFormats(), clone.getDefaultVectorCacheFormats()); }
public void testSaneConfig() { assertTrue(config.isSane()); assertSame(config, config.saneConfig()); assertTrue(oldDefaults.isSane()); assertSame(oldDefaults, oldDefaults.saneConfig()); config.setMetaTilingX(-1); assertFalse(config.isSane()); assertTrue((config = config.saneConfig()).isSane()); config.setMetaTilingY(-1); assertFalse(config.isSane()); assertTrue((config = config.saneConfig()).isSane()); config.setGutter(-1); assertFalse(config.isSane()); assertTrue((config = config.saneConfig()).isSane()); config.getDefaultCachingGridSetIds().clear(); assertFalse(config.isSane()); assertTrue((config = config.saneConfig()).isSane()); config.getDefaultCoverageCacheFormats().clear(); assertFalse(config.isSane()); assertTrue((config = config.saneConfig()).isSane()); config.getDefaultOtherCacheFormats().clear(); assertFalse(config.isSane()); assertTrue((config = config.saneConfig()).isSane()); config.getDefaultVectorCacheFormats().clear(); assertFalse(config.isSane()); assertTrue((config = config.saneConfig()).isSane()); }