コード例 #1
0
 /**
  * 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);
 }
コード例 #2
0
 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();
     }
   }
 }
コード例 #3
0
 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();
     }
   }
 }
コード例 #4
0
 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();
     }
   }
 }
コード例 #5
0
 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();
     }
   }
 }
コード例 #6
0
 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();
     }
   }
 }
コード例 #7
0
 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();
     }
   }
 }
コード例 #8
0
 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();
     }
   }
 }