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

Examples of org.apache.directory.ldap.client.api.message.SearchResponse


            {
                Cursor<SearchResponse> cursor = connection.search( config.getBaseDn(), config.getFilter(), SearchScope.getSearchScope( config.getSearchScope() ), config.getAttributes() );
                cursor.beforeFirst();
                if( cursor.next() && cursor.next() ) // to skip the baseDN
                {
                    SearchResponse res = cursor.get();
                    if( res instanceof SearchResultEntry )
                    {
                        connection.delete( ( ( SearchResultEntry ) res ).getEntry().getDn()  );
                    }
                }
View Full Code Here


   
   
    @Test
    public void testLookup() throws Exception
    {
        SearchResponse resp = connection.lookup( ADMIN_DN );
        assertNotNull( resp );
       
        Entry entry = ( ( SearchResultEntry ) resp ).getEntry();
        assertNull( entry.get( SchemaConstants.ENTRY_UUID_AT ) );
View Full Code Here

    @Ignore( "failing to lookup an existing entry based on the entryUUID AT" )
    @Test
    public void searchByEntryUuid() throws Exception
    {
        SearchResponse resp = connection.lookup( ADMIN_DN, "+" );
        Entry entry = ( ( SearchResultEntry ) resp ).getEntry();
       
        String uuid = entry.get( SchemaConstants.ENTRY_UUID_AT ).getString();
       
        EqualityNode<String> filter = new EqualityNode<String>( SchemaConstants.ENTRY_UUID_AT, new ClientStringValue( uuid ) );
View Full Code Here

        Cursor<SearchResponse> cursor = connection.search( "dc=example,dc=com", "(objectClass=*)", SearchScope.SUBTREE,
            "*" );
        while ( cursor.next() )
        {
            SearchResponse sr = cursor.get();
            SearchResultEntry sre = ( SearchResultEntry ) sr;
        }

        cursor.close();

View Full Code Here

            }
            else
            {
                do
                {
                    SearchResponse searchResp = cursor.get();

                    if ( searchResp instanceof SearchResultEntry )
                    {
                        SearchResultEntry searchResult = ( SearchResultEntry ) searchResp;
                        deleteRecursive( searchResult.getEntry().getDn(), cursorMap, listener );
View Full Code Here

     * @return the Entry with the given DN or null if no entry exists with that DN
     * @throws LdapException in case of any problems while searching for the DN
     */
    public SearchResponse lookup( String dn, String... attributes ) throws LdapException
    {
        SearchResponse resp = null;
       
        try
        {
            Cursor<SearchResponse> cursor = search( dn, "(objectClass=*)", SearchScope.OBJECT, attributes );
            if( cursor.next() )
View Full Code Here

    public void testAsyncSearch() throws Exception
    {
        SearchFuture searchFuture = connection.searchAsync( "ou=system", "(objectclass=*)", SearchScope.ONELEVEL, "*",
            "+" );
        int count = 0;
        SearchResponse searchResponse = null;
        do
        {
            searchResponse = ( SearchResponse ) searchFuture.get( 1000, TimeUnit.MILLISECONDS );
            assertNotNull( searchResponse );
            if( !( searchResponse instanceof SearchResultDone ) )
View Full Code Here

        sr.setDerefAliases( AliasDerefMode.NEVER_DEREF_ALIASES );

        // Launch the search now
        SearchFuture searchFuture = connection.searchAsync( sr );
       
        SearchResponse searchResponse = null;
        int count = 0;
       
        do
        {
            searchResponse = searchFuture.get();
View Full Code Here

        connection.move( "ou=users,ou=system", "ou=groups,ou=system" );
        Entry entry = ( ( SearchResultEntry ) connection.lookup( "ou=users,ou=groups,ou=system" ) ).getEntry();
        assertNotNull( entry );

        SearchResponse res = connection.lookup( "ou=users,ou=system" );
        assertNull( res );
    }
View Full Code Here

            {
                Cursor<SearchResponse> cursor = connection.search( config.getBaseDn(), config.getFilter(), config.getSearchScope(), config.getAttributes() );
                cursor.beforeFirst();
                if( cursor.next() && cursor.next() ) // to skip the baseDN
                {
                    SearchResponse res = cursor.get();
                    if( res instanceof SearchResultEntry )
                    {
                        connection.delete( ( ( SearchResultEntry ) res ).getEntry().getDn()  );
                    }
                }
View Full Code Here

TOP

Related Classes of org.apache.directory.ldap.client.api.message.SearchResponse

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.