public <T extends ResourceInfo> T getResourceByName( NamespaceInfo namespace, String name, Class<T> clazz) { T result; if (namespace == ANY_NAMESPACE) { result = resources.findFirst(clazz, r -> name.equals(r.getName())); } else { Name qname = new NameImpl(namespace != null ? namespace.getId() : null, name); result = resources.findByName(qname, clazz); } return wrapInModificationProxy(result, clazz); }
if (existing != null && !existing.getId().equals(namespace.getId())) { throw new IllegalArgumentException( "Namespace with prefix '" + namespace.getPrefix() + "' already exists."); if (existing != null && !existing.getId().equals(namespace.getId())) { throw new IllegalArgumentException( "Namespace with URI '" + namespace.getURI() + "' already exists.");
public <T extends ResourceInfo> T getResourceByStore( StoreInfo store, String name, Class<T> clazz) { T resource = null; NamespaceInfo ns = null; if (store.getWorkspace() != null && store.getWorkspace().getName() != null && (ns = getNamespaceByPrefix(store.getWorkspace().getName())) != null) { resource = resources.findByName(new NameImpl(ns.getId(), name), clazz); if (resource != null && !(store.equals(resource.getStore()))) { return null; } } else { // should not happen, but some broken test code sets up namespaces without equivalent // workspaces // or stores without workspaces resource = resources.findFirst( clazz, r -> name.equals(r.getName()) && store.equals(r.getStore())); } return wrapInModificationProxy(resource, clazz); }
@Test public void testGetNamespaceById() { catalog.add(ns); NamespaceInfo ns2 = catalog.getNamespace(ns.getId()); assertNotNull(ns2); assertFalse(ns == ns2); assertEquals(ns, ns2); }
namespaces.add(ns); expect(ns.getId()).andReturn(nsId).anyTimes(); expect(ns.getName()).andReturn(name).anyTimes(); expect(ns.getPrefix()).andReturn(name).anyTimes();
/** @see ChoiceRenderer#getIdValue(Object, int) */ @Override public String getIdValue(NamespaceInfo object, int index) { return object.getId(); } }
/** * @see IChoiceRenderer#getIdValue(Object, int) */ public String getIdValue(Object object, int index) { return ((NamespaceInfo) object).getId(); }
public NamespaceDetachableModel(NamespaceInfo ns) { this.id = ns.getId(); }
public NamespaceDetachableModel( NamespaceInfo ns ) { this.id = ns.getId(); }
@Override public void visit(NamespaceInfo namespace) { NamespaceInfo otherNamespace = otherCatalog.getNamespace(namespace.getId()); if (!(Objects.equals(namespace, otherNamespace) && checkEquals(namespace.getMetadata(), namespace.getMetadata()))) { differences.add(new InfoDiff(namespace, otherNamespace)); } }
layerInfo.getResource().getNamespace().getId()); if (workspace != null && (!workspace.getName().equals(namespace.getPrefix())
NamespaceInfo namespace = catalog.getNamespace(layer.getResource().getNamespace().getId()); WorkspaceInfo workspace = catalog.getWorkspaceByName(namespace.getPrefix()); ft.setWorkspace(workspace.getName());
NamespaceInfo obj = (NamespaceInfo) notification.getObject(); KombuNamespaceInfo source = new KombuNamespaceInfo(); source.setId(obj.getId()); source.setType("NamespaceInfo"); source.setName(obj.getName());