public final class EntryChangeNotificationResponseControl extends Object implements Control
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<EntryChangeNotificationResponseControl> |
DECODER
A decoder which can be used for decoding the entry change notification response control.
|
static String |
OID
The OID for the entry change notification response control.
|
Modifier and Type | Method and Description |
---|---|
long |
getChangeNumber()
Returns the change number for this entry change notification control.
|
PersistentSearchChangeType |
getChangeType()
Returns the change type for this entry change notification control.
|
String |
getOid()
Returns the numeric OID associated with this control.
|
Dn |
getPreviousName()
Returns the distinguished name that the entry had prior to a modify DN
operation, or
null if the operation was not a modify DN. |
ByteString |
getValue()
Returns the value, if any, associated with this control.
|
boolean |
hasValue()
Returns
true if this control has a value. |
boolean |
isCritical()
Returns
true if it is unacceptable to perform the operation
without applying the semantics of this control. |
static EntryChangeNotificationResponseControl |
newControl(PersistentSearchChangeType type,
Dn previousName,
long changeNumber)
Creates a new entry change notification response control with the
provided change type and optional previous distinguished name and change
number.
|
static EntryChangeNotificationResponseControl |
newControl(PersistentSearchChangeType type,
String previousName,
long changeNumber)
Creates a new entry change notification response control with the
provided change type and optional previous distinguished name and change
number.
|
String |
toString() |
public static final String OID
public static final ControlDecoder<EntryChangeNotificationResponseControl> DECODER
public static EntryChangeNotificationResponseControl newControl(PersistentSearchChangeType type, Dn previousName, long changeNumber)
type
- The change type for this change notification control.previousName
- The distinguished name that the entry had prior to a modify DN
operation, or null
if the operation was not a
modify DN.changeNumber
- The change number for the associated change, or a negative
value if no change number is available.NullPointerException
- If type
was null
.public static EntryChangeNotificationResponseControl newControl(PersistentSearchChangeType type, String previousName, long changeNumber)
type
- The change type for this change notification control.previousName
- The distinguished name that the entry had prior to a modify DN
operation, or null
if the operation was not a
modify DN.changeNumber
- The change number for the associated change, or a negative
value if no change number is available.LocalizedIllegalArgumentException
- If previousName
is not a valid LDAP string
representation of a DN.NullPointerException
- If type
was null
.public long getChangeNumber()
public PersistentSearchChangeType getChangeType()
public String getOid()
Control
public Dn getPreviousName()
null
if the operation was not a modify DN.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 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.Copyright 2010-2022 ForgeRock AS.