public final class PersistentSearch extends Object
Work flow element implementations are responsible for managing the persistent searches that they are currently handling.
Typically, a work flow element search operation will first decode
the persistent search control and construct a new PersistentSearch
.
Once the initial search result set has been returned and no errors
encountered, the work flow element implementation should register a
cancellation callback which will be invoked when the persistent
search is cancelled. This is achieved using
registerCancellationCallback(CancellationCallback)
. The
callback should make sure that any resources associated with the
PersistentSearch
are released. This may included removing
the PersistentSearch
from a list, or abandoning a
persistent search operation that has been sent to a remote server.
Finally, the PersistentSearch
should be enabled using
enable()
. This method will register the PersistentSearch
with the client connection and notify the
underlying search operation that no result should be sent to the
client.
Work flow element implementations should cancel()
active
persistent searches when the work flow element fails or is shut
down.
Modifier and Type | Class and Description |
---|---|
static interface |
PersistentSearch.CancellationCallback
A cancellation call-back which can be used by work-flow element
implementations in order to register for resource cleanup when a
persistent search is cancelled.
|
Constructor and Description |
---|
PersistentSearch(SearchOperation searchOperation,
Set<PersistentSearchChangeType> changeTypes,
boolean changesOnly,
boolean returnECs)
Creates a new persistent search object with the provided information.
|
Modifier and Type | Method and Description |
---|---|
CancelResult |
cancel()
Cancels this persistent search operation.
|
void |
enable()
Enable this persistent search.
|
int |
getMessageID()
Gets the message ID associated with this persistent search.
|
SearchOperation |
getSearchOperation()
Get the search operation associated with this persistent search.
|
boolean |
isChangesOnly()
Returns whether only entries updated after the beginning of this persistent
search should be returned.
|
void |
processAdd(Entry entry)
Notifies the persistent searches that an entry has been added.
|
void |
processDelete(Entry entry)
Notifies the persistent searches that an entry has been deleted.
|
void |
processModify(Entry entry)
Notifies the persistent searches that an entry has been modified.
|
void |
processModify(Entry entry,
Entry oldEntry)
Notifies persistent searches that an entry has been modified.
|
void |
processModifyDN(Entry entry,
org.forgerock.opendj.ldap.Dn oldDN)
Notifies the persistent searches that an entry has been renamed.
|
void |
registerCancellationCallback(PersistentSearch.CancellationCallback callback)
Registers a cancellation callback with this persistent search.
|
String |
toString()
Retrieves a string representation of this persistent search.
|
void |
toString(StringBuilder buffer)
Appends a string representation of this persistent search to the
provided buffer.
|
public PersistentSearch(SearchOperation searchOperation, Set<PersistentSearchChangeType> changeTypes, boolean changesOnly, boolean returnECs)
searchOperation
- The search operation for this persistent search.changeTypes
- The change types for which changes should be examined.changesOnly
- whether to only return entries that have been updated since the
beginning of the searchreturnECs
- Indicates whether to include entry change notification controls in
search result entries sent to the client.public CancelResult cancel()
public int getMessageID()
public SearchOperation getSearchOperation()
public boolean isChangesOnly()
public void processAdd(Entry entry)
entry
- The entry that was added.public void processDelete(Entry entry)
entry
- The entry that was deleted.public void processModify(Entry entry)
entry
- The entry after it was modified.public void processModify(Entry entry, Entry oldEntry)
entry
- The entry after it was modified.oldEntry
- The entry before it was modified.public void processModifyDN(Entry entry, org.forgerock.opendj.ldap.Dn oldDN)
entry
- The entry after it was modified.oldDN
- The DN of the entry before it was renamed.public void registerCancellationCallback(PersistentSearch.CancellationCallback callback)
callback
- The cancellation callback.public void enable()
public void toString(StringBuilder buffer)
buffer
- The buffer to which the information should be appended.Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.