Package org.apache.directory.ldap.client.api

Examples of org.apache.directory.ldap.client.api.LdapConnection.lookup()


    pwdAt.add( ( byte[] ) null );

    Modification mod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, pwdAt );
    connection.modify( dn, mod );

    Entry entry = connection.lookup( dn );
    pwdAt = entry.get( pwdAtType );

    assertNull( pwdAt );
}
View Full Code Here


    entry.add( "cn", "testHash" );
    entry.add( SchemaConstants.USER_PASSWORD_AT, hashedPwd );

    connection.add( entry );

    entry = connection.lookup( dn );
    Attribute pwdAt = entry.get( SchemaConstants.USER_PASSWORD_AT );
    assertTrue( Arrays.equals( hashedPwd, pwdAt.getBytes() ) );
    assertTrue( PasswordUtil.compareCredentials( plainPwd, pwdAt.getBytes() ) );
}
View Full Code Here

    pwdAt.add( hashedPwd );

    Modification mod = new DefaultModification( ModificationOperation.REPLACE_ATTRIBUTE, pwdAt );
    connection.modify( dn, mod );

    Entry entry = connection.lookup( dn );
    pwdAt = entry.get( pwdAtType );

    assertTrue( Arrays.equals( hashedPwd, pwdAt.getBytes() ) );
    assertTrue( PasswordUtil.compareCredentials( plainPwd, pwdAt.getBytes() ) );
}
View Full Code Here

            "cn: testHigherCsnAdd_cn",
            "sn: testHigherCsnAdd_sn" );

        connection.add( entry2 );

        entry = connection.lookup( dn.getName(), "+" );
        entry2 = connection.lookup( dn2.getName(), "+" );

        String lowerCsn = entry.get( "entryCsn" ).getString();
        String higherCsn = entry2.get( "entryCsn" ).getString();
View Full Code Here

            "sn: testHigherCsnAdd_sn" );

        connection.add( entry2 );

        entry = connection.lookup( dn.getName(), "+" );
        entry2 = connection.lookup( dn2.getName(), "+" );

        String lowerCsn = entry.get( "entryCsn" ).getString();
        String higherCsn = entry2.get( "entryCsn" ).getString();

        // usecases
View Full Code Here

        ModifyResponse resp = con.modify( modReq );
        assertEquals( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX, resp.getLdapResult().getResultCode() );

        // Check whether entry is unmodified, i.e. no description
        Entry entry = ( ( SearchResultEntry )con.lookup( DN ) ).getEntry();
        assertEquals( "description exists?", null, entry.get( "description" ) );
    }
   
   
    @Test
View Full Code Here

            return null;
        }

        LdapConnection connection = connect();
        try {
            Entry entry = connection.lookup(ref.getId(), "*");
            if (entry == null) {
                return null;
            } else if (entry.hasObjectClass(config.getUserConfig().getObjectClasses())) {
                return createUser(entry, null);
            } else if (entry.hasObjectClass(config.getGroupConfig().getObjectClasses())) {
View Full Code Here

        try {
            Map<String, ExternalIdentityRef> members = new HashMap<String, ExternalIdentityRef>();
            DebugTimer timer = new DebugTimer();
            connection = connect();
            timer.mark("connect");
            Entry entry = connection.lookup(ref.getId());
            timer.mark("lookup");
            Attribute attr = entry.get(config.getGroupMemberAttribute());
            for (Value value: attr) {
                ExternalIdentityRef memberRef = new ExternalIdentityRef(value.getString(), this.getName());
                members.put(memberRef.getId(), memberRef);
View Full Code Here

    @Test
    public void testLookupPerfAPI() throws Exception
    {
        LdapConnection connection = ServerIntegrationUtils.getAdminConnection( getLdapServer() );

        Entry entry = connection.lookup( "uid=admin,ou=system" );
        assertNotNull( entry );

        long t0 = System.currentTimeMillis();

        for ( int i = 0; i < 50; i++ )
View Full Code Here

        for ( int i = 0; i < 50; i++ )
        {
            for ( int j = 0; j < 10000; j++ )
            {
                entry = connection.lookup( "uid=admin,ou=system" );
            }

            System.out.print( "." );
        }
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.