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

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


   
        Dn base = new Dn( "ou=tests,ou=system" );
        Dn userDn = new Dn( "uid=" + uid + ",ou=users,ou=system" );
        results.clear();
        LdapConnection userCtx = getConnectionAs( userDn, password );
        EntryCursor cursor = userCtx.search( base.getName(), filter, scope, "*" );
        int counter = 0;
   
        while ( cursor.next() )
        {
            Entry result = cursor.get();
View Full Code Here


        addEntryACI( base, aci );
        Dn userDn = new Dn( "uid=" + uid + ",ou=users,ou=system" );
   
        results.clear();
        LdapConnection userCtx = getConnectionAs( userDn, password );
        EntryCursor cursor = userCtx.search( base.getName(), "(objectClass=*)", scope, "*" );
        int counter = 0;
   
        while ( cursor.next() )
        {
            Entry result = cursor.get();
View Full Code Here

    {
        LdapConnection userCtx = getConnectionAs( new Dn( "uid=" + uid + ",ou=users,ou=system" ), password );
        Entry result = null;
        EntryCursor list = null;
   
        list = userCtx.search( dn.getName(), "(objectClass=*)", SearchScope.OBJECT, "*" );
   
        if ( list.next() )
        {
            result = list.get();
        }
View Full Code Here

        // create the non-admin user
        createUser( "billyd", "billyd" );
   
        // try a search operation which should fail without any ACI
        LdapConnection userCtx = getConnectionAs( "uid=billyd,ou=users,ou=system", "billyd" );
        EntryCursor cursor = userCtx.search( "ou=users,ou=system", "(ObjectClass=*)", SearchScope.SUBTREE,
            "userPassword" );
        int counter = 0;
   
        while ( cursor.next() )
        {
View Full Code Here

                "}" );
   
        // see if we can now search that tree which we could not before
        // should work now with billyd now that all users are authorized
        userCtx = getConnectionAs( "uid=billyd,ou=users,ou=system", "billyd" );
        cursor = userCtx.search( "ou=users,ou=system", "(ObjectClass=*)", SearchScope.SUBTREE,
            "userPassword" );
        counter = 0;
   
        while ( cursor.next() )
        {
View Full Code Here

    @Test
    public void testSearchPerfObjectScope() throws Exception
    {
        LdapConnection connection = IntegrationUtils.getAdminConnection( getService() );

        EntryCursor cursor = connection.search( "uid=admin,ou=system", "(ObjectClass=*)",
            SearchScope.OBJECT, "*" );

        int i = 0;

        while ( cursor.next() )
View Full Code Here

            if ( i == 500000 )
            {
                t00 = System.currentTimeMillis();
            }

            cursor = new EntryCursorImpl( connection.search( searchRequest ) );

            while ( cursor.next() )
            {
                cursor.get();
                count++;
View Full Code Here

    @Test
    public void testSearchPerfOneLevelScope() throws Exception
    {
        LdapConnection connection = IntegrationUtils.getAdminConnection( getService() );

        EntryCursor cursor = connection.search( "ou=system", "(ObjectClass=*)",
            SearchScope.ONELEVEL, "*" );

        int i = 0;

        while ( cursor.next() )
View Full Code Here

            if ( i == 50000 )
            {
                t00 = System.currentTimeMillis();
            }

            cursor = new EntryCursorImpl( connection.search( searchRequest ) );

            while ( cursor.next() )
            {
                cursor.get();
                count++;
View Full Code Here

    @Test
    public void testSearchPerfSublevelScope() throws Exception
    {
        LdapConnection connection = IntegrationUtils.getAdminConnection( getService() );

        EntryCursor cursor = connection.search( "ou=system", "(ObjectClass=*)",
            SearchScope.SUBTREE, "*" );

        int i = 0;

        while ( cursor.next() )
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.