Package javax.naming.ldap

Examples of javax.naming.ldap.LdapContext.bind()


    {
        LdapContext sysRoot = getSystemContext( service );

        sysRoot.addToEnvironment( Context.STATE_FACTORIES, PersonStateFactory.class.getName() );
        Person p = new Person( "Rodriguez", "Mr. Kerberos", "noices", "555-1212", "sn=erodriguez", "committer" );
        sysRoot.bind( "sn=Rodriguez, ou=users", p );
        Attributes attrs = sysRoot.getAttributes( "sn=Rodriguez, ou=users" );
        assertEquals( "Rodriguez", attrs.get( "sn" ).get() );
        assertEquals( "Mr. Kerberos", attrs.get( "cn" ).get() );
        assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), StringTools.getBytesUtf8( "noices" ) ) );
        assertEquals( "555-1212", attrs.get( "telephonenumber" ).get() );
View Full Code Here


        ArrayList<String> colors = new ArrayList<String>();
        colors.add( "red" );
        colors.add( "white" );
        colors.add( "blue" );
        sysRoot.bind( "cn=colors", colors );

        Object obj = sysRoot.lookup( "cn=colors" );
        assertTrue( obj instanceof ArrayList );
        colors = ( ArrayList<String> ) obj;
        assertEquals( 3, colors.size() );
View Full Code Here

            }

            try {
                // Step 2: Bind the user preferences data
                //System.out.println("Bind[" + count + "]" + bindOp);
                derivedContext.bind(bindOp, attributes);
            } catch (CommunicationException ce) {
                System.out.println("Trying to re-connect to RDS");
            } catch (NameAlreadyBoundException nab) {
                System.out.println("User: " + userName
                    + " already exists in the Ldap server");
View Full Code Here

    {
        LdapContext sysRoot = getSystemContext( service );

        sysRoot.addToEnvironment( Context.STATE_FACTORIES, PersonStateFactory.class.getName() );
        Person p = new Person( "Rodriguez", "Mr. Kerberos", "noices", "555-1212", "sn=erodriguez", "committer" );
        sysRoot.bind( "sn=Rodriguez, ou=users", p );
        Attributes attrs = sysRoot.getAttributes( "sn=Rodriguez, ou=users" );
        assertEquals( "Rodriguez", attrs.get( "sn" ).get() );
        assertEquals( "Mr. Kerberos", attrs.get( "cn" ).get() );
        assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), StringTools.getBytesUtf8( "noices" ) ) );
        assertEquals( "555-1212", attrs.get( "telephonenumber" ).get() );
View Full Code Here

        ArrayList<String> colors = new ArrayList<String>();
        colors.add( "red" );
        colors.add( "white" );
        colors.add( "blue" );
        sysRoot.bind( "cn=colors", colors );

        Object obj = sysRoot.lookup( "cn=colors" );
        assertTrue( obj instanceof ArrayList );
        colors = ( ArrayList<String> ) obj;
        assertEquals( 3, colors.size() );
View Full Code Here

    {
        LdapContext sysRoot = getSystemContext( service );

        sysRoot.addToEnvironment( Context.STATE_FACTORIES, PersonStateFactory.class.getName() );
        Person p = new Person( "Rodriguez", "Mr. Kerberos", "noices", "555-1212", "sn=erodriguez", "committer" );
        sysRoot.bind( "sn=Rodriguez, ou=users", p );
        Attributes attrs = sysRoot.getAttributes( "sn=Rodriguez, ou=users" );
        assertEquals( "Rodriguez", attrs.get( "sn" ).get() );
        assertEquals( "Mr. Kerberos", attrs.get( "cn" ).get() );
        assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), StringTools.getBytesUtf8( "noices" ) ) );
        assertEquals( "555-1212", attrs.get( "telephonenumber" ).get() );
View Full Code Here

        attrs.put( attr );

        LdapContext parent = ( ( ServerSystemPreferences ) parent() ).getLdapContext();

        parent.bind( "prefNodeName=" + name, null, attrs );

        ctx = ( LdapContext ) parent.lookup( "prefNodeName=" + name );

        super.newNode = false;
    }
View Full Code Here

        attrs.put( attr );

        LdapContext parent = ( ( ServerSystemPreferences ) parent() ).getLdapContext();

        parent.bind( "prefNodeName=" + name, null, attrs );

        ctx = ( LdapContext ) parent.lookup( "prefNodeName=" + name );

        super.newNode = false;
    }
View Full Code Here

    {
        LdapContext sysRoot = getSystemContext( getService() );

        sysRoot.addToEnvironment( Context.STATE_FACTORIES, PersonStateFactory.class.getName() );
        Person p = new Person( "Rodriguez", "Mr. Kerberos", "noices", "555-1212", "sn=erodriguez", "committer" );
        sysRoot.bind( "sn=Rodriguez, ou=users", p );
        Attributes attrs = sysRoot.getAttributes( "sn=Rodriguez, ou=users" );
        assertEquals( "Rodriguez", attrs.get( "sn" ).get() );
        assertEquals( "Mr. Kerberos", attrs.get( "cn" ).get() );
        assertTrue( ArrayUtils.isEquals( attrs.get( "userPassword" ).get(), Strings.getBytesUtf8( "noices" ) ) );
        assertEquals( "555-1212", attrs.get( "telephonenumber" ).get() );
View Full Code Here

        attrs.put( attr );

        LdapContext parent = ( ( ServerSystemPreferences ) parent() ).getLdapContext();

        parent.bind( "prefNodeName=" + name, null, attrs );

        ctx = ( LdapContext ) parent.lookup( "prefNodeName=" + name );

        super.newNode = false;
    }
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.