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
,java.io.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 thePersistentSearchRequestControl
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
PersistentSearchChangeType
enum. - 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 totrue
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 thechangesOnly
flag set tofalse
.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ENTRY_CHANGE_NOTIFICATION_OID
The OID (2.16.840.1.113730.3.4.7) for the entry change notification control.
-
Constructor Summary
Constructors Constructor Description EntryChangeNotificationControl(PersistentSearchChangeType changeType, java.lang.String previousDN, long changeNumber)
Creates a new entry change notification control with the provided information.EntryChangeNotificationControl(PersistentSearchChangeType changeType, java.lang.String previousDN, long changeNumber, boolean isCritical)
Creates a new entry change notification control with the provided information.EntryChangeNotificationControl(java.lang.String oid, boolean isCritical, ASN1OctetString value)
Creates a new entry change notification control with the provided information.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EntryChangeNotificationControl
decodeControl(java.lang.String oid, boolean isCritical, ASN1OctetString value)
Creates a new instance of this decodeable control from the provided information.static EntryChangeNotificationControl
get(SearchResultEntry entry)
Extracts an entry change notification control from the provided search result entry.long
getChangeNumber()
Retrieves the change number for the associated change, if available.PersistentSearchChangeType
getChangeType()
Retrieves the change type for this entry change notification control.java.lang.String
getControlName()
Retrieves the user-friendly name for this control, if available.java.lang.String
getPreviousDN()
Retrieves the previous DN for the entry, if applicable.void
toString(java.lang.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, deregisterDecodeableControl, encode, encodeControls, equals, getOID, getValue, hashCode, hasValue, isCritical, readFrom, registerDecodeableControl, toString, writeTo
-
-
-
-
Field Detail
-
ENTRY_CHANGE_NOTIFICATION_OID
public static final java.lang.String ENTRY_CHANGE_NOTIFICATION_OID
The OID (2.16.840.1.113730.3.4.7) for the entry change notification control.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EntryChangeNotificationControl
public EntryChangeNotificationControl(PersistentSearchChangeType changeType, java.lang.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(PersistentSearchChangeType changeType, java.lang.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(java.lang.String oid, boolean isCritical, 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 benull
if no value was provided.- Throws:
LDAPException
- If the provided control cannot be decoded as an entry change notification control.
-
-
Method Detail
-
decodeControl
public EntryChangeNotificationControl decodeControl(java.lang.String oid, boolean isCritical, ASN1OctetString value) throws LDAPException
Creates a new instance of this decodeable control from the provided information.- Specified by:
decodeControl
in 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 benull
if 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
public static EntryChangeNotificationControl get(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
null
if 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
public PersistentSearchChangeType getChangeType()
Retrieves the change type for this entry change notification control.- Returns:
- The change type for this entry change notification control.
-
getPreviousDN
public java.lang.String getPreviousDN()
Retrieves the previous DN for the entry, if applicable.- Returns:
- The previous DN for the entry, or
null
if there is none.
-
getChangeNumber
public long 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
public java.lang.String 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:
getControlName
in classControl
- Returns:
- The user-friendly name for this control, or the OID if no user-friendly name is available.
-
-