/** * Gets the context in which to continue the operation. This method is called when this context is * asked to process a multicomponent Name in which the first component is a URL. Treat the first * component like a junction: resolve it and then use DirectoryManager.getContinuationDirContext() * to get the target context in which to operate on the remainder of the name (n.getSuffix(1)). Do * this in case intermediate contexts are not DirContext. */ protected DirContext getContinuationDirContext(Name n) throws NamingException { Object obj = lookup(n.get(0)); CannotProceedException cpe = new CannotProceedException(); cpe.setResolvedObj(obj); cpe.setEnvironment(myEnv); return DirectoryManager.getContinuationDirContext(cpe); }
public Attributes getAttributes(Name name, String[] attrIds) throws NamingException { if (name.size() == 1) { return getAttributes(name.get(0), attrIds); } else { DirContext ctx = getContinuationDirContext(name); try { return ctx.getAttributes(name.getSuffix(1), attrIds); } finally { ctx.close(); } } }
public DirContext getSchemaClassDefinition(Name name) throws NamingException { if (name.size() == 1) { return getSchemaClassDefinition(name.get(0)); } else { DirContext ctx = getContinuationDirContext(name); try { return ctx.getSchemaClassDefinition(name.getSuffix(1)); } finally { ctx.close(); } } }
public DirContext createSubcontext(Name name, Attributes attrs) throws NamingException { if (name.size() == 1) { return createSubcontext(name.get(0), attrs); } else { DirContext ctx = getContinuationDirContext(name); try { return ctx.createSubcontext(name.getSuffix(1), attrs); } finally { ctx.close(); } } }
public void rebind(Name name, Object obj, Attributes attrs) throws NamingException { if (name.size() == 1) { rebind(name.get(0), obj, attrs); } else { DirContext ctx = getContinuationDirContext(name); try { ctx.rebind(name.getSuffix(1), obj, attrs); } finally { ctx.close(); } } }
public void modifyAttributes(Name name, ModificationItem[] mods) throws NamingException { if (name.size() == 1) { modifyAttributes(name.get(0), mods); } else { DirContext ctx = getContinuationDirContext(name); try { ctx.modifyAttributes(name.getSuffix(1), mods); } finally { ctx.close(); } } }
public NamingEnumeration<SearchResult> search(Name name, String filter, SearchControls cons) throws NamingException { if (name.size() == 1) { return search(name.get(0), filter, cons); } else { DirContext ctx = getContinuationDirContext(name); try { return ctx.search(name.getSuffix(1), filter, cons); } finally { ctx.close(); } } }
public NamingEnumeration<SearchResult> search(Name name, Attributes matchingAttributes) throws NamingException { if (name.size() == 1) { return search(name.get(0), matchingAttributes); } else { DirContext ctx = getContinuationDirContext(name); try { return ctx.search(name.getSuffix(1), matchingAttributes); } finally { ctx.close(); } } }