org.opends.server.controls
Class LDAPPreReadRequestControl

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

public class LDAPPreReadRequestControl
extends Control

This class implements the pre-read request control as defined in RFC 4527. This control makes it possible to retrieve an entry in the state that it held immediately before a modify, delete, or modify DN operation. It may specify a specific set of attributes that should be included in that entry. The entry will be encoded in a corresponding response control.


Constructor Summary
LDAPPreReadRequestControl(boolean isCritical, java.util.LinkedHashSet<java.lang.String> rawAttributes)
          Creates a new instance of this LDAP pre-read request control with the provided information.
LDAPPreReadRequestControl(java.lang.String oid, boolean isCritical, java.util.LinkedHashSet<java.lang.String> rawAttributes)
          Creates a new instance of this LDAP pre-read request control with the provided information.
 
Method Summary
 boolean allowsAttribute(AttributeType attrType)
          Indicates whether the specified attribute type should be included in the entry for the corresponding response control.
static LDAPPreReadRequestControl decodeControl(Control control)
          Creates a new LDAP pre-read request control from the contents of the provided control.
 java.util.LinkedHashSet<java.lang.String> getRawAttributes()
          Retrieves the raw, unprocessed set of requested attributes.
 java.util.LinkedHashSet<AttributeType> getRequestedAttributes()
          Retrieves the set of processed attributes that have been requested for inclusion in the entry that is returned.
 boolean returnAllOperationalAttributes()
          Indicates whether the entry returned should include all operational attributes that the requester has permission to see.
 boolean returnAllUserAttributes()
          Indicates whether the entry returned should include all user attributes that the requester has permission to see.
 void setRawAttributes(java.util.LinkedHashSet<java.lang.String> rawAttributes)
          Specifies the raw, unprocessed set of requested attributes.
 java.lang.String toString()
          Retrieves a string representation of this LDAP pre-read request control.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this LDAP pre-read request 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

LDAPPreReadRequestControl

public LDAPPreReadRequestControl(boolean isCritical,
                                 java.util.LinkedHashSet<java.lang.String> rawAttributes)
Creates a new instance of this LDAP pre-read request control with the provided information.

Parameters:
isCritical - Indicates whether support for this control should be considered a critical part of the server processing.
rawAttributes - The set of raw attributes to return in the entry. A null or empty set will indicates that all user attributes should be returned.

LDAPPreReadRequestControl

public LDAPPreReadRequestControl(java.lang.String oid,
                                 boolean isCritical,
                                 java.util.LinkedHashSet<java.lang.String> rawAttributes)
Creates a new instance of this LDAP pre-read request control with the provided information.

Parameters:
oid - The OID to use for this control.
isCritical - Indicates whether support for this control should be considered a critical part of the server processing.
rawAttributes - The set of raw attributes to return in the entry. A null or empty set will indicates that all user attributes should be returned.
Method Detail

decodeControl

public static LDAPPreReadRequestControl decodeControl(Control control)
                                               throws LDAPException
Creates a new LDAP pre-read request control from the contents of the provided control.

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

getRawAttributes

public java.util.LinkedHashSet<java.lang.String> getRawAttributes()
Retrieves the raw, unprocessed set of requested attributes. It must not be altered by the caller without calling setRawAttributes with the updated set.

Returns:
The raw, unprocessed set of attributes.

setRawAttributes

public void setRawAttributes(java.util.LinkedHashSet<java.lang.String> rawAttributes)
Specifies the raw, unprocessed set of requested attributes. A null or empty set indicates that all user attributes should be returned.

Parameters:
rawAttributes - The raw, unprocessed set of requested attributes.

getRequestedAttributes

public java.util.LinkedHashSet<AttributeType> getRequestedAttributes()
Retrieves the set of processed attributes that have been requested for inclusion in the entry that is returned.

Returns:
The set of processed attributes that have been requested for inclusion in the entry that is returned.

returnAllUserAttributes

public boolean returnAllUserAttributes()
Indicates whether the entry returned should include all user attributes that the requester has permission to see.

Returns:
true if the entry returned should include all user attributes that the requester has permission to see, or false if it should only include user attributes that have been explicitly included in the requested attribute list.

returnAllOperationalAttributes

public boolean returnAllOperationalAttributes()
Indicates whether the entry returned should include all operational attributes that the requester has permission to see.

Returns:
true if the entry returned should include all operational attributes that the requester has permission to see, or false if it should only include user attributes that have been explicitly included in the requested attribute list.

allowsAttribute

public boolean allowsAttribute(AttributeType attrType)
Indicates whether the specified attribute type should be included in the entry for the corresponding response control.

Parameters:
attrType - The attribute type for which to make the determination.
Returns:
true if the specified attribute type should be included in the entry for the corresponding response control, or false if not.

toString

public java.lang.String toString()
Retrieves a string representation of this LDAP pre-read request control.

Overrides:
toString in class Control
Returns:
A string representation of this LDAP pre-read request control.

toString

public void toString(java.lang.StringBuilder buffer)
Appends a string representation of this LDAP pre-read request control to the provided buffer.

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