コード例 #1
0
 public void destroySubcontext(String name) throws NamingException {
   ResolveResult res = getRootURLContext(name, myEnv);
   Context ctx = (Context) res.getResolvedObj();
   try {
     ctx.destroySubcontext(res.getRemainingName());
   } finally {
     ctx.close();
   }
 }
コード例 #2
0
 public NameParser getNameParser(String name) throws NamingException {
   ResolveResult res = getRootURLContext(name, myEnv);
   Context ctx = (Context) res.getResolvedObj();
   try {
     return ctx.getNameParser(res.getRemainingName());
   } finally {
     ctx.close();
   }
 }
コード例 #3
0
 public void modifyAttributes(String name, int mod_op, Attributes attrs) throws NamingException {
   ResolveResult res = getRootURLContext(name, myEnv);
   DirContext ctx = (DirContext) res.getResolvedObj();
   try {
     ctx.modifyAttributes(res.getRemainingName(), mod_op, attrs);
   } finally {
     ctx.close();
   }
 }
コード例 #4
0
 public NamingEnumeration listBindings(String name) throws NamingException {
   ResolveResult res = getRootURLContext(name, myEnv);
   Context ctx = (Context) res.getResolvedObj();
   try {
     return ctx.listBindings(res.getRemainingName());
   } finally {
     ctx.close();
   }
 }
コード例 #5
0
 public void rebind(String name, Object obj) throws NamingException {
   ResolveResult res = getRootURLContext(name, myEnv);
   Context ctx = (Context) res.getResolvedObj();
   try {
     ctx.rebind(res.getRemainingName(), obj);
   } finally {
     ctx.close();
   }
 }
コード例 #6
0
 public DirContext getSchemaClassDefinition(String name) throws NamingException {
   ResolveResult res = getRootURLContext(name, myEnv);
   DirContext ctx = (DirContext) res.getResolvedObj();
   try {
     return ctx.getSchemaClassDefinition(res.getRemainingName());
   } finally {
     ctx.close();
   }
 }
コード例 #7
0
 public Attributes getAttributes(String name, String[] attrIds) throws NamingException {
   ResolveResult res = getRootURLContext(name, myEnv);
   DirContext ctx = (DirContext) res.getResolvedObj();
   try {
     return ctx.getAttributes(res.getRemainingName(), attrIds);
   } finally {
     ctx.close();
   }
 }
コード例 #8
0
 public DirContext createSubcontext(String name, Attributes attrs) throws NamingException {
   ResolveResult res = getRootURLContext(name, myEnv);
   DirContext ctx = (DirContext) res.getResolvedObj();
   try {
     return ctx.createSubcontext(res.getRemainingName(), attrs);
   } finally {
     ctx.close();
   }
 }
コード例 #9
0
 public void bind(String name, Object obj, Attributes attrs) throws NamingException {
   ResolveResult res = getRootURLContext(name, myEnv);
   DirContext ctx = (DirContext) res.getResolvedObj();
   try {
     ctx.bind(res.getRemainingName(), obj, attrs);
   } finally {
     ctx.close();
   }
 }
コード例 #10
0
 public NamingEnumeration<SearchResult> search(String name, String filter, SearchControls cons)
     throws NamingException {
   ResolveResult res = getRootURLContext(name, myEnv);
   DirContext ctx = (DirContext) res.getResolvedObj();
   try {
     return ctx.search(res.getRemainingName(), filter, cons);
   } finally {
     ctx.close();
   }
 }
コード例 #11
0
 public NamingEnumeration<SearchResult> search(String name, Attributes matchingAttributes)
     throws NamingException {
   ResolveResult res = getRootURLContext(name, myEnv);
   DirContext ctx = (DirContext) res.getResolvedObj();
   try {
     return ctx.search(res.getRemainingName(), matchingAttributes);
   } finally {
     ctx.close();
   }
 }
コード例 #12
0
  public void rename(String oldName, String newName) throws NamingException {
    String oldPrefix = getURLPrefix(oldName);
    String newPrefix = getURLPrefix(newName);
    if (!urlEquals(oldPrefix, newPrefix)) {
      throw new OperationNotSupportedException(
          "Renaming using different URL prefixes not supported : " + oldName + " " + newName);
    }

    ResolveResult res = getRootURLContext(oldName, myEnv);
    Context ctx = (Context) res.getResolvedObj();
    try {
      ctx.rename(res.getRemainingName(), getURLSuffix(newPrefix, newName));
    } finally {
      ctx.close();
    }
  }
コード例 #13
0
 public DirContext getSchema(String name) throws NamingException {
   ResolveResult res = getRootURLContext(name, myEnv);
   DirContext ctx = (DirContext) res.getResolvedObj();
   return ctx.getSchema(res.getRemainingName());
 }