/** @see ServerConfiguration#isFullWMS() */ @Override public Boolean isFullWMS() { if (getGwcConfig() != null) { return getGwcConfig().getFullWMS(); } return null; }
/** @see ServerConfiguration#isRuntimeStatsEnabled() */ public Boolean isRuntimeStatsEnabled() { if (getGwcConfig() == null || getGwcConfig().getRuntimeStats() == null) { return true; } else { return getGwcConfig().getRuntimeStats(); } }
/** @see TileLayerConfiguration#getTileLayers() */ @Deprecated public List<TileLayer> getTileLayers() { return Collections.unmodifiableList(getGwcConfig().getLayers()); }
/** @see BlobStoreConfiguration#getBlobStoreCount() */ @Override public int getBlobStoreCount() { return getGwcConfig().getBlobStores().size(); }
/** @see ServerConfiguration#getLockProvider() */ @Override public LockProvider getLockProvider() { return getGwcConfig().getLockProvider(); }
/** @see TileLayerConfiguration#getLayers() */ public Collection<TileLayer> getLayers() { return Collections.unmodifiableList(getGwcConfig().getLayers()); }
public String getVersion() { return getGwcConfig().getVersion(); }
/** @see ServerConfiguration#getServiceInformation() */ public synchronized ServiceInformation getServiceInformation() { return getGwcConfig().getServiceInformation(); }
/** @see BlobStoreConfiguration#getBlobStoreNames() */ @Override public Set<String> getBlobStoreNames() { return getGwcConfig() .getBlobStores() .stream() .map( (info) -> { return info.getName(); }) .collect(Collectors.toSet()); }
private void updateLayers() { Map<String, TileLayer> buff = new HashMap<String, TileLayer>(); for (TileLayer layer : getGwcConfig().getLayers()) { buff.put(layer.getName(), layer); } this.layers = buff; }
/** @see BlobStoreConfiguration#getBlobStores() */ @Override public List<BlobStoreInfo> getBlobStores() { // need to return an unmodifiable list of unmodifiable BlobStoreInfos return Collections.unmodifiableList( getGwcConfig() .getBlobStores() .stream() .map( (info) -> { return (BlobStoreInfo) info.clone(); }) .collect(Collectors.toList())); }
/** * @param gridSet * @throws GeoWebCacheException */ private synchronized void addOrReplaceGridSet(final XMLGridSet gridSet) throws IllegalArgumentException { final String gridsetName = gridSet.getName(); List<XMLGridSet> xmlGridSets = getGwcConfig().getGridSets(); xmlGridSets.removeIf(xgs -> gridsetName.equals(xgs.getName())); xmlGridSets.add(gridSet); }
/** @see BlobStoreConfiguration#getBlobStore(java.lang.String) */ @Override public Optional<BlobStoreInfo> getBlobStore(String name) { for (BlobStoreInfo info : getGwcConfig().getBlobStores()) { if (info.getName().equals(name)) { return Optional.of((BlobStoreInfo) info.clone()); } } return Optional.empty(); }
/** * @see ServerConfiguration#setRuntimeStatsEnabled(Boolean) * @param isEnabled */ public void setRuntimeStatsEnabled(Boolean isEnabled) throws IOException { getGwcConfig().setRuntimeStats(isEnabled); save(); }
/** * @see ServerConfiguration#setLockProvider(LockProvider) * @param lockProvider */ @Override public void setLockProvider(LockProvider lockProvider) throws IOException { getGwcConfig().setLockProvider(lockProvider); save(); }
/** * @see ServerConfiguration#setServiceInformation(ServiceInformation); * @param serviceInfo */ public void setServiceInformation(ServiceInformation serviceInfo) throws IOException { getGwcConfig().setServiceInformation(serviceInfo); save(); }
/** * @see ServerConfiguration#setFullWMS(Boolean) * @param isFullWMS */ @Override public void setFullWMS(Boolean isFullWMS) throws IOException { getGwcConfig().setFullWMS(isFullWMS); save(); }
@Override public synchronized void addGridSet(GridSet gridSet) { validateGridSet(gridSet); GridSet old = getGridSetsInternal().get(gridSet.getName()); if (old != null) { throw new IllegalArgumentException("GridSet " + gridSet.getName() + " already exists"); } assert getGwcConfig() .getGridSets() .stream() .noneMatch(xgs -> xgs.getName().equals(gridSet.getName())); try { saveGridSet(gridSet); } catch (IOException e) { throw new ConfigurationPersistenceException(e); } getGridSetsInternal().put(gridSet.getName(), gridSet); }
@Override public synchronized void modifyGridSet(GridSet gridSet) throws NoSuchElementException, IllegalArgumentException, UnsupportedOperationException { validateGridSet(gridSet); GridSet old = getGridSetsInternal().get(gridSet.getName()); if (old == null) { throw new NoSuchElementException("GridSet " + gridSet.getName() + " does not exist"); } assert getGwcConfig() .getGridSets() .stream() .anyMatch(xgs -> xgs.getName().equals(gridSet.getName())); try { saveGridSet(gridSet); } catch (IOException e) { throw new ConfigurationPersistenceException(e); } this.getGridSetsInternal().put(gridSet.getName(), gridSet); }
public void afterPropertiesSet() throws GeoWebCacheException { if (gridSetBroker == null) { throw new IllegalStateException("GridSetBroker has not been set"); } if (resourceProvider.hasInput()) { this.setGwcConfig(loadConfiguration()); } log.info("Initializing GridSets from " + getIdentifier()); getGridSetsInternal(); log.info("Initializing layers from " + getIdentifier()); // Loop over the layers and set appropriate values for (TileLayer layer : getGwcConfig().getLayers()) { if (layer == null) { throw new IllegalStateException(getIdentifier() + " contains a null layer"); } initialize(layer); } updateLayers(); }