Package org.ldaptive.control.util
Class PersistentSearchClient
- java.lang.Object
-
- org.ldaptive.control.util.PersistentSearchClient
-
public class PersistentSearchClient extends java.lang.ObjectClient that simplifies using the persistent search control.- Author:
- Middleware Services
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.LoggerloggerLogger for this class.
-
Constructor Summary
Constructors Constructor Description PersistentSearchClient(ConnectionFactory cf, java.util.EnumSet<PersistentSearchChangeType> types, boolean co, boolean re)Creates a new persistent search client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabandon()Invokes an abandon operation on the search handle.SearchOperationHandlesend(SearchRequest request)Performs an async search operation with thePersistentSearchRequestControl.voidsetOnEntry(java.util.function.Consumer<LdapEntry> consumer)Sets the onEntry consumer.voidsetOnException(java.util.function.Consumer<java.lang.Exception> consumer)Sets the onException consumer.voidsetOnResult(java.util.function.Consumer<Result> consumer)Sets the onResult consumer.
-
-
-
Constructor Detail
-
PersistentSearchClient
public PersistentSearchClient(ConnectionFactory cf, java.util.EnumSet<PersistentSearchChangeType> types, boolean co, boolean re)
Creates a new persistent search client.- Parameters:
cf- to get a connection fromtypes- persistent search change typesco- whether only changed entries are returnedre- return an Entry Change Notification control
-
-
Method Detail
-
setOnEntry
public void setOnEntry(java.util.function.Consumer<LdapEntry> consumer)
Sets the onEntry consumer.- Parameters:
consumer- to invoke when an entry is received
-
setOnResult
public void setOnResult(java.util.function.Consumer<Result> consumer)
Sets the onResult consumer.- Parameters:
consumer- to invoke when a result is received
-
setOnException
public void setOnException(java.util.function.Consumer<java.lang.Exception> consumer)
Sets the onException consumer.- Parameters:
consumer- to invoke when a sync info message is received
-
send
public SearchOperationHandle send(SearchRequest request) throws LdapException
Performs an async search operation with thePersistentSearchRequestControl. The supplied request is modified in the following way:AbstractRequestMessage.setControls( org.ldaptive.control.RequestControl...)is invoked withPersistentSearchRequestControl
The search request object should not be reused for any other search operations.
- Parameters:
request- search request to execute- Returns:
- search operation handle
- Throws:
LdapException- if the search fails
-
abandon
public void abandon()
Invokes an abandon operation on the search handle.
-
-