Package org.geowebcache.config

Examples of org.geowebcache.config.Configuration.save()


     * 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


                config.modifyLayer(layer);
                saveConfigurations.add(config);
            }

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

        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

            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

            // 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

            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

        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

        tileSet = new TileSet("topp:states2", "EPSG:2163", "image/jpeg", null);
        assertTrue(tileSets.contains(tileSet));

        // 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

TOP
Copyright © 2018 www.massapi.com. 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.