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

Examples of org.apache.directory.api.ldap.model.message.Response


   
        SearchCursor searchCursor = connection.search( req );
   
        assertTrue( searchCursor.next() );
   
        Response response = searchCursor.get();
   
        Entry resultEntry = ( ( SearchResultEntry ) response ).getEntry();
        assertEquals( "cn=user1,ou=users,ou=system", resultEntry.getDn().getName() );
   
        cursor.close();
View Full Code Here


        searchRequest.addControl( syncReq );

        // Do the search. We use a searchAsync because we want to get SearchResultDone responses
        SearchFuture sf = connection.searchAsync( searchRequest );

        Response resp = sf.get();

        CONSUMER_LOG.debug( "Response from {} : {}", config.getProducer(), resp );

        // Now, process the responses. We loop until we have a connection termination or
        // a SearchResultDone (RefreshOnly mode)
View Full Code Here

            // clear the entry's all attributes except the Dn and entryUUID
            entry.clear();
            entry.add( uuid );
        }

        Response resp = generateResponse( session, req, entry );
        resp.addControl( syncStateControl );

        LOG.debug( "Sending {}", entry.getDn() );
        PROVIDER_LOG.debug( "Sending the entry:\n {}", resp );
        session.getIoSession().write( resp );
    }
View Full Code Here

        searchRequest.addControl( syncReq );

        // Do the search
        SearchFuture sf = connection.searchAsync( searchRequest );

        Response resp = sf.get();

        while ( !( resp instanceof SearchResultDone ) && !sf.isCancelled() && !disconnected )
        {
            if ( resp instanceof SearchResultEntry )
            {
View Full Code Here

                    respWriter.write( sb.toString() );
                }

                while ( searchResponses.next() )
                {
                    Response searchResponse = searchResponses.get();

                    if ( searchResponse.getType() == MessageTypeEnum.SEARCH_RESULT_ENTRY )
                    {
                        SearchResultEntry searchResultEntry = ( SearchResultEntry ) searchResponse;

                        SearchResultEntryDsml searchResultEntryDsml = new SearchResultEntryDsml(
                            connection.getCodecService(), searchResultEntry );
                        searchResponseDsml = new SearchResponseDsml( connection.getCodecService(),
                            searchResultEntryDsml );

                        if ( respWriter != null )
                        {
                            writeResponse( respWriter, searchResultEntryDsml );
                        }
                        else
                        {
                            searchResponseDsml.addResponse( searchResultEntryDsml );
                        }
                    }
                    else if ( searchResponse.getType() == MessageTypeEnum.SEARCH_RESULT_REFERENCE )
                    {
                        SearchResultReference searchResultReference = ( SearchResultReference ) searchResponse;

                        SearchResultReferenceDsml searchResultReferenceDsml = new SearchResultReferenceDsml(
                            connection.getCodecService(), searchResultReference );
View Full Code Here

            currentSearchResultEntry = null;

            // Do we have another response in the cursor?
            while ( cursor.next() )
            {
                Response currentResponse = cursor.get();

                // Is it a search result entry?
                if ( currentResponse instanceof SearchResultEntry )
                {
                    currentSearchResultEntry = ( SearchResultEntry ) currentResponse;
View Full Code Here

            // clear the entry's all attributes except the Dn and entryUUID
            entry.clear();
            entry.add( uuid );
        }

        Response resp = generateResponse( session, req, entry );
        resp.addControl( syncStateControl );

        LOG.debug( "Sending {}", entry.getDn() );
        PROVIDER_LOG.debug( "Sending the entry: {}", entry );
        session.getIoSession().write( resp );
    }
View Full Code Here

        sr.setDerefAliases( AliasDerefMode.NEVER_DEREF_ALIASES );

        // Launch the search now
        SearchFuture searchFuture = connection.searchAsync( sr );

        Response searchResponse = null;
        int count = 0;

        do
        {
            searchResponse = searchFuture.get();
View Full Code Here

        SearchCursor cursor = connection.search( searchRequest );
        int count = 0;
   
        while ( cursor.next() )
        {
            Response response = cursor.get();
            assertNotNull( response );
           
            if ( response instanceof SearchResultEntry )
            {
                Entry entry = ((SearchResultEntry)response).getEntry();
View Full Code Here

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

TOP

Related Classes of org.apache.directory.api.ldap.model.message.Response

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.