org.opends.server.controls
Class PersistentSearchControl

java.lang.Object
  extended by org.opends.server.types.Control
      extended by org.opends.server.controls.PersistentSearchControl

public class PersistentSearchControl
extends Control

This class implements the persistent search control defined in draft-ietf-ldapext-psearch. It makes it possible for clients to be notified of changes to information in the Directory Server as they occur.


Constructor Summary
PersistentSearchControl(java.util.Set<PersistentSearchChangeType> changeTypes, boolean changesOnly, boolean returnECs)
          Creates a new persistent search control with the provided information.
PersistentSearchControl(java.lang.String oid, boolean isCritical, java.util.Set<PersistentSearchChangeType> changeTypes, boolean changesOnly, boolean returnECs)
          Creates a new persistent search control with the provided information.
 
Method Summary
static PersistentSearchControl decodeControl(Control control)
          Creates a new persistent search control from the contents of the provided control.
 boolean getChangesOnly()
          Indicates whether to only return changes that match the associated search criteria, or to also return all existing entries that match the filter.
 java.util.Set<PersistentSearchChangeType> getChangeTypes()
          Retrieves the set of change types for this persistent search control.
 boolean getReturnECs()
          Indicates whether to include the entry change notification control in entries returned to the client as the result of a change in the Directory Server data.
 void setChangesOnly(boolean changesOnly)
          Specifies whether to only return changes that match teh associated search criteria, or to also return all existing entries that match the filter.
 void setChangeTypes(java.util.Set<PersistentSearchChangeType> changeTypes)
          Specifies the set of change types for this persistent search control.
 void setReturnECs(boolean returnECs)
          Specifies whether to include the entry change notification control in entries returned to the client as a result of a change in the Directory Server data.
 java.lang.String toString()
          Retrieves a string representation of this persistent search control.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this persistent search control to the provided buffer.
 
Methods inherited from class org.opends.server.types.Control
getOID, getValue, hasValue, isCritical, setCritical, setOID, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PersistentSearchControl

public PersistentSearchControl(java.util.Set<PersistentSearchChangeType> changeTypes,
                               boolean changesOnly,
                               boolean returnECs)
Creates a new persistent search control with the provided information.

Parameters:
changeTypes - The set of change types for which to provide notification to the client.
changesOnly - Indicates whether to only return changes that match the associated search criteria, or to also return all existing entries that match the filter.
returnECs - Indicates whether to include the entry change notification control in updated entries that match the associated search criteria.

PersistentSearchControl

public PersistentSearchControl(java.lang.String oid,
                               boolean isCritical,
                               java.util.Set<PersistentSearchChangeType> changeTypes,
                               boolean changesOnly,
                               boolean returnECs)
Creates a new persistent search control with the provided information.

Parameters:
oid - The OID to use for the control.
isCritical - Indicates whether the control should be considered critical for the operation processing.
changeTypes - The set of change types for which to provide notification to the client.
changesOnly - Indicates whether to only return changes that match the associated search criteria, or to also return all existing entries that match the filter.
returnECs - Indicates whether to include the entry change notification control in updated entries that match the associated search criteria.
Method Detail

decodeControl

public static PersistentSearchControl decodeControl(Control control)
                                             throws LDAPException
Creates a new persistent search control from the contents of the provided control.

Parameters:
control - The generic control containing the information to use to create this persistent search control.
Returns:
The persistent search control decoded from the provided control.
Throws:
LDAPException - If this control cannot be decoded as a valid persistent search control.

getChangeTypes

public java.util.Set<PersistentSearchChangeType> getChangeTypes()
Retrieves the set of change types for this persistent search control.

Returns:
The set of change types for this persistent search control.

setChangeTypes

public void setChangeTypes(java.util.Set<PersistentSearchChangeType> changeTypes)
Specifies the set of change types for this persistent search control.

Parameters:
changeTypes - The set of change types for this persistent search control.

getChangesOnly

public boolean getChangesOnly()
Indicates whether to only return changes that match the associated search criteria, or to also return all existing entries that match the filter.

Returns:
true if only changes to matching entries should be returned, or false if existing matches should also be included.

setChangesOnly

public void setChangesOnly(boolean changesOnly)
Specifies whether to only return changes that match teh associated search criteria, or to also return all existing entries that match the filter.

Parameters:
changesOnly - Indicates whether to only return changes that match the associated search criteria, or to also return all existing entries that match the filter.

getReturnECs

public boolean getReturnECs()
Indicates whether to include the entry change notification control in entries returned to the client as the result of a change in the Directory Server data.

Returns:
true if entry change notification controls should be included in applicable entries, or false if not.

setReturnECs

public void setReturnECs(boolean returnECs)
Specifies whether to include the entry change notification control in entries returned to the client as a result of a change in the Directory Server data.

Parameters:
returnECs - Indicates whether to include the entry change notification control in updated entries that match the associated search criteria.

toString

public java.lang.String toString()
Retrieves a string representation of this persistent search control.

Overrides:
toString in class Control
Returns:
A string representation of this persistent search control.

toString

public void toString(java.lang.StringBuilder buffer)
Appends a string representation of this persistent search control to the provided buffer.

Overrides:
toString in class Control
Parameters:
buffer - The buffer to which the information should be appended.