Package javax.naming.directory

Examples of javax.naming.directory.InitialDirContext.rename()


     * @param attributes
     * @throws NamingException
     */
    public void modifydn(String dn, String attributesthrows NamingException{
      DirContext ctx = new InitialDirContext(env);
      ctx.rename(dn, attributes);
      ctx.close();
    }
   
    public void modify(String dn, int modifytype, String strAttributes, String delimiter, String separator) throws NamingException, PageException {

View Full Code Here


    env.put(Context.SECURITY_PRINCIPAL, "cn=Directory Manager");
    env.put(Context.SECURITY_CREDENTIALS, "password");

    DirContext context = new InitialDirContext(env);

    context.rename("ou=People,o=test", "ou=Users,o=test");

    assertFalse(DirectoryServer.entryExists(DN.decode("ou=People,o=test")));
    assertTrue(DirectoryServer.entryExists(DN.decode("ou=Users,o=test")));

    context.close();
View Full Code Here

    env.put("java.naming.ldap.deleteRDN", "true")// default is 'true'
    /* Create the initial context */
    DirContext ctx = new InitialDirContext(env);
    try
    {
      ctx.rename("uid=user.0,ou=People,dc=example,dc=com",
                   "uid=,ou=People,dc=example,dc=com");
    }
    finally
    {
      /* Close the context when it's done */
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.