private int initialize(BlobStoreConfiguration config) { if (config == null) { throw new IllegalStateException( "BlobStoreConfiguration got a null GWC configuration object"); } String configIdent; try { configIdent = config.getIdentifier(); } catch (Exception gwce) { log.error("Error obtaining identify from BlobStoreConfiguration " + config, gwce); return 0; } if (configIdent == null) { log.warn("Got a GWC configuration with no identity, ignoring it:" + config); return 0; } int blobStoreCount = config.getBlobStoreCount(); if (blobStoreCount <= 0) { log.info( "BlobStoreConfiguration " + config.getIdentifier() + " contained no blob store infos."); } // Check whether there is any general service information if (this.serviceInformation == null && config instanceof ServerConfiguration) { log.debug("Reading service information."); this.serviceInformation = ((ServerConfiguration) config).getServiceInformation(); } return blobStoreCount; }
/** * Constructs a new POJO based on the provided {@link ServerConfiguration} * * @param template Template used to initialize properties */ public ServerConfigurationPOJO(ServerConfiguration template) throws IOException { this.serviceInformation = template.getServiceInformation(); this.runtimeStatsEnabled = template.isRuntimeStatsEnabled(); setLockProvider(template.getLockProvider()); this.fullWMS = template.isFullWMS(); this.wmtsCiteCompliant = template.isWmtsCiteCompliant(); this.backendTimeout = template.getBackendTimeout(); this.cacheBypassAllowed = template.isCacheBypassAllowed(); this.version = template.getVersion(); this.identifier = template.getIdentifier(); this.location = template.getLocation(); }
public static void setUpTestData(GWCConfigIntegrationTestSupport testSupport) throws Exception { serverConfiguration.getServiceInformation().setTitle("GeoWebCache");
config = getConfig(); ServiceInformation serviceInfo = config.getServiceInformation(); assertEquals("GeoWebCache", serviceInfo.getTitle()); assertEquals("John Smith inc.", serviceInfo.getServiceProvider().getProviderName()); newinfo.setProviderName("John Adams inc."); config.setServiceInformation(newinfo); assertEquals("John Adams inc.", config.getServiceInformation().getProviderName()); ServiceInformation savedInfo = config.getServiceInformation(); assertEquals(savedInfo.getProviderName(), "John Adams inc."); assertFalse(config.isRuntimeStatsEnabled());