Package netscape.ldap.controls
Class LDAPEntryChangeControl
- java.lang.Object
-
- netscape.ldap.LDAPControl
-
- netscape.ldap.controls.LDAPEntryChangeControl
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class LDAPEntryChangeControl extends LDAPControl
Represents an LDAP v3 server control that specifies information about a change to an entry in the directory. (The OID for this control is 2.16.840.1.113730.3.4.7.) You need to use this control in conjunction with a "persistent search" control (represented byLDAPPersistentSearchControl
object.To use persistent searching for change notification, you create a "persistent search" control that specifies the types of changes that you want to track. When an entry is changed, the server sends that entry back to your client and may include an "entry change notification" control that specifies additional information about the change.
Typically, you use the
getResponseControls
method of theLDAPConnection
object to get anyLDAPEntryChangeControl
objects returned by the server.Once you retrieve an
LDAPEntryChangeControl
object from the server, you can get the following additional information about the change made to the entry:- The type of change made (add, modify, delete, or modify DN)
- The change number identifying the record of the change in the change log (if the server supports change logs)
- If the entry was renamed, the old DN of the entry
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
ENTRYCHANGED
-
Fields inherited from class netscape.ldap.LDAPControl
m_critical, m_value, MANAGEDSAIT, PWEXPIRED, PWEXPIRING
-
-
Constructor Summary
Constructors Constructor Description LDAPEntryChangeControl()
Constructs a newLDAPEntryChangeControl
object.LDAPEntryChangeControl(java.lang.String oid, boolean critical, byte[] value)
Contructs anLDAPEntryChangedControl
object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getChangeNumber()
Gets the change number, which identifies the record of the change in the server's change log.int
getChangeType()
Gets the change type, which identifies the type of change that occurred.java.lang.String
getPreviousDN()
Gets the previous DN of the entry (if the entry was renamed).void
setChangeNumber(int num)
Sets the change number (which identifies the record of the change in the server's change log) in this "entry change notification" control.void
setChangeType(int num)
Sets the change type (which identifies the type of change that occurred) in this "entry change notification" control.void
setPreviousDN(java.lang.String dn)
Sets the previous DN of the entry (if the entry was renamed) in the "entry change notification control".java.lang.String
toString()
Return a string representation of the control for debugging-
Methods inherited from class netscape.ldap.LDAPControl
clone, createControl, flattenBER, getID, getValue, isCritical, lookupControlClass, newInstance, register
-
-
-
-
Field Detail
-
ENTRYCHANGED
public static final java.lang.String ENTRYCHANGED
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LDAPEntryChangeControl
public LDAPEntryChangeControl()
Constructs a newLDAPEntryChangeControl
object.- See Also:
LDAPControl
,LDAPPersistSearchControl
-
LDAPEntryChangeControl
public LDAPEntryChangeControl(java.lang.String oid, boolean critical, byte[] value) throws LDAPException, java.io.IOException
Contructs anLDAPEntryChangedControl
object. This constructor is used byLDAPControl.register
to instantiate entry change controls.- Parameters:
oid
- this parameter must beLDAPEntryChangeControl.ENTRYCHANGED
or anLDAPException
is throwncritical
-true
if this control is criticalvalue
- the value associated with this control- Throws:
LDAPException
- If oid is notLDAPEntryChangeControl.ENTRYCHANGED
.java.io.IOException
- If value is not a valid BER sequence.- See Also:
LDAPControl.register(java.lang.String, java.lang.Class<?>)
-
-
Method Detail
-
setChangeNumber
public void setChangeNumber(int num)
Sets the change number (which identifies the record of the change in the server's change log) in this "entry change notification" control.- Parameters:
num
- change number to set- See Also:
getChangeNumber()
-
setChangeType
public void setChangeType(int num)
Sets the change type (which identifies the type of change that occurred) in this "entry change notification" control.- Parameters:
num
- change type to set. This can be one of the following values:LDAPPersistSearchControl.ADD
(a new entry was added to the directory)LDAPPersistSearchControl.DELETE
(an entry was removed from the directory)LDAPPersistSearchControl.MODIFY
(an entry was modified)LDAPPersistSearchControl.MODDN
(an entry was renamed)
- See Also:
getChangeType()
-
setPreviousDN
public void setPreviousDN(java.lang.String dn)
Sets the previous DN of the entry (if the entry was renamed) in the "entry change notification control".- Parameters:
dn
- the previous distinguished name of the entry- See Also:
getPreviousDN()
-
getChangeNumber
public int getChangeNumber()
Gets the change number, which identifies the record of the change in the server's change log.- Returns:
- change number identifying the change made.
- See Also:
setChangeNumber(int)
-
getChangeType
public int getChangeType()
Gets the change type, which identifies the type of change that occurred.- Returns:
- change type identifying the type of change that
occurred. This can be one of the following values:
LDAPPersistSearchControl.ADD
(a new entry was added to the directory)LDAPPersistSearchControl.DELETE
(an entry was removed from the directory)LDAPPersistSearchControl.MODIFY
(an entry was modified)LDAPPersistSearchControl.MODDN
(an entry was renamed)
- See Also:
setChangeType(int)
-
getPreviousDN
public java.lang.String getPreviousDN()
Gets the previous DN of the entry (if the entry was renamed).- Returns:
- the previous distinguished name of the entry.
- See Also:
setPreviousDN(java.lang.String)
-
toString
public java.lang.String toString()
Description copied from class:LDAPControl
Return a string representation of the control for debugging- Overrides:
toString
in classLDAPControl
- Returns:
- a string representation of the control.
-
-