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

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


   
                asyncCnx.add( kate );
            }
   
            // Searches for all the entries in ou=system
            cursor = asyncCnx.search( "ou=system", "(ObjectClass=*)", SearchScope.SUBTREE, "*" );
   
            // Now loop on all the elements found, and abandon after 10 elements returned
            int count = 0;
   
            while ( cursor.next() )
View Full Code Here


        req.setBase( new Dn( "ou=system" ) );
        req.setFilter( "(ou=*)" );
        req.setScope( SearchScope.SUBTREE );
        req.setSizeLimit( sizeLimit );
   
        Cursor<Response> cursor = connection.search( req );
        long i = 0;
   
        // Equivalent to : while ( cursor.next() )
        for ( Response response : cursor )
        {
View Full Code Here

        SearchRequest req = new SearchRequestImpl();
        req.setBase( new Dn( "ou=schema" ) );
        req.setFilter( "(objectClass=*)" );
        req.setScope( SearchScope.SUBTREE );
   
        Cursor<Response> cursor = connection.search( req );
        int count = 0;
   
        while ( cursor.next() )
        {
            ++count;
View Full Code Here

        }
   
        cursor.close();
   
        req.setTimeLimit( 1 );
        cursor = connection.search( req );
        int newCount = 0;
   
        while ( cursor.next() )
        {
            ++newCount;
View Full Code Here

        DN base = addSearchData( new DN( "ou=system" ), 3, 10 );
        DN userDn = new DN( "uid=" + uid + ",ou=users,ou=system" );
        results.clear();
        LdapConnection userCtx = getConnectionAs( userDn, password );
        Cursor<SearchResponse> cursor = userCtx.search( base.getName(), filter, scope, "*" );
        int counter = 0;

        while ( cursor.next() )
        {
            Entry result = ( ( SearchResultEntry ) cursor.get() ).getEntry();
View Full Code Here

        addEntryACI( base, aci );
        DN userDn = new DN( "uid=" + uid + ",ou=users,ou=system" );

        results.clear();
        LdapConnection userCtx = getConnectionAs( userDn, password );
        Cursor<SearchResponse> cursor = userCtx.search( base.getName(), "(objectClass=*)", scope, "*" );
        int counter = 0;

        while ( cursor.next() )
        {
            Entry result = ( ( SearchResultEntry ) cursor.get() ).getEntry();
View Full Code Here

    public void testAddSearchData() throws Exception
    {
        LdapConnection connection = getAdminConnection();
        DN base = addSearchData( new DN( "ou=system" ), 3, 10 );

        Cursor<SearchResponse> results = connection
            .search( base.getName(), "(objectClass=*)", SearchScope.SUBTREE, "+" );
        int counter = 0;

        while ( results.next() )
        {
View Full Code Here

    {
        LdapConnection userCtx = getConnectionAs( new DN( "uid=" + uid + ",ou=users,ou=system" ), password );
        SearchResultEntry result = null;
        Cursor<SearchResponse> list = null;

        list = userCtx.search( dn.getName(), "(objectClass=*)", SearchScope.OBJECT, "*" );
        if ( list.next() )
        {
            result = ( SearchResultEntry ) list.get();
        }

View Full Code Here

    {
        LdapConnection connection = getAdminConnection();

        HashSet<String> set = new HashSet<String>();

        Cursor<SearchResponse> cursor = connection.search( "ou=system", "(objectClass=*)", SearchScope.SUBTREE, "*" );

        while ( cursor.next() )
        {
            Entry result = ( ( SearchResultEntry ) cursor.get() ).getEntry();
            set.add( result.getDn().getName() );
View Full Code Here

        LdapConnection connection = null;
        try
        {
            connection = connectionPool.getConnection();

            for ( Entry entry : new EntryCursorImpl( connection.search( searchRequest ) ) )
            {
                entries.add( entryMapper.map( entry ) );
            }
        }
        catch ( LdapException e )
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.