org.ldaptive.control.util
Class SyncReplClient

java.lang.Object
  extended by org.ldaptive.control.util.SyncReplClient

public class SyncReplClient
extends Object

Client that simplifies using the sync repl control.

Version:
$Revision: 2885 $ $Date: 2014-02-05 16:28:49 -0500 (Wed, 05 Feb 2014) $
Author:
Middleware Services

Field Summary
protected  org.slf4j.Logger logger
          Logger for this class.
 
Constructor Summary
SyncReplClient(Connection conn, boolean persist)
          Creates a new sync repl client.
SyncReplClient(Connection conn, boolean persist, byte[] cookie)
          Deprecated. use SyncReplClient(Connection, boolean) instead
 
Method Summary
 Response<Void> cancel(int messageId)
          Invokes a cancel operation on the supplied ldap message id.
 BlockingQueue<SyncReplItem> execute(SearchRequest request)
          Invokes execute(SearchRequest, CookieManager, int) with a DefaultCookieManager and a capacity of Integer.MAX_VALUE.
 BlockingQueue<SyncReplItem> execute(SearchRequest request, CookieManager manager)
          Invokes execute(SearchRequest, CookieManager, int) with a capacity of Integer.MAX_VALUE.
 BlockingQueue<SyncReplItem> execute(SearchRequest request, CookieManager manager, int capacity)
          Performs an async search operation with the SyncRequestControl.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Logger for this class.

Constructor Detail

SyncReplClient

public SyncReplClient(Connection conn,
                      boolean persist)
Creates a new sync repl client.

Parameters:
conn - to execute the async search operation on
persist - whether to refresh and persist or just refresh

SyncReplClient

@Deprecated
public SyncReplClient(Connection conn,
                                 boolean persist,
                                 byte[] cookie)
Deprecated. use SyncReplClient(Connection, boolean) instead

Creates a new sync repl client.

Parameters:
conn - to execute the async search operation on
persist - whether to refresh and persist or just refresh
cookie - optional sync repl cookie
Method Detail

execute

public BlockingQueue<SyncReplItem> execute(SearchRequest request)
                                    throws LdapException
Invokes execute(SearchRequest, CookieManager, int) with a DefaultCookieManager and a capacity of Integer.MAX_VALUE.

Parameters:
request - search request to execute
Returns:
blocking queue to wait for sync repl items
Throws:
LdapException - if the search fails

execute

public BlockingQueue<SyncReplItem> execute(SearchRequest request,
                                           CookieManager manager)
                                    throws LdapException
Invokes execute(SearchRequest, CookieManager, int) with a capacity of Integer.MAX_VALUE.

Parameters:
request - search request to execute
manager - for reading and writing cookies
Returns:
blocking queue to wait for sync repl items
Throws:
LdapException - if the search fails

execute

public BlockingQueue<SyncReplItem> execute(SearchRequest request,
                                           CookieManager manager,
                                           int capacity)
                                    throws LdapException
Performs an async search operation with the SyncRequestControl. The supplied request is modified in the following way:

The search request object should not be reused for any other search operations.

Parameters:
request - search request to execute
manager - for reading and writing cookies
capacity - of the returned blocking queue
Returns:
blocking queue to wait for sync repl items
Throws:
LdapException - if the search fails

cancel

public Response<Void> cancel(int messageId)
                      throws LdapException
Invokes a cancel operation on the supplied ldap message id. Convenience method supplied to cancel sync repl operations.

Parameters:
messageId - of the operation to cancel
Returns:
cancel operation response
Throws:
LdapException - if the cancel operation fails


Copyright © 2003-2015 Virginia Tech. All Rights Reserved.