Package com.unboundid.ldap.sdk.controls
Class EntryChangeNotificationControl
java.lang.Object
com.unboundid.ldap.sdk.Control
com.unboundid.ldap.sdk.controls.EntryChangeNotificationControl
- All Implemented Interfaces:
DecodeableControl,Serializable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class EntryChangeNotificationControl
extends Control
implements DecodeableControl
This class provides an implementation of the entry change notification
control as defined in draft-ietf-ldapext-psearch. It will be returned in
search result entries that match the criteria associated with a persistent
search (see the
The information that can be included in an entry change notification control includes:
PersistentSearchRequestControl class) and have been
changed in a way associated with the registered change types for that search.
The information that can be included in an entry change notification control includes:
- A change type, which indicates the type of operation that was performed
to trigger this entry change notification control. It will be one of
the values of the
PersistentSearchChangeTypeenum. - An optional previous DN, which indicates the DN that the entry had before the associated operation was processed. It will only be present if the associated operation was a modify DN operation.
- An optional change number, which may be used to retrieve additional information about the associated operation from the server. This may not be available in all directory server implementations.
returnECs flag set to true to
indicate that entry change notification controls should be included in
resulting entries. Further, the entry change notification control will only
be included in entries that are returned as the result of a change in the
server and not any of the preliminary entries that may be returned if the
corresponding persistent search request had the changesOnly flag set
to false.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe OID (2.16.840.1.113730.3.4.7) for the entry change notification control. -
Constructor Summary
ConstructorsConstructorDescriptionEntryChangeNotificationControl(PersistentSearchChangeType changeType, String previousDN, long changeNumber) Creates a new entry change notification control with the provided information.EntryChangeNotificationControl(PersistentSearchChangeType changeType, String previousDN, long changeNumber, boolean isCritical) Creates a new entry change notification control with the provided information.EntryChangeNotificationControl(String oid, boolean isCritical, ASN1OctetString value) Creates a new entry change notification control with the provided information. -
Method Summary
Modifier and TypeMethodDescriptiondecodeControl(String oid, boolean isCritical, ASN1OctetString value) Creates a new instance of this decodeable control from the provided information.get(SearchResultEntry entry) Extracts an entry change notification control from the provided search result entry.longRetrieves the change number for the associated change, if available.Retrieves the change type for this entry change notification control.Retrieves the user-friendly name for this control, if available.Retrieves the previous DN for the entry, if applicable.voidtoString(StringBuilder buffer) Appends a string representation of this LDAP control to the provided buffer.Methods inherited from class com.unboundid.ldap.sdk.Control
decode, decode, decodeControls, decodeJSONControl, deregisterDecodeableControl, encode, encodeControls, equals, getOID, getValue, hashCode, hasValue, isCritical, readFrom, registerDecodeableControl, registerDecodeableControl, toJSONControl, toString, writeTo
-
Field Details
-
ENTRY_CHANGE_NOTIFICATION_OID
The OID (2.16.840.1.113730.3.4.7) for the entry change notification control.- See Also:
-
-
Constructor Details
-
EntryChangeNotificationControl
public EntryChangeNotificationControl(@NotNull PersistentSearchChangeType changeType, @Nullable String previousDN, long changeNumber) Creates a new entry change notification control with the provided information. It will not be critical.- Parameters:
changeType- The change type for the change. It must not benull.previousDN- The previous DN of the entry, if applicable.changeNumber- The change number to include in this control, or -1 if there should not be a change number.
-
EntryChangeNotificationControl
public EntryChangeNotificationControl(@NotNull PersistentSearchChangeType changeType, @Nullable String previousDN, long changeNumber, boolean isCritical) Creates a new entry change notification control with the provided information.- Parameters:
changeType- The change type for the change. It must not benull.previousDN- The previous DN of the entry, if applicable.changeNumber- The change number to include in this control, or -1 if there should not be a change number.isCritical- Indicates whether this control should be marked critical. Response controls should generally not be critical.
-
EntryChangeNotificationControl
public EntryChangeNotificationControl(@NotNull String oid, boolean isCritical, @Nullable ASN1OctetString value) throws LDAPException Creates a new entry change notification control with the provided information.- Parameters:
oid- The OID for the control.isCritical- Indicates whether the control should be marked critical.value- The encoded value for the control. This may benullif no value was provided.- Throws:
LDAPException- If the provided control cannot be decoded as an entry change notification control.
-
-
Method Details
-
decodeControl
@NotNull public EntryChangeNotificationControl decodeControl(@NotNull String oid, boolean isCritical, @Nullable ASN1OctetString value) throws LDAPException Creates a new instance of this decodeable control from the provided information.- Specified by:
decodeControlin interfaceDecodeableControl- Parameters:
oid- The OID for the control.isCritical- Indicates whether the control should be marked critical.value- The encoded value for the control. This may benullif no value was provided.- Returns:
- The decoded representation of this control.
- Throws:
LDAPException- If the provided information cannot be decoded as a valid instance of this decodeable control.
-
get
@Nullable public static EntryChangeNotificationControl get(@NotNull SearchResultEntry entry) throws LDAPException Extracts an entry change notification control from the provided search result entry.- Parameters:
entry- The search result entry from which to retrieve the entry change notification control.- Returns:
- The entry change notification control contained in the provided
search result entry, or
nullif the entry did not contain an entry change notification control. - Throws:
LDAPException- If a problem is encountered while attempting to decode the entry change notification control contained in the provided entry.
-
getChangeType
Retrieves the change type for this entry change notification control.- Returns:
- The change type for this entry change notification control.
-
getPreviousDN
Retrieves the previous DN for the entry, if applicable.- Returns:
- The previous DN for the entry, or
nullif there is none.
-
getChangeNumber
Retrieves the change number for the associated change, if available.- Returns:
- The change number for the associated change, or -1 if none was provided.
-
getControlName
Retrieves the user-friendly name for this control, if available. If no user-friendly name has been defined, then the OID will be returned.- Overrides:
getControlNamein classControl- Returns:
- The user-friendly name for this control, or the OID if no user-friendly name is available.
-
toString
Appends a string representation of this LDAP control to the provided buffer.
-