org.opends.server.controls
Class PasswordPolicyResponseControl

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

public class PasswordPolicyResponseControl
extends Control

This class implements the password policy response control defined in draft-behera-ldap-password-policy. The value may have zero, one, or two elements, which may include flags to indicate a warning and/or an error.


Field Summary
static byte TYPE_ERROR_ELEMENT
          The BER type value for the error element of the control value.
static byte TYPE_WARNING_ELEMENT
          The BER type value for the warning element of the control value.
 
Constructor Summary
PasswordPolicyResponseControl()
          Creates a new instance of the password policy response control with the default OID and criticality, and without either a warning or an error flag.
PasswordPolicyResponseControl(PasswordPolicyWarningType warningType, int warningValue, PasswordPolicyErrorType errorType)
          Creates a new instance of this password policy response control with the default OID and criticality, and with the provided warning and/or error flag information.
PasswordPolicyResponseControl(java.lang.String oid, boolean isCritical, PasswordPolicyWarningType warningType, int warningValue, PasswordPolicyErrorType errorType)
          Creates a new instance of the password policy request control with the provided information.
 
Method Summary
static PasswordPolicyResponseControl decodeControl(Control control)
          Creates a new password policy response control from the contents of the provided control.
 PasswordPolicyErrorType getErrorType()
          Retrieves the password policy error type contained in this control.
 PasswordPolicyWarningType getWarningType()
          Retrieves the password policy warning type contained in this control.
 int getWarningValue()
          Retrieves the password policy warning value for this control.
 java.lang.String toString()
          Retrieves a string representation of this password policy response control.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this password policy response 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
 

Field Detail

TYPE_WARNING_ELEMENT

public static final byte TYPE_WARNING_ELEMENT
The BER type value for the warning element of the control value.

See Also:
Constant Field Values

TYPE_ERROR_ELEMENT

public static final byte TYPE_ERROR_ELEMENT
The BER type value for the error element of the control value.

See Also:
Constant Field Values
Constructor Detail

PasswordPolicyResponseControl

public PasswordPolicyResponseControl()
Creates a new instance of the password policy response control with the default OID and criticality, and without either a warning or an error flag.


PasswordPolicyResponseControl

public PasswordPolicyResponseControl(PasswordPolicyWarningType warningType,
                                     int warningValue,
                                     PasswordPolicyErrorType errorType)
Creates a new instance of this password policy response control with the default OID and criticality, and with the provided warning and/or error flag information.

Parameters:
warningType - The warning type to use for this password policy response control, or null if there should not be a warning flag.
warningValue - The warning value to use for this password policy response control, if applicable.
errorType - The error type to use for this password policy response control, or null if there should not be an error flag.

PasswordPolicyResponseControl

public PasswordPolicyResponseControl(java.lang.String oid,
                                     boolean isCritical,
                                     PasswordPolicyWarningType warningType,
                                     int warningValue,
                                     PasswordPolicyErrorType errorType)
Creates a new instance of the password policy 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 client processing.
warningType - The warning type to use for this password policy response control, or null if there should not be a warning flag.
warningValue - The warning value to use for this password policy response control, if applicable.
errorType - The error type to use for this password policy response control, or null if there should not be an error flag.
Method Detail

decodeControl

public static PasswordPolicyResponseControl decodeControl(Control control)
                                                   throws LDAPException
Creates a new password policy response control from the contents of the provided control.

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

getWarningType

public PasswordPolicyWarningType getWarningType()
Retrieves the password policy warning type contained in this control.

Returns:
The password policy warning type contained in this control, or null if there is no warning type.

getWarningValue

public int getWarningValue()
Retrieves the password policy warning value for this control. The value is undefined if there is no warning type.

Returns:
The password policy warning value for this control.

getErrorType

public PasswordPolicyErrorType getErrorType()
Retrieves the password policy error type contained in this control.

Returns:
The password policy error type contained in this control, or null if there is no error type.

toString

public java.lang.String toString()
Retrieves a string representation of this password policy response control.

Overrides:
toString in class Control
Returns:
A string representation of this password policy response control.

toString

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

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