Package org.geowebcache.config

Examples of org.geowebcache.config.Configuration


        } else if (source instanceof LayerGroupInfo) {
            tileLayerId = ((LayerGroupInfo) source).getId();
        } else {
            return false;
        }
        Configuration configuration;
        try {
            configuration = tld.getConfiguration(tileLayerId);
        } catch (IllegalArgumentException notFound) {
            return false;
        }
View Full Code Here


    private void doPost(Request req, Response resp) throws RestletException, IOException,
            GeoWebCacheException {
        TileLayer tl = deserializeAndCheckLayer(req, resp, false);

        try {
            Configuration configuration = layerDispatcher.modify(tl);
            configuration.save();
        } catch (IllegalArgumentException e) {
            throw new RestletException("Layer " + tl.getName()
                    + " is not known by the configuration."
                    + "Maybe it was loaded from another source, or you're trying to add a new "
                    + "layer and need to do an HTTP PUT ?", Status.CLIENT_ERROR_BAD_REQUEST);
View Full Code Here

        } catch (RestletException re) {
            // This is the expected behavior, it should not exist
        }

        if (testtl == null) {
            Configuration config = layerDispatcher.addLayer(tl);
            config.save();
        } else {
            throw new RestletException("Layer with name " + tl.getName() + " already exists, "
                    + "use POST if you want to replace it.", Status.CLIENT_ERROR_BAD_REQUEST);
        }
    }
View Full Code Here

     */
    private void doDelete(Request req, Response resp) throws RestletException, GeoWebCacheException {
        String layerName = (String) req.getAttributes().get("layer");
        findTileLayer(layerName, layerDispatcher);
        try {
            Configuration configuration = layerDispatcher.removeLayer(layerName);
            if (configuration == null) {
                throw new RestletException("Configuration to remove layer not found",
                        Status.SERVER_ERROR_INTERNAL);
            }
            configuration.save();
        } catch (IOException e) {
            throw new RestletException(e.getMessage(), Status.SERVER_ERROR_INTERNAL, e);
        }
    }
View Full Code Here

        // check the layer wide quotas
        assertQuotaZero("topp:states");
        assertQuotaZero("topp:states2");

        // remove one layer from the dispatcher
        Configuration configuration = layerDispatcher.removeLayer("topp:states");
        configuration.save();
        // and make sure at the next startup the store catches up (note this behaviour is just a
        // startup consistency check in case the store got out of sync for some reason. On normal
        // situations the store should have been notified through store.deleteLayer(layerName) if
        // the layer was removed programmatically through StorageBroker.deleteLayer
        store.close();
View Full Code Here

        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

     */
    public TileLayer getTileLayer(final String layerName) throws GeoWebCacheException {
        Preconditions.checkNotNull(layerName, "layerName is null");

        for (int i = 0; i < configs.size(); i++) {
            Configuration configuration = configs.get(i);
            TileLayer layer = configuration.getTileLayer(layerName);
            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

     *
     * @param tl
     * @throws IllegalArgumentException
     */
    public synchronized Configuration modify(final TileLayer tl) throws IllegalArgumentException {
        Configuration config = getConfiguration(tl);
        config.modifyLayer(tl);
        return config;
    }
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.