@Override public int compare(AttributeType at1, AttributeType at2) { return ((NameImpl) at1.getName()).compareTo((NameImpl) at2.getName()); } });
@Override public Function function(String name, List<Expression> args, Literal fallback) { return function(new NameImpl(name), args, fallback); }
/** * Returns the same list of names than {@link #getTypeNames()} meaning the returned Names have * no namespace set. * * @since 1.7 * @see DataAccess#getNames() */ public List<Name> getNames() throws IOException { String[] typeNames = getTypeNames(); List<Name> names = new ArrayList<Name>(typeNames.length); for (String typeName : typeNames) { names.add(new NameImpl(typeName)); } return names; }
public NamespaceInfo getNamespaceByPrefix(String prefix) { NamespaceInfo ns = namespaces.findByName(new NameImpl(prefix), NamespaceInfo.class); return wrapInModificationProxy(ns, NamespaceInfo.class); }
public WorkspaceInfo getWorkspaceByName(String name) { WorkspaceInfo ws = workspaces.findByName(new NameImpl(name), WorkspaceInfo.class); return wrapInModificationProxy(ws, WorkspaceInfo.class); }
temporaryName = new NameImpl(nsURI, name); } while (Arrays.asList(typeNames).contains(temporaryName)); if (!initializer.initialize(info, dataAccess, temporaryName)) {
@Override public LayerGroupInfo getLayerGroupByName(WorkspaceInfo workspace, String name) { LayerGroupInfo match; if (workspace == NO_WORKSPACE) { match = layerGroups.findByName(new NameImpl(null, name), LayerGroupInfo.class); } else if (ANY_WORKSPACE == workspace) { match = layerGroups.findFirst(LayerGroupInfo.class, lg -> name.equals(lg.getName())); } else { match = layerGroups.findByName( new NameImpl(workspace.getId(), name), LayerGroupInfo.class); } return wrapInModificationProxy(match, LayerGroupInfo.class); }
public StyleInfo getStyleByName(String name) { StyleInfo match = styles.findByName(new NameImpl(null, name), StyleInfo.class); if (match == null) { match = styles.findFirst(StyleInfo.class, s -> name.equals(s.getName())); } return wrapInModificationProxy(match, StyleInfo.class); }
@Override public StyleInfo getStyleByName(WorkspaceInfo workspace, String name) { if (null == workspace) { throw new NullPointerException("workspace"); } if (null == name) { throw new NullPointerException("name"); } if (workspace == ANY_WORKSPACE) { return getStyleByName(name); } else { Name sn = new NameImpl(workspace == null ? null : workspace.getId(), name); StyleInfo match = styles.findByName(sn, StyleInfo.class); return wrapInModificationProxy(match, StyleInfo.class); } }
/** @see org.geoserver.catalog.ResourceInfo#getQualifiedNativeName() */ public Name getQualifiedNativeName() { return new NameImpl(getNamespace().getURI(), getNativeName()); }
/** @see org.geoserver.catalog.ResourceInfo#getQualifiedName() */ public Name getQualifiedName() { return new NameImpl(getNamespace().getURI(), getName()); }
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); }
public <T extends StoreInfo> T getStoreByName( WorkspaceInfo workspace, String name, Class<T> clazz) { T result; if (workspace == ANY_WORKSPACE) { result = stores.findFirst(clazz, s -> name.equals(s.getName())); } else { Name qname = new NameImpl((workspace != null) ? workspace.getId() : null, name); result = stores.findByName(qname, clazz); } return wrapInModificationProxy(result, clazz); }
if (ns != null) { final boolean layerFound = catalog.getLayerByName(new NameImpl(ns.getURI(), first)) != null; if (!layerFound && LOGGER.isLoggable(Level.FINEST)) {
LOGGER.warning("Namespace/Workspace " + root + " is unknown in rule " + rule); if (!ANY.equals(layerName) && rawCatalog.getLayerByName(new NameImpl(root, layerName)) == null && rawCatalog.getLayerGroupByName(root, layerName) == null) LOGGER.warning("Layer " + root + " is unknown in rule + " + rule);
public static Name name(CodeType code) { // mushy translation, code type seems to never have a code space in practice if (code.getCodeSpace() != null) { return new NameImpl(code.getCodeSpace(), code.getValue()); } else { return name(code.getValue()); } }
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); }
LayerInfo l = catalog.getLayerByName(new NameImpl(ns.getURI(), last)); if (l != null) { LocalPublished.set(l);