@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class PersistentSearchRequestControl extends Control
changeTypes
-- Specifies the set of change types for which to
receive notification. This may be any combination of one or more of
the PersistentSearchChangeType
values.changesOnly
-- Indicates whether to only return updated entries
that match the associated search criteria. If this is false
,
then the server will first return all existing entries in the server
that match the search criteria, and will then begin returning entries
that are updated in an operation associated with one of the
registered changeTypes
. If this is true
, then the
server will not return all matching entries that already exist in the
server but will only return entries in response to changes that
occur.returnECs
-- Indicates whether search result entries returned
as a result of a change to the directory data should include the
EntryChangeNotificationControl
to provide information about
the type of operation that occurred. If changesOnly
is
false
, then entry change notification controls will not be
included in existing entries that match the search criteria, but only
in entries that are updated by an operation with one of the registered
changeTypes
.LDAPConnection.asyncSearch(com.unboundid.ldap.sdk.SearchRequest)
method.
SearchRequest persistentSearchRequest = new SearchRequest( asyncSearchListener, "dc=example,dc=com", SearchScope.SUB, Filter.createPresenceFilter("objectClass")); persistentSearchRequest.addControl(new PersistentSearchRequestControl( PersistentSearchChangeType.allChangeTypes(), // Notify change types. true, // Only return new changes, don't match existing entries. true)); // Include change notification controls in search entries. // Launch the persistent search as an asynchronous operation. AsyncRequestID persistentSearchRequestID = connection.asyncSearch(persistentSearchRequest); // Modify an entry that matches the persistent search criteria. This // should cause the persistent search listener to be notified. LDAPResult modifyResult = connection.modify( "uid=test.user,ou=People,dc=example,dc=com", new Modification(ModificationType.REPLACE, "description", "test")); // Verify that the persistent search listener was notified.... // Since persistent search operations don't end on their own, we need to // abandon the search when we don't need it anymore. connection.abandon(persistentSearchRequestID);
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
PERSISTENT_SEARCH_REQUEST_OID
The OID (2.16.840.1.113730.3.4.3) for the persistent search request
control.
|
Constructor and Description |
---|
PersistentSearchRequestControl(Control control)
Creates a new persistent search request control which is decoded from the
provided generic control.
|
PersistentSearchRequestControl(PersistentSearchChangeType changeType,
boolean changesOnly,
boolean returnECs)
Creates a new persistent search control with the provided information.
|
PersistentSearchRequestControl(PersistentSearchChangeType changeType,
boolean changesOnly,
boolean returnECs,
boolean isCritical)
Creates a new persistent search control with the provided information.
|
PersistentSearchRequestControl(java.util.Set<PersistentSearchChangeType> changeTypes,
boolean changesOnly,
boolean returnECs)
Creates a new persistent search control with the provided information.
|
PersistentSearchRequestControl(java.util.Set<PersistentSearchChangeType> changeTypes,
boolean changesOnly,
boolean returnECs,
boolean isCritical)
Creates a new persistent search control with the provided information.
|
Modifier and Type | Method and Description |
---|---|
boolean |
changesOnly()
Indicates whether the search should only return search result entries for
changes made to entries matching the search criteria, or if existing
matching entries should be returned as well.
|
java.util.Set<PersistentSearchChangeType> |
getChangeTypes()
Retrieves the set of change types for this persistent search request
control.
|
java.lang.String |
getControlName()
Retrieves the user-friendly name for this control, if available.
|
boolean |
returnECs()
Indicates whether the search result entries returned as part of this
persistent search should include the entry change notification control.
|
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP control to the provided
buffer.
|
decode, decode, decodeControls, decodeJSONControl, deregisterDecodeableControl, encode, encodeControls, equals, getOID, getValue, hashCode, hasValue, isCritical, readFrom, registerDecodeableControl, registerDecodeableControl, toJSONControl, toString, writeTo
@NotNull public static final java.lang.String PERSISTENT_SEARCH_REQUEST_OID
public PersistentSearchRequestControl(@NotNull PersistentSearchChangeType changeType, boolean changesOnly, boolean returnECs)
changeType
- The change type for which to register. It must not be
null
.changesOnly
- Indicates whether the search should only return search
result entries for changes made to entries matching
the search criteria, or if existing matching entries
in the server should be returned as well.returnECs
- Indicates whether the search result entries returned
as part of this persistent search should include the
entry change notification control.public PersistentSearchRequestControl(@NotNull java.util.Set<PersistentSearchChangeType> changeTypes, boolean changesOnly, boolean returnECs)
changeTypes
- The set of change types for which to register. It
must not be null
or empty.changesOnly
- Indicates whether the search should only return search
result entries for changes made to entries matching
the search criteria, or if existing matching entries
in the server should be returned as well.returnECs
- Indicates whether the search result entries returned
as part of this persistent search should include the
entry change notification control.public PersistentSearchRequestControl(@NotNull PersistentSearchChangeType changeType, boolean changesOnly, boolean returnECs, boolean isCritical)
changeType
- The change type for which to register. It must not be
null
.changesOnly
- Indicates whether the search should only return search
result entries for changes made to entries matching
the search criteria, or if existing matching entries
in the server should be returned as well.returnECs
- Indicates whether the search result entries returned
as part of this persistent search should include the
entry change notification control.isCritical
- Indicates whether the control should be marked
critical.public PersistentSearchRequestControl(@NotNull java.util.Set<PersistentSearchChangeType> changeTypes, boolean changesOnly, boolean returnECs, boolean isCritical)
changeTypes
- The set of change types for which to register. It
must not be null
or empty.changesOnly
- Indicates whether the search should only return search
result entries for changes made to entries matching
the search criteria, or if existing matching entries
in the server should be returned as well.returnECs
- Indicates whether the search result entries returned
as part of this persistent search should include the
entry change notification control.isCritical
- Indicates whether the control should be marked
critical.public PersistentSearchRequestControl(@NotNull Control control) throws LDAPException
control
- The generic control to be decoded as a persistent search
request control.LDAPException
- If the provided control cannot be decoded as a
persistent search request control.@NotNull public java.util.Set<PersistentSearchChangeType> getChangeTypes()
public boolean changesOnly()
true
if the search should only return search result
entries for changes matching the search criteria, or false
if it should also return existing entries that match the search
criteria.public boolean returnECs()
true
if search result entries returned as part of this
persistent search should include the entry change notification
control, or false
if not.@NotNull public java.lang.String getControlName()
getControlName
in class Control