Class LdapPersistSearchControl

java.lang.Object
netscape.ldap.LDAPControl
netscape.ldap.controls.LDAPPersistSearchControl
com.netscape.jndi.ldap.controls.LdapPersistSearchControl
All Implemented Interfaces:
Serializable, Cloneable, Control

public class LdapPersistSearchControl extends netscape.ldap.controls.LDAPPersistSearchControl implements Control
Represents an LDAP v3 server control that specifies a persistent search (an ongoing search operation), which allows your LDAP client to get notification of changes to the directory. (The OID for this control is 2.16.840.1.113730.3.4.3.) You can use this control in conjunction with an "entry change notification" control.

To use persistent searching for change notification, you create a "persistent search" control that specifies the types of changes that you want to track. You include the control in a search request. If an entry in the directory is changed, the server determines if the entry matches the search criteria in your request and if the change is the type of change that you are tracking. If both of these are true, the server sends the entry to your client.

The server can also include an "entry change notification" control with the entry. (The OID for this control is 2.16.840.1.113730.3.4.7.) This control contains additional information about the change made to the entry, including the type of change made, the change number (which corresponds to an item in the server's change log, if the server supports a change log), and, if the entry was renamed, the old DN of the entry.

When constructing an LDAPPersistSearchControl object, you can specify the following information:

  • the type of change you want to track (added, modified, deleted, or renamed entries)
  • a preference indicating whether or not you want the server to return all entries that initially matched the search criteria (rather than only the entries that change)
  • a preference indicating whether or not you want entry change notification controls included with every entry returned by the server

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Change type specifying that you want to track additions of new entries to the directory.
    static final int
    Change type specifying that you want to track removals of entries from the directory.
    static final int
    Change type specifying that you want to track modifications of the DNs of entries in the directory.
    static final int
    Change type specifying that you want to track modifications of entries in the directory.

    Fields inherited from class netscape.ldap.controls.LDAPPersistSearchControl

    PERSISTENTSEARCH

    Fields inherited from class netscape.ldap.LDAPControl

    m_critical, m_value, MANAGEDSAIT, PWEXPIRED, PWEXPIRING

    Fields inherited from interface javax.naming.ldap.Control

    CRITICAL, NONCRITICAL
  • Constructor Summary

    Constructors
    Constructor
    Description
    LdapPersistSearchControl(int changeTypes, boolean changesOnly, boolean returnControls, boolean isCritical)
    Constructs an LdapPersistSearchControl object that specifies a persistent search.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether you want the server to send any existing entries that already match the search criteria or only the entries that have changed.
    int
    Gets the change types monitored by this control.
    byte[]
    Retrieves the ASN.1 BER encoded value of the LDAP control.
    boolean
    Indicates whether or not the server includes an "entry change notification" control with each entry it sends back to the client during the persistent search.
    void
    setChangesOnly(boolean changesOnly)
    Specifies whether you want the server to send any existing entries that already match the search criteria or only the entries that have changed.
    void
    setChangeTypes(int types)
    Sets the change types that you want monitored by this control.
    void
    setReturnControls(boolean returnControls)
    Specifies whether you want the server to include an "entry change notification" control with each entry it sends back to the client during the persistent search.

    Methods inherited from class netscape.ldap.controls.LDAPPersistSearchControl

    parseResponse, parseResponse, toString

    Methods inherited from class netscape.ldap.LDAPControl

    clone, createControl, flattenBER, getID, getValue, isCritical, lookupControlClass, newInstance, register

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface javax.naming.ldap.Control

    getID, isCritical
  • Field Details

    • ADD

      public static final int ADD
      Change type specifying that you want to track additions of new entries to the directory. You can either specify this change type when constructing an LdapPersistSearchControl or by using the setChangeTypes method.
      See Also:
    • DELETE

      public static final int DELETE
      Change type specifying that you want to track removals of entries from the directory. You can either specify this change type when constructing an LdapPersistSearchControl or by using the setChangeTypes method.
      See Also:
    • MODIFY

      public static final int MODIFY
      Change type specifying that you want to track modifications of entries in the directory. You can either specify this change type when constructing an LdapPersistSearchControl or by using the setChangeTypes method.
      See Also:
    • MODDN

      public static final int MODDN
      Change type specifying that you want to track modifications of the DNs of entries in the directory. You can either specify this change type when constructing an LdapPersistSearchControl or by using the setChangeTypes method.
      See Also:
  • Constructor Details

    • LdapPersistSearchControl

      public LdapPersistSearchControl(int changeTypes, boolean changesOnly, boolean returnControls, boolean isCritical)
      Constructs an LdapPersistSearchControl object that specifies a persistent search.
      Parameters:
      changeTypes - The change types to be monitored. You can perform a bitwise OR on any of the following values and specify the result as the change types:
      • LdapPersistSearchControl.ADD (to track new entries added to the directory)
      • LdapPersistSearchControl.DELETE (to track entries removed from the directory)
      • LdapPersistSearchControl.MODIFY (to track entries that have been modified)
      • LdapPersistSearchControl.MODDN (to track entries that have been renamed)
      changesOnly - true if you do not want the server to return all existing entries in the directory that match the search criteria. (You just want the changed entries to be returned.)
      returnControls - true you want the server to return entry change controls with each entry in the search results.
      isCritical - true if this control is critical to the search operation (for example, if the server does not support this control, you may not want the server to perform the search at all.)
      See Also:
  • Method Details

    • getChangeTypes

      public int getChangeTypes()
      Gets the change types monitored by this control.
      Overrides:
      getChangeTypes in class netscape.ldap.controls.LDAPPersistSearchControl
      Returns:
      Integer representing the change types that you want monitored. This value can be the bitwise OR of ADD, DELETE, MODIFY, and/or MODDN. If the change type is unknown, this method returns -1.
    • getChangesOnly

      public boolean getChangesOnly()
      Indicates whether you want the server to send any existing entries that already match the search criteria or only the entries that have changed.
      Overrides:
      getChangesOnly in class netscape.ldap.controls.LDAPPersistSearchControl
      Returns:
      If true, the server returns only the entries that have changed. If false, the server also returns any existing entries that match the search criteria but have not changed.
    • getReturnControls

      public boolean getReturnControls()
      Indicates whether or not the server includes an "entry change notification" control with each entry it sends back to the client during the persistent search.
      Overrides:
      getReturnControls in class netscape.ldap.controls.LDAPPersistSearchControl
      Returns:
      true if the server includes "entry change notification" controls with the entries it sends during the persistent search.
      See Also:
    • setChangeTypes

      public void setChangeTypes(int types)
      Sets the change types that you want monitored by this control.
      Overrides:
      setChangeTypes in class netscape.ldap.controls.LDAPPersistSearchControl
      Parameters:
      types - Integer representing the change types that you want monitored. This value can be the bitwise OR of ADD, DELETE, MODIFY, and/or MODDN.
      See Also:
    • setChangesOnly

      public void setChangesOnly(boolean changesOnly)
      Specifies whether you want the server to send any existing entries that already match the search criteria or only the entries that have changed.
      Overrides:
      setChangesOnly in class netscape.ldap.controls.LDAPPersistSearchControl
      Parameters:
      changesOnly - If true, the server returns only the entries that have changed. If false, the server also returns any existing entries that match the search criteria but have not changed.
      See Also:
    • setReturnControls

      public void setReturnControls(boolean returnControls)
      Specifies whether you want the server to include an "entry change notification" control with each entry it sends back to the client during the persistent search.
      Overrides:
      setReturnControls in class netscape.ldap.controls.LDAPPersistSearchControl
      Parameters:
      returnControls - If true, the server includes "entry change notification" controls with the entries it sends during the persistent search.
      See Also:
    • getEncodedValue

      public byte[] getEncodedValue()
      Retrieves the ASN.1 BER encoded value of the LDAP control. Null is returned if the value is absent.
      Specified by:
      getEncodedValue in interface Control
      Returns:
      A possibly null byte array representing the ASN.1 BER encoded value of the LDAP control.