Package org.geowebcache.config

Examples of org.geowebcache.config.Configuration


        this.configs = newList;
    }

    public boolean layerExists(final String layerName) {
        for (int i = 0; i < configs.size(); i++) {
            Configuration configuration = configs.get(i);
            TileLayer layer = configuration.getTileLayer(layerName);
            if (layer != null) {
                return true;
            }
        }
        return false;
View Full Code Here


     *             if no such layer exists
     */
    public TileLayer getTileLayer(final String layerIdent) throws GeoWebCacheException {

        for (int i = 0; i < configs.size(); i++) {
            Configuration configuration = configs.get(i);
            TileLayer layer = configuration.getTileLayer(layerIdent);
            if (layer != null) {
                return layer;
            }
        }
        throw new GeoWebCacheException("Thread " + Thread.currentThread().getId()
View Full Code Here

    }

    public int getLayerCount() {
        int count = 0;
        for (int i = 0; i < configs.size(); i++) {
            Configuration configuration = configs.get(i);
            count += configuration.getTileLayerCount();
        }
        return count;
    }
View Full Code Here

    }

    public Set<String> getLayerNames() {
        Set<String> names = new HashSet<String>();
        for (int i = 0; i < configs.size(); i++) {
            Configuration configuration = configs.get(i);
            names.addAll(configuration.getTileLayerNames());
        }
        return names;
    }
View Full Code Here

     * @return a list view of this tile layer dispatcher's internal layers
     */
    public Iterable<TileLayer> getLayerList() {
        ArrayList<TileLayer> layers = new ArrayList<TileLayer>();
        for (int i = 0; i < configs.size(); i++) {
            Configuration configuration = configs.get(i);
            try {
                layers.addAll(configuration.getTileLayers());
            } catch (GeoWebCacheException e) {
                throw new RuntimeException(e);
            }
        }
        return layers;
View Full Code Here

    /**
     * Adds a layer to the {@link CatalogConfiguration} and saves it.
     */
    public void add(GeoServerTileLayer tileLayer) {
        Configuration config = tld.addLayer(tileLayer);
        try {
            config.save();
        } catch (IOException e) {
            propagate(getRootCause(e));
        }
    }
View Full Code Here

                        gridSetExtent, zoomStart, zoomStop);

                layer.removeGridSubset(oldGridSetName);
                layer.addGridSubset(newGridSubset);

                Configuration config = tld.getConfiguration(layer);
                config.modifyLayer(layer);
                saveConfigurations.add(config);
            }

            for (Configuration config : saveConfigurations) {
                config.save();
            }
        } finally {
            if(lock != null) {
                lock.release();
            }
View Full Code Here

    public void save(final GeoServerTileLayer layer) {
        checkNotNull(layer);
        log.info("Saving GeoSeverTileLayer " + layer.getName());

        Configuration modifiedConfig = tld.modify(layer);
        try {
            modifiedConfig.save();
        } catch (IOException e) {
            Throwable rootCause = Throwables.getRootCause(e);
            throw Throwables.propagate(rootCause);
        }
    }
View Full Code Here

        checkNotNull(tileLayerNames);

        Set<Configuration> confsToSave = new HashSet<Configuration>();

        for (String tileLayerName : tileLayerNames) {
            Configuration configuration = tld.removeLayer(tileLayerName);
            if (configuration != null) {
                confsToSave.add(configuration);
            }
        }
View Full Code Here

                }
                if (tileLayer.getGridSubsets().isEmpty()) {
                    tileLayer.setEnabled(false);
                }
                try {
                    Configuration configuration = tld.modify(tileLayer);
                    changedConfigs.add(configuration);
                } catch (IllegalArgumentException ignore) {
                    // layer removed? don't care
                }
            } finally {
                if(lock != null) {
                    lock.release();
                }
            }
        }

        // All referencing layers updated, now can remove the gridsets
        for (String gridSetId : gridsetIds) {
            Configuration configuration = tld.removeGridset(gridSetId);
            changedConfigs.add(configuration);
        }

        // now make it all persistent
        for (Configuration config : changedConfigs) {
View Full Code Here

TOP

Related Classes of org.geowebcache.config.Configuration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.