Package javax.naming.directory

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


    {
        DirContext ctx = ( DirContext ) ServerIntegrationUtils.getWiredContext( ldapServer ).lookup( "ou=system" );

        Attributes attrs = getOrgUnitAttributes( "East -> West" );
        String rdn = "ou=East -\\> West";
        ctx.createSubcontext( rdn, attrs );

        SearchControls sctls = new SearchControls();
        sctls.setSearchScope( SearchControls.SUBTREE_SCOPE );

        NamingEnumeration<SearchResult> enm = ctx.search( "", "(ou=East -> West)", sctls );
View Full Code Here


    {
        DirContext ctx = ( DirContext ) ServerIntegrationUtils.getWiredContext( ldapServer ).lookup( "ou=system" );

        Attributes attrs = getOrgUnitAttributes( "Scissors 8<" );
        String rdn = "ou=Scissors 8\\<";
        ctx.createSubcontext( rdn, attrs );

        SearchControls sctls = new SearchControls();
        sctls.setSearchScope( SearchControls.SUBTREE_SCOPE );

        NamingEnumeration<SearchResult> enm = ctx.search( "", "(ou=Scissors 8<)", sctls );
View Full Code Here

    {
        DirContext ctx = ( DirContext ) ServerIntegrationUtils.getWiredContext( ldapServer ).lookup( "ou=system" );

        Attributes attrs = getOrgUnitAttributes( "semicolon group;" );
        String rdn = "ou=semicolon group\\;";
        ctx.createSubcontext( rdn, attrs );

        SearchControls sctls = new SearchControls();
        sctls.setSearchScope( SearchControls.SUBTREE_SCOPE );

        NamingEnumeration<SearchResult> enm = ctx.search( "", "(ou=semicolon group;)", sctls );
View Full Code Here

    {
        DirContext ctx = ( DirContext ) ServerIntegrationUtils.getWiredContext( ldapServer ).lookup( "ou=system" );

        Attributes attrs = getOrgUnitAttributes( "nomen=omen" );
        String rdn = "ou=nomen\\=omen";
        ctx.createSubcontext( rdn, attrs );

        SearchControls sctls = new SearchControls();
        sctls.setSearchScope( SearchControls.SUBTREE_SCOPE );

        NamingEnumeration<SearchResult> enm = ctx.search( "", "(ou=nomen=omen)", sctls );
View Full Code Here

            }
        }

        boolean result = true;
        try {
            resources.createSubcontext(path);
        } catch (NamingException e) {
            result = false;
        }

        if (!result) {
View Full Code Here

            return;
        }

        boolean result = true;
        try {
            resources.createSubcontext(path);
        } catch (NamingException e) {
            result = false;
        }

        if (!result) {
View Full Code Here

        Attributes phoneBook = new BasicAttributes( "ou", "phoneBook", true );
        Attribute objectClass = new BasicAttribute( "objectClass" );
        phoneBook.put( objectClass );
        objectClass.add( "top" );
        objectClass.add( "organizationalUnit" );
        billydCtx.createSubcontext( "ou=phoneBook", phoneBook );

        // now add a subentry that enables anyone to search below their own entries
        createAccessControlSubentry( "anybodySearchTheirSubordinates", "{ " + "identificationTag \"searchAci\", " + "precedence 14, "
            + "authenticationLevel none, " + "itemOrUserFirst userFirst: { " + "userClasses { allUsers }, "
            + "userPermissions { { " + "protectedItems {entry, allUserAttributeTypesAndValues}, "
View Full Code Here

        // Create the context
        DirContext system = getSystemContext( service );
       
        try
        {
            system.createSubcontext( "cn=test", entry );
        }
        catch ( NamingException ne )
        {
            fail();
        }
View Full Code Here

        // Create the context
        DirContext system = getSystemContext( service );
       
        try
        {
            system.createSubcontext( "cn=test", entry );
        }
        catch ( NamingException ne )
        {
            fail();
        }
View Full Code Here

        attribute.add( "top" );
        attribute.add( "organizationalUnit" );
        attributes.put( attribute );
        attributes.put( "ou", "subtest" );

        ctx = ctx.createSubcontext( "ou=subtest", attributes );
        assertNotNull( ctx );

        ctx = ( DirContext ) sysRoot.lookup( "ou=subtest,ou=testing01" );
        assertNotNull( ctx );
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.