Skip to content

Commit

Permalink
Updates to match interface split in GWC Configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
smithkm authored and tbarsballe committed Jan 2, 2018
1 parent b1f3d63 commit cf00c41
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 28 deletions.
18 changes: 10 additions & 8 deletions src/gwc/src/main/java/org/geoserver/gwc/GWC.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@
import org.geowebcache.GeoWebCacheEnvironment; import org.geowebcache.GeoWebCacheEnvironment;
import org.geowebcache.GeoWebCacheException; import org.geowebcache.GeoWebCacheException;
import org.geowebcache.GeoWebCacheExtensions; import org.geowebcache.GeoWebCacheExtensions;
import org.geowebcache.config.BaseConfiguration;
import org.geowebcache.config.BlobStoreConfig; import org.geowebcache.config.BlobStoreConfig;
import org.geowebcache.config.BlobStoreConfigurationCatalog;
import org.geowebcache.config.Configuration; import org.geowebcache.config.Configuration;
import org.geowebcache.config.ConfigurationException; import org.geowebcache.config.ConfigurationException;
import org.geowebcache.config.XMLConfiguration; import org.geowebcache.config.XMLConfiguration;
Expand Down Expand Up @@ -1343,7 +1345,7 @@ public LayerGroupInfo getLayerGroupById(String id) {
* Adds a layer to the {@link CatalogConfiguration} and saves it. * Adds a layer to the {@link CatalogConfiguration} and saves it.
*/ */
public void add(GeoServerTileLayer tileLayer) { public void add(GeoServerTileLayer tileLayer) {
Configuration config = tld.addLayer(tileLayer); BaseConfiguration config = tld.addLayer(tileLayer);
try { try {
config.save(); config.save();
} catch (IOException e) { } catch (IOException e) {
Expand Down Expand Up @@ -1552,7 +1554,7 @@ public synchronized void modifyGridSet(final String oldGridSetName, final GridSe
saveConfigurations.add(config); saveConfigurations.add(config);
} }


for (Configuration config : saveConfigurations) { for (BaseConfiguration config : saveConfigurations) {
config.save(); config.save();
} }
} finally { } finally {
Expand Down Expand Up @@ -1634,7 +1636,7 @@ public void save(final TileLayer layer) {
checkNotNull(layer); checkNotNull(layer);
log.info("Saving GeoSeverTileLayer " + layer.getName()); log.info("Saving GeoSeverTileLayer " + layer.getName());


Configuration modifiedConfig = tld.modify(layer); BaseConfiguration modifiedConfig = tld.modify(layer);
try { try {
modifiedConfig.save(); modifiedConfig.save();
} catch (IOException e) { } catch (IOException e) {
Expand Down Expand Up @@ -1946,7 +1948,7 @@ public void removeTileLayers(final List<String> tileLayerNames) {
} }
} }


for (Configuration conf : confsToSave) { for (BaseConfiguration conf : confsToSave) {
try { try {
conf.save(); conf.save();
} catch (IOException e) { } catch (IOException e) {
Expand Down Expand Up @@ -1997,7 +1999,7 @@ public synchronized void removeGridSets(final Set<String> gridsetIds) throws IOE
} }


// now make it all persistent // now make it all persistent
for (Configuration config : changedConfigs) { for (BaseConfiguration config : changedConfigs) {
config.save(); config.save();
} }
} }
Expand Down Expand Up @@ -2060,7 +2062,7 @@ public boolean hasTileLayer(CatalogInfo source) {
} else { } else {
return false; return false;
} }
Configuration configuration; BaseConfiguration configuration;
try { try {
configuration = tld.getConfiguration(tileLayerId); configuration = tld.getConfiguration(tileLayerId);
} catch (IllegalArgumentException notFound) { } catch (IllegalArgumentException notFound) {
Expand Down Expand Up @@ -2358,7 +2360,7 @@ static Set<String> getAdvertisedCachedFormats(final PublishedType type, final It
* @return the list of configured blobstores * @return the list of configured blobstores
*/ */
public List<BlobStoreConfig> getBlobStores() { public List<BlobStoreConfig> getBlobStores() {
XMLConfiguration xmlConfig = getXmlConfiguration(); BlobStoreConfigurationCatalog xmlConfig = getXmlConfiguration();


return new ArrayList<BlobStoreConfig>(xmlConfig.getBlobStores()); return new ArrayList<BlobStoreConfig>(xmlConfig.getBlobStores());
} }
Expand All @@ -2368,7 +2370,7 @@ public List<BlobStoreConfig> getBlobStores() {
* no default * no default
*/ */
public BlobStoreConfig getDefaultBlobStore() { public BlobStoreConfig getDefaultBlobStore() {
XMLConfiguration xmlConfig = getXmlConfiguration(); BlobStoreConfigurationCatalog xmlConfig = getXmlConfiguration();


for (BlobStoreConfig config : xmlConfig.getBlobStores()) { for (BlobStoreConfig config : xmlConfig.getBlobStores()) {
if (config.isDefault()) { if (config.isDefault()) {
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -166,24 +166,6 @@ public String getIdentifier() {
return "GeoServer Catalog Configuration"; return "GeoServer Catalog Configuration";
} }


/**
* @see org.geowebcache.config.Configuration#getServiceInformation()
* @return {@code null}
*/
@Override
public ServiceInformation getServiceInformation() {
return null;
}

/**
* @return {@code true}
* @see org.geowebcache.config.Configuration#isRuntimeStatsEnabled()
*/
@Override
public boolean isRuntimeStatsEnabled() {
return true;
}

/** /**
* Returns the list of {@link GeoServerTileLayer} objects matching the GeoServer ones. * Returns the list of {@link GeoServerTileLayer} objects matching the GeoServer ones.
* <p> * <p>
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ public void tearDown() {


@Test public void testGoofyMethods() { @Test public void testGoofyMethods() {
assertEquals("GeoServer Catalog Configuration", config.getIdentifier()); assertEquals("GeoServer Catalog Configuration", config.getIdentifier());
assertNull(config.getServiceInformation());
assertTrue(config.isRuntimeStatsEnabled());
} }


@Test public void testInitialize() { @Test public void testInitialize() {
Expand Down

0 comments on commit cf00c41

Please sign in to comment.