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

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


        }

        cursor.close();

        req.setTimeLimit( 1 );
        cursor = connection.search( req );
        int newCount = 0;

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


        SearchRequest req = new SearchRequestImpl();
        req.setBase( new Dn( "dc=example,dc=com" ) );
        req.setFilter( "(member=*)" );
        req.setScope( SearchScope.SUBTREE );

        Cursor<Response> cursor = connection.search( req );
        int count = 0;
        while( cursor.next() )
        {
            count++;
        }
View Full Code Here

        assertEquals( 2, count );
       
        cursor.close();

        req.setFilter( "(member=uid=1374609910000,ou=users,dc=example,dc=com)" );
        cursor = connection.search( req );
        assertTrue( cursor.next() );
        cursor.close();

        req.setFilter( "(member=uid=1374609919999,ou=users,dc=example,dc=com)" );
        cursor = connection.search( req );
View Full Code Here

        cursor = connection.search( req );
        assertTrue( cursor.next() );
        cursor.close();

        req.setFilter( "(member=uid=1374609919999,ou=users,dc=example,dc=com)" );
        cursor = connection.search( req );
        assertTrue( cursor.next() );
        assertTrue( cursor.next() );
        cursor.close();

        req.setFilter( "(member=u*)" );
View Full Code Here

        assertTrue( cursor.next() );
        assertTrue( cursor.next() );
        cursor.close();

        req.setFilter( "(member=u*)" );
        cursor = connection.search( req );
        assertFalse( cursor.next() );
        cursor.close();

        connection.close();
    }
View Full Code Here

            // Use the client API as JNDI cannot be used to do a search without
            // first binding. (hmmm, even client API won't allow searching without binding)
            connection.bind( "uid=admin,ou=system", "secret" );

            // Searches for all the entries in ou=system
            EntryCursor cursor = connection.search( "uid=admin,ou=system", "(ObjectClass=*)",
                SearchScope.OBJECT, "*" );

            int i = 0;

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

            cursor.close();
            assertEquals( 1, i );

            for ( int j = 0; j < 10000; j++ )
            {
                cursor = connection.search( "uid=admin,ou=system", "(ObjectClass=*)", SearchScope.OBJECT, "*" );

                while ( cursor.next() )
                {
                }

View Full Code Here

                {
                    t00 = System.currentTimeMillis();
                }

                long dt0 = System.nanoTime();
                cursor = new EntryCursorImpl( connection.search( searchRequest ) );
                long dt1 = System.nanoTime();

                deltaSearch += Math.abs( dt1 - dt0 );

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

            // Use the client API as JNDI cannot be used to do a search without
            // first binding. (hmmm, even client API won't allow searching without binding)
            connection.bind( "uid=admin,ou=system", "secret" );

            // Searches for all the entries in ou=system
            EntryCursor cursor = connection.search( "ou=system", "(ObjectClass=*)",
                SearchScope.ONELEVEL, "*" );

            int i = 0;

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

            cursor.close();
            assertEquals( 5, i );

            for ( int j = 0; j < 10000; j++ )
            {
                cursor = connection.search( "ou=system", "(ObjectClass=*)", SearchScope.ONELEVEL, "*" );

                while ( cursor.next() )
                {
                    cursor.get();
                }
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.