public final class PersistentSearchRequestControl extends Object implements Control
You can examine the entry change notification response control to get more information about a change returned by the persistent search.
Connection connection = ...; SearchRequest request = Requests.newSearchRequest( "dc=example,dc=com", SearchScope.WHOLE_SUBTREE, "(objectclass=inetOrgPerson)", "cn") .addControl(PersistentSearchRequestControl.newControl( true, true, true, // critical,changesOnly,returnECs PersistentSearchChangeType.ADD, PersistentSearchChangeType.DELETE, PersistentSearchChangeType.MODIFY, PersistentSearchChangeType.MODIFYDN)); ConnectionEntryReader reader = connection.search(request); while (reader.hasNext()) { if (!reader.isReference()) { SearchResultEntry entry = reader.readEntry(); // Entry that changed EntryChangeNotificationResponseControl control = entry.getControl( EntryChangeNotificationResponseControl.DECODER, new DecodeOptions()); PersistentSearchChangeType type = control.getChangeType(); if (type.equals(PersistentSearchChangeType.MODIFYDN)) { // Previous DN: control.getPreviousName() } // Change number: control.getChangeNumber()); } }
Modifier and Type | Field and Description |
---|---|
static ControlDecoder<PersistentSearchRequestControl> |
DECODER
A decoder which can be used for decoding the persistent search request control.
|
static String |
OID
The OID for the persistent search request control.
|
Modifier and Type | Method and Description |
---|---|
Set<PersistentSearchChangeType> |
getChangeTypes()
Returns an unmodifiable set containing the types of update operation for
which change notifications should be returned.
|
String |
getOid()
Returns the numeric OID associated with this control.
|
ByteString |
getValue()
Returns the value, if any, associated with this control.
|
boolean |
hasValue()
Returns
true if this control has a value. |
boolean |
isChangesOnly()
Returns
true if only updated entries should be returned (added,
modified, deleted, or subject to a modifyDN operation), otherwise
false if the search will initially return all the existing
entries which match the filter. |
boolean |
isCritical()
Returns
true if it is unacceptable to perform the operation
without applying the semantics of this control. |
boolean |
isReturnEcs()
Returns
true if the entry change notification control should be
included in updated entries that match the associated search criteria. |
static PersistentSearchRequestControl |
newControl(boolean isCritical,
boolean changesOnly,
boolean returnECs,
Collection<PersistentSearchChangeType> changeTypes)
Creates a new persistent search request control.
|
static PersistentSearchRequestControl |
newControl(boolean isCritical,
boolean changesOnly,
boolean returnECs,
PersistentSearchChangeType... changeTypes)
Creates a new persistent search request control.
|
String |
toString() |
public static final String OID
public static final ControlDecoder<PersistentSearchRequestControl> DECODER
public static PersistentSearchRequestControl newControl(boolean isCritical, boolean changesOnly, boolean returnECs, Collection<PersistentSearchChangeType> changeTypes)
isCritical
- true
if it is unacceptable to perform the operation
without applying the semantics of this control, or
false
if it can be ignoredchangesOnly
- Indicates whether only updated entries should be
returned (added, modified, deleted, or subject to a modifyDN
operation). If this parameter is false
then the search
will initially return all the existing entries which match the
filter.returnECs
- Indicates whether the entry change notification control
should be included in updated entries that match the
associated search criteria.changeTypes
- The types of update operation for which change notifications
should be returned.NullPointerException
- If changeTypes
was null
.public static PersistentSearchRequestControl newControl(boolean isCritical, boolean changesOnly, boolean returnECs, PersistentSearchChangeType... changeTypes)
isCritical
- true
if it is unacceptable to perform the operation
without applying the semantics of this control, or
false
if it can be ignoredchangesOnly
- Indicates whether only updated entries should be
returned (added, modified, deleted, or subject to a modifyDN
operation). If this parameter is false
then the search
will initially return all the existing entries which match the
filter.returnECs
- Indicates whether the entry change notification control
should be included in updated entries that match the
associated search criteria.changeTypes
- The types of update operation for which change notifications
should be returned.NullPointerException
- If changeTypes
was null
.public Set<PersistentSearchChangeType> getChangeTypes()
public String getOid()
Control
public ByteString getValue()
Control
public boolean hasValue()
Control
true
if this control has a value. In some circumstances
it may be useful to determine if a control has a value, without actually
calculating the value and incurring any performance costs.public boolean isChangesOnly()
true
if only updated entries should be returned (added,
modified, deleted, or subject to a modifyDN operation), otherwise
false
if the search will initially return all the existing
entries which match the filter.true
if only updated entries should be returned (added,
modified, deleted, or subject to a modifyDN operation), otherwise
false
if the search will initially return all the
existing entries which match the filter.public boolean isCritical()
Control
true
if it is unacceptable to perform the operation
without applying the semantics of this control.
The criticality field only has meaning in controls attached to request
messages (except UnbindRequest). For controls attached to response
messages and the UnbindRequest, the criticality field SHOULD be
false
, and MUST be ignored by the receiving protocol peer. A
value of true
indicates that it is unacceptable to perform the
operation without applying the semantics of the control.
isCritical
in interface Control
true
if this control must be processed by the Directory
Server, or false
if it can be ignored.public boolean isReturnEcs()
true
if the entry change notification control should be
included in updated entries that match the associated search criteria.true
if the entry change notification control should be
included in updated entries that match the associated search
criteria.Copyright 2010-2022 ForgeRock AS.