/** * Removes a workspace from the catalog. * * <p>The <tt>recursive</tt> flag controls whether objects linked to the workspace such as * stores should also be deleted. */ public void removeWorkspace(WorkspaceInfo workspace, boolean recursive) { if (recursive) { workspace.accept(new CascadeDeleteVisitor(catalog)); } else { catalog.remove(workspace); } }
expect(catalog.getNamespaceByURI(uri)).andReturn(ns).anyTimes(); ws.accept((CatalogVisitor) anyObject()); expectLastCall() .andAnswer(
ws.accept(visitor);
@Override public void visit(Catalog catalog) { listDiffOther(catalog.getWorkspaces(), otherCatalog.getWorkspaces()); listDiffOther(catalog.getNamespaces(), otherCatalog.getNamespaces()); listDiffOther(catalog.getDataStores(), otherCatalog.getDataStores()); listDiffOther(catalog.getCoverageStores(), otherCatalog.getCoverageStores()); listDiffOther( catalog.getStores(WMSStoreInfo.class), otherCatalog.getStores(WMSStoreInfo.class)); listDiffOther(catalog.getFeatureTypes(), otherCatalog.getFeatureTypes()); listDiffOther(catalog.getCoverages(), otherCatalog.getCoverages()); listDiffOther(catalog.getLayers(), otherCatalog.getLayers()); listDiffOther( catalog.getResources(WMSLayerInfo.class), otherCatalog.getResources(WMSLayerInfo.class)); listDiffOther(catalog.getStyles(), otherCatalog.getStyles()); listDiffOther(catalog.getLayerGroups(), otherCatalog.getLayerGroups()); catalog.getWorkspaces().forEach(info -> info.accept(this)); catalog.getNamespaces().forEach(info -> info.accept(this)); catalog.getDataStores().forEach(info -> info.accept(this)); catalog.getCoverageStores().forEach(info -> info.accept(this)); catalog.getStores(WMSStoreInfo.class).forEach(info -> info.accept(this)); catalog.getFeatureTypes().forEach(info -> info.accept(this)); catalog.getCoverages().forEach(info -> info.accept(this)); catalog.getLayers().forEach(info -> info.accept(this)); catalog.getResources(WMSLayerInfo.class).forEach(info -> info.accept(this)); catalog.getStyles().forEach(info -> info.accept(this)); catalog.getLayerGroups().forEach(info -> info.accept(this)); }
if (ws != null) ws.accept(deleteVisitor);