Package netscape.ldap

Examples of netscape.ldap.LDAPAttribute


        constraints.setClientControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, Strings.EMPTY_BYTES ) );
        constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, Strings.EMPTY_BYTES ) );
        conn.setConstraints( constraints );

        // comparison success
        LDAPAttribute attribute = new LDAPAttribute( "uid", "akarasuluref" );
        assertTrue( conn.compare( "uid=akarasuluref,ou=users,ou=system", attribute, constraints ) );

        // comparison failure
        attribute = new LDAPAttribute( "uid", "elecharny" );
        assertFalse( conn.compare( "uid=akarasuluref,ou=users,ou=system", attribute, constraints ) );

        conn.disconnect();
    }
View Full Code Here


        LDAPConstraints constraints = new LDAPConstraints();
        constraints.setReferrals( false );
        conn.setConstraints( constraints );

        // comparison success
        LDAPAttribute attribute = new LDAPAttribute( "uid", "akarasulu" );
        assertTrue( conn.compare( "uid=akarasulu,ou=users,ou=system", attribute, constraints ) );

        // referrals failure
        attribute = new LDAPAttribute( "uid", "akarasulu" );
        LDAPResponseListener listener = null;
        LDAPResponse response = null;

        listener = conn.compare( "uid=akarasuluref,ou=users,ou=system", attribute, null, constraints );
        response = listener.getResponse();
View Full Code Here

    public void testCompareWithoutAuthentication() throws LDAPException
    {
        getLdapServer().getDirectoryService().setAllowAnonymousAccess( false );
        LDAPConnection conn = new LDAPConnection();
        conn.connect( "localhost", getLdapServer().getPort() );
        LDAPAttribute attr = new LDAPAttribute( "uid", "admin" );

        try
        {
            conn.compare( "uid=admin,ou=system", attr );
            fail( "Compare success without authentication" );
View Full Code Here

        LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
        LDAPConstraints constraints = new LDAPConstraints();
        conn.setConstraints( constraints );

        // referrals failure
        LDAPAttribute attribute = new LDAPAttribute( "ou", "Computers" );
        LDAPResponseListener listener = null;
        LDAPResponse response = null;

        listener = conn.compare( "ou=Computers,uid=akarasuluref,ou=users,ou=system", attribute, null, constraints );
        response = listener.getResponse();
View Full Code Here

        constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, Strings.EMPTY_BYTES ) );
        conn.setConstraints( constraints );

        // add success
        LDAPAttributeSet attrSet = new LDAPAttributeSet();
        attrSet.add( new LDAPAttribute( "objectClass", "organizationalUnit" ) );
        attrSet.add( new LDAPAttribute( "ou", "UnderReferral" ) );
        LDAPEntry entry = new LDAPEntry( "ou=UnderReferral,uid=akarasuluref,ou=users,ou=system", attrSet );

        try
        {
            conn.add( entry, constraints );
View Full Code Here

        LDAPConstraints constraints = new LDAPConstraints();
        conn.setConstraints( constraints );

        // referrals failure
        LDAPAttributeSet attrSet = new LDAPAttributeSet();
        attrSet.add( new LDAPAttribute( "objectClass", "organizationalUnit" ) );
        attrSet.add( new LDAPAttribute( "ou", "UnderReferral" ) );
        LDAPEntry entry = new LDAPEntry( "ou=UnderReferral,ou=Computers,uid=akarasuluref,ou=users,ou=system", attrSet );

        LDAPResponseListener listener = conn.add( entry, null, constraints );
        LDAPResponse response = listener.getResponse();
        assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
View Full Code Here

        conn.setConstraints( constraints );

        // referrals failure

        LDAPAttributeSet attrSet = new LDAPAttributeSet();
        attrSet.add( new LDAPAttribute( "objectClass", "organizationalUnit" ) );
        attrSet.add( new LDAPAttribute( "ou", "UnderReferral" ) );
        LDAPEntry entry = new LDAPEntry( "ou=UnderReferral,uid=akarasuluref,ou=users,ou=system", attrSet );

        LDAPResponseListener listener = null;
        LDAPResponse response = null;
        listener = conn.add( entry, null, constraints );
View Full Code Here

    constraints.setClientControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, Strings.EMPTY_BYTES ) );
    constraints.setServerControls( new LDAPControl( LDAPControl.MANAGEDSAIT, true, Strings.EMPTY_BYTES ) );
    conn.setConstraints( constraints );

    // modify success
    LDAPAttribute attribute = new LDAPAttribute( "description", "referral to akarasulu" );
    LDAPModification mod = new LDAPModification( LDAPModification.ADD, attribute );
    conn.modify( "uid=akarasuluref,ou=users,ou=system", mod, constraints );

    assertTrue( conn.compare( "uid=akarasuluref,ou=users,ou=system", attribute, constraints ) );
View Full Code Here

    constraints.setReferrals( false );
    conn.setConstraints( constraints );

    // referrals failure
    // modify success
    LDAPAttribute attribute = new LDAPAttribute( "description", "referral to akarasulu" );
    LDAPModification mod = new LDAPModification( LDAPModification.ADD, attribute );
    LDAPResponseListener listener = conn.modify( "uid=akarasuluref,ou=users,ou=system", mod, null, constraints );
    LDAPResponse response = listener.getResponse();

    assertEquals( ResultCodeEnum.REFERRAL.getValue(), response.getResultCode() );
View Full Code Here

    LDAPConnection conn = getNsdkWiredConnection( getLdapServer() );
    LDAPConstraints constraints = new LDAPConstraints();
    conn.setConstraints( constraints );

    // referrals failure
    LDAPAttribute attribute = new LDAPAttribute( "ou", "Machines" );
    LDAPModification mod = new LDAPModification( LDAPModification.ADD, attribute );
    LDAPResponseListener listener = null;
    LDAPResponse response = null;

    listener = conn.modify( "ou=Computers,uid=akarasuluref,ou=users,ou=system", mod, null, constraints );
View Full Code Here

TOP

Related Classes of netscape.ldap.LDAPAttribute

Copyright © 2018 www.massapicom. 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.