public void visit(WorkspaceInfo workspace) { // drill down on stores List<StoreInfo> stores = catalog.getStoresByWorkspace(workspace, StoreInfo.class); for (StoreInfo storeInfo : stores) { storeInfo.accept(this); } // drill into namespaces // catalog.getNamespaceByPrefix(workspace.getName()).accept(this); // drill down into styles for (StyleInfo style : catalog.getStylesByWorkspace(workspace)) { style.accept(this); } // drill down into groups for (LayerGroupInfo group : catalog.getLayerGroupsByWorkspace(workspace)) { group.accept(this); } // add self add(workspace, ModificationType.DELETE); }
public void visit(WorkspaceInfo workspace) { // remove owned stores for (StoreInfo s : catalog.getStoresByWorkspace(workspace, StoreInfo.class)) { s.accept(this); } // remove any linked namespaces NamespaceInfo ns = catalog.getNamespaceByPrefix(workspace.getName()); if (ns != null) { ns.accept(this); } // remove styles contained in this workspace for (StyleInfo style : catalog.getStylesByWorkspace(workspace)) { style.accept(this); } // remove layer groups contained in this workspace for (LayerGroupInfo group : catalog.getLayerGroupsByWorkspace(workspace)) { group.accept(this); } catalog.remove(workspace); }
expect(catalog.getStyleByName(name)).andReturn(s).anyTimes(); s.accept((CatalogVisitor) anyObject()); expectLastCall() .andAnswer(
@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)); }