Package org.geoserver.catalog

Examples of org.geoserver.catalog.Catalog.validate()


                coverage.setNamespace(namespace);
            }

            ResourcePool resourcePool = catalog.getResourcePool();
            resourcePool.clear(info);
            catalog.validate(info, false).throwIfInvalid();
            catalog.save(info);

            for (CoverageInfo coverage : alreadyConfigured) {
                catalog.save(coverage);
            }
View Full Code Here


        // save a copy, so if NewLayerPage fails we can keep on editing this one without being
        // proxied
        DataStoreInfo savedStore = catalog.getFactory().createDataStore();
        clone(info, savedStore);
        try {
            catalog.validate(savedStore, true).throwIfInvalid();
            catalog.add(savedStore);
        } catch (Exception e) {
            LOGGER.log(Level.WARNING, "Error adding data store to catalog", e);
            String message = e.getMessage();
            if (message == null && e.getCause() != null) {
View Full Code Here

                alreadyConfigured.setNamespace(namespace);
            }

            ResourcePool resourcePool = catalog.getResourcePool();
            resourcePool.clear(info);
            catalog.validate(info, false).throwIfInvalid();
            catalog.save(info);
            // save the resources after saving the store
            for (FeatureTypeInfo alreadyConfigured : configuredResources) {
                catalog.save(alreadyConfigured);
            }
View Full Code Here

        // GR: this shouldn't fail, the Catalog.save(StoreInfo) API does not declare any action in
        // case
        // of a failure!... strange, why a save can't fail?
        // Still, be cautious and wrap it in a try/catch block so the page does not blow up
        try {
            catalog.validate(savedStore, false).throwIfInvalid();
            catalog.save(savedStore);
        } catch (RuntimeException e) {
            LOGGER.log(Level.INFO, "Adding the store for " + info.getURL(), e);
            throw new IllegalArgumentException(
                    "The coverage store could not be saved. Failure message: " + e.getMessage());
View Full Code Here

                        cinfo.setGrid(new GridGeometry2D(grid.getGridRange(), grid.getGridToCRS(),
                                resourceInfo.getCRS()));
                    }
                }

                catalog.validate(resourceInfo, true).throwIfInvalid();
                catalog.add(resourceInfo);
                try {
                    catalog.add(getLayerInfo());
                } catch (IllegalArgumentException e) {
                    catalog.remove(resourceInfo);
View Full Code Here

                }
            } else {
                ResourceInfo oldState = catalog.getResource(resourceInfo.getId(),
                        ResourceInfo.class);
               
                catalog.validate(resourceInfo, true).throwIfInvalid();
                catalog.save(resourceInfo);
                try {
                    LayerInfo layer = getLayerInfo();
                    layer.setResource(resourceInfo);
                    catalog.save(layer);
View Full Code Here

        LayerGroupInfo group = persister.load(new ByteArrayInputStream(xml.getBytes()), LayerGroupInfo.class);

        Assert.assertEquals(LayerGroupInfo.Mode.SINGLE, group.getMode());
       
        Catalog catalog = new CatalogImpl();
        Assert.assertTrue(catalog.validate(group, false).isValid());
    }
   
    @Test
    public void testVirtualTable() throws Exception {
        Catalog catalog = new CatalogImpl();
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.