Package javax.naming.directory

Examples of javax.naming.directory.DirContext.createSubcontext()


        Attribute objectClass = new BasicAttribute( "objectClass" );
        group.put( objectClass );
        objectClass.add( "top" );
        objectClass.add( "groupOfUniqueNames" );
        group.put( "uniqueMember", firstMemberDn );
        adminCtx.createSubcontext( "cn=" + cn + ",ou=groups", group );
        return new DN( "cn=" + cn + ",ou=groups,ou=system" );
    }


    /**
 
View Full Code Here


        objectClass.add( "person" );
        objectClass.add( "organizationalPerson" );
        objectClass.add( "inetOrgPerson" );
        user.put( "sn", uid );
        user.put( "cn", uid );
        adminCtx.createSubcontext( "uid=" + uid + ",ou=users", user );
        return new DN( "uid=" + uid + ",ou=users,ou=system" );
    }


    /**
 
View Full Code Here

        objectClass.add( "top" );
        objectClass.add( "groupOfUniqueNames" );

        // TODO might be ServerDNConstants.ADMIN_SYSTEM_DN_NORMALIZED
        group.put( "uniqueMember", "uid=admin, ou=system" );
        adminCtx.createSubcontext( "cn=" + groupName + ",ou=groups", group );
        return new DN( "cn=" + groupName + ",ou=groups,ou=system" );
    }


    /**
 
View Full Code Here

        objectClass.add( "top" );
        objectClass.add( SchemaConstants.SUBENTRY_OC );
        objectClass.add( "accessControlSubentry" );
        subentry.put( "subtreeSpecification", subtree );
        subentry.put( "prescriptiveACI", aciItem );
        adminCtx.createSubcontext( "cn=" + cn, subentry );
    }


    /**
     * Adds and entryACI attribute to an entry specified by a relative name
View Full Code Here

        DirContext adminContext = getContextAsAdmin();
        try
        {
            // create the new entry as the admin user
            adminContext.createSubcontext( entryRdn, testEntry );

            DN userName = new DN( "uid=" + uid + ",ou=users,ou=system" );
            DirContext userContext = getContextAs( userName, password );
            userContext.rename( entryRdn, newRdn );
View Full Code Here

        DirContext adminContext = getContextAsAdmin();
        try
        {
            // create the entry as the admin
            DN userName = new DN( "uid=" + uid + ",ou=users,ou=system" );
            adminContext.createSubcontext( entryRdn, testEntry );

            // delete the newly created context as the user
            DirContext userContext = getContextAs( userName, password );
            userContext.destroySubcontext( entryRdn );
View Full Code Here

        try
        {
            // create the entry as admin
            DN userName = new DN( "uid=" + uid + ",ou=users,ou=system" );
            adminContext.createSubcontext( entryRdn, testEntry );

            // compare the telephone numbers
            DirContext userContext = getContextAs( userName, password );
            ServerLdapContext ctx = ( ServerLdapContext ) userContext.lookup( "" );
            ctx.compare( new DN( entryRdn + ",ou=system" ), "telephoneNumber", number );
View Full Code Here

        objectClass.add( "person" );
        objectClass.add( "organizationalPerson" );
        objectClass.add( "inetOrgPerson" );
        user.put( "sn", "bob" );
        user.put( "cn", "bob" );
        adminCtx.createSubcontext( "uid=bob,ou=users", user );

        ServerLdapContext ctx = ( ServerLdapContext ) adminCtx.lookup( "" );
        assertTrue( ctx.compare( new DN( "uid=bob,ou=users,ou=system" ), "userPassword", "bobspassword" ) );
    }
View Full Code Here

        try
        {
            DN userName = new DN( "uid=" + uid + ",ou=users,ou=system" );
            DirContext userContext = getContextAs( userName, password );
            userContext.createSubcontext( entryRdn, testEntry );

            // delete the newly created context as the admin user
            DirContext adminContext = getContextAsAdmin();
            adminContext.destroySubcontext( entryRdn );
View Full Code Here

        //noinspection EmptyCatchBlock
        try
        {
            // create the entry as admin
            DN userName = new DN( "uid=" + uid + ",ou=users,ou=system" );
            adminContext.createSubcontext( entryRdn, testEntry );

            // modify the entry as the user
            DirContext userContext = getContextAs( userName, password );
            userContext.modifyAttributes( entryRdn, mods );
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.