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

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


            Entry entryFound = cursor.get();
            assertNotNull( entryFound );
            entries.add( entryFound.getDn().getName() );
        }

        SearchResultDone done = cursor.getSearchResultDone();

        assertNotNull( done );
        assertEquals( ResultCodeEnum.SUCCESS, done.getLdapResult().getResultCode() );
        assertEquals( 3, entries.size() );
        assertTrue( entries.contains( "cn=test,dc=test,dc=com" ) );
        assertTrue( entries.contains( "cn=test,dc=example,dc=com" ) );
        assertTrue( entries.contains( "cn=test,ou=system" ) );
        cursor.close();
View Full Code Here


            Entry entry = cursor.get();
            assertNotNull( entry );
            count++;
        }
   
        SearchResultDone done = cursor.getSearchResultDone();
   
        assertNotNull( done );
        assertEquals( ResultCodeEnum.SUCCESS, done.getLdapResult().getResultCode() );
        assertEquals( 5, count );
        cursor.close();
    }
View Full Code Here

                    Entry result = cursor.get();
                    results.add( result );
                    ++i;
                }

                SearchResultDone result = cursor.getSearchResultDone();
                pagedSearchControl = ( PagedResults ) result.getControl( PagedResults.OID );

                if ( result.getLdapResult().getResultCode() == ResultCodeEnum.UNWILLING_TO_PERFORM )
                {
                    hasUnwillingToPerform = true;
                    break;
                }
            }
View Full Code Here

            }
   
            count++;
        }
   
        SearchResultDone done = cursor.getSearchResultDone();
   
        assertNotNull( done );
        assertEquals( ResultCodeEnum.SUCCESS, done.getLdapResult().getResultCode() );
        assertEquals( 5, count );
        cursor.close();
    }
View Full Code Here

        {
            assertNotNull( cursor.get() );
            count++;
        }
   
        SearchResultDone done = cursor.getSearchResultDone();
   
        assertNotNull( done );
        assertEquals( ResultCodeEnum.SUCCESS, done.getLdapResult().getResultCode() );
        assertEquals( 5, count );
        cursor.close();
    }
View Full Code Here

        Entry entry = cursor.get();
        assertNotNull( entry );
        count++;
    }

    SearchResultDone done = cursor.getSearchResultDone();

    assertNotNull( done );
    assertEquals( ResultCodeEnum.SUCCESS, done.getLdapResult().getResultCode() );
    assertEquals( 4, count );
    cursor.close();
}
View Full Code Here

        }

        count++;
    }

    SearchResultDone done = cursor.getSearchResultDone();

    assertNotNull( done );
    assertEquals( ResultCodeEnum.SUCCESS, done.getLdapResult().getResultCode() );
    assertEquals( 4, count );
    cursor.close();
}
View Full Code Here

    {
        assertNotNull( cursor.get() );
        count++;
    }

    SearchResultDone done = cursor.getSearchResultDone();

    assertNotNull( done );
    assertEquals( ResultCodeEnum.SUCCESS, done.getLdapResult().getResultCode() );
    assertEquals( 4, count );
    cursor.close();
}
View Full Code Here

                replicaLog.getPersistentListener().setPushInRealTime( refreshNPersist );
            }
            else
            {
                SearchResultDone searchDoneResp = ( SearchResultDone ) req.getResultResponse();
                searchDoneResp.getLdapResult().setResultCode( ResultCodeEnum.SUCCESS );
                SyncDoneValue syncDone = new SyncDoneValueDecorator(
                    ldapServer.getDirectoryService().getLdapCodecService() );
                syncDone.setCookie( cookie );
                searchDoneResp.addControl( syncDone );

                PROVIDER_LOG.debug( "Send a SearchResultDone response to the {} consumer", replicaLog.getId(),
                    searchDoneResp );

                session.getIoSession().write( searchDoneResp );
View Full Code Here

        // modify the filter to include the context Csn
        ExprNode initialContentFilter = new AndNode( modifiedFilter, csnNode );
        request.setFilter( initialContentFilter );

        // Now, do a search to get all the entries
        SearchResultDone searchDoneResp = doSimpleSearch( session, request, replicaLog );

        if ( searchDoneResp.getLdapResult().getResultCode() == ResultCodeEnum.SUCCESS )
        {
            if ( replicaLog.getLastSentCsn() == null )
            {
                replicaLog.setLastSentCsn( contextCsn );
            }

            if ( refreshNPersist ) // refreshAndPersist mode
            {
                PROVIDER_LOG
                    .debug( "Refresh&Persist requested : send the data being modified since the initial refresh" );
                // Now, send the modified entries since the search has started
                sendContentFromLog( session, request, replicaLog, contextCsn );

                byte[] cookie = LdapProtocolUtils.createCookie( replicaLog.getId(), replicaLog.getLastSentCsn() );

                IntermediateResponse intermResp = new IntermediateResponseImpl( request.getMessageId() );
                intermResp.setResponseName( SyncInfoValue.OID );

                SyncInfoValue syncInfo = new SyncInfoValueDecorator(
                    ldapServer.getDirectoryService().getLdapCodecService(), SynchronizationInfoEnum.NEW_COOKIE );
                syncInfo.setCookie( cookie );
                intermResp.setResponseValue( ( ( SyncInfoValueDecorator ) syncInfo ).getValue() );

                PROVIDER_LOG.info( "Sending the intermediate response to consumer {}, {}", replicaLog, syncInfo );

                session.getIoSession().write( intermResp );

                // switch the handler mode to realtime push
                replicationListener.setPushInRealTime( refreshNPersist );
                PROVIDER_LOG.debug( "e waiting for any modification for {}", replicaLog );
            }
            else
            {
                PROVIDER_LOG.debug( "RefreshOnly requested" );
                byte[] cookie = LdapProtocolUtils.createCookie( replicaLog.getId(), contextCsn );

                // no need to send from the log, that will be done in the next refreshOnly session
                SyncDoneValue syncDone = new SyncDoneValueDecorator(
                    ldapServer.getDirectoryService().getLdapCodecService() );
                syncDone.setCookie( cookie );
                searchDoneResp.addControl( syncDone );
                PROVIDER_LOG.info( "Sending the searchResultDone response to consumer {}, {}", replicaLog,
                    searchDoneResp );

                session.getIoSession().write( searchDoneResp );
            }
        }
        else
        // if not succeeded return
        {
            PROVIDER_LOG.warn( "initial content refresh didn't succeed due to {}", searchDoneResp.getLdapResult()
                .getResultCode() );
            replicaLog.stop();
            replicaLog = null;

            // remove the listener
View Full Code Here

TOP

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

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.