Class PasswordPolicyControl

All Implemented Interfaces:
Control, RequestControl, ResponseControl, Freezable

public class PasswordPolicyControl extends AbstractResponseControl implements RequestControl
Request/response control for password policy. See http://tools.ietf.org/html/draft-behera-ldap-password-policy-11. Control is defined as:
   PasswordPolicyResponseValue ::= SEQUENCE {
      warning [0] CHOICE {
      timeBeforeExpiration [0] INTEGER (0 .. maxInt),
      graceAuthNsRemaining [1] INTEGER (0 .. maxInt) } OPTIONAL,
      error   [1] ENUMERATED {
      passwordExpired             (0),
      accountLocked               (1),
      changeAfterReset            (2),
      passwordModNotAllowed       (3),
      mustSupplyOldPassword       (4),
      insufficientPasswordQuality (5),
      passwordTooShort            (6),
      passwordTooYoung            (7),
      passwordInHistory           (8),
      passwordTooLong             (9) } OPTIONAL }
 
  • Field Details

  • Constructor Details

    • PasswordPolicyControl

      public PasswordPolicyControl()
      Default constructor.
    • PasswordPolicyControl

      public PasswordPolicyControl(boolean critical)
      Creates a new password policy control.
      Parameters:
      critical - whether this control is critical
    • PasswordPolicyControl

      public PasswordPolicyControl(PasswordPolicyControl.WarningType type, int value)
      Creates a new password policy control.
      Parameters:
      type - warning type
      value - warning value
    • PasswordPolicyControl

      public PasswordPolicyControl(PasswordPolicyControl.Error err)
      Creates a new password policy control.
      Parameters:
      err - ppolicy error
    • PasswordPolicyControl

      public PasswordPolicyControl(PasswordPolicyControl.WarningType type, int value, PasswordPolicyControl.Error err)
      Creates a new password policy control.
      Parameters:
      type - warning type
      value - warning value
      err - ppolicy error
    • PasswordPolicyControl

      public PasswordPolicyControl(PasswordPolicyControl.WarningType type, int value, boolean critical)
      Creates a new password policy control.
      Parameters:
      type - warning type
      value - warning value
      critical - whether this control is critical
    • PasswordPolicyControl

      public PasswordPolicyControl(PasswordPolicyControl.Error err, boolean critical)
      Creates a new password policy control.
      Parameters:
      err - ppolicy error
      critical - whether this control is critical
    • PasswordPolicyControl

      public PasswordPolicyControl(PasswordPolicyControl.WarningType type, int value, PasswordPolicyControl.Error err, boolean critical)
      Creates a new password policy control.
      Parameters:
      type - warning type
      value - warning value
      err - ppolicy error
      critical - whether this control is critical
  • Method Details

    • hasValue

      public boolean hasValue()
      Description copied from interface: RequestControl
      Returns whether the control has a value associated with it.
      Specified by:
      hasValue in interface RequestControl
      Returns:
      whether the control has a value
    • getWarning

      public PasswordPolicyControl.Warning getWarning()
      Returns the warning.
      Returns:
      warning
    • hasWarning

      public boolean hasWarning(PasswordPolicyControl.WarningType type)
      Returns whether this control has a warning of the supplied type.
      Parameters:
      type - of warning to inspect this control for
      Returns:
      whether this control has a warning of the supplied type
    • getError

      public PasswordPolicyControl.Error getError()
      Returns the password policy error.
      Returns:
      password policy error
    • hasError

      public boolean hasError()
      Returns whether this control has an error set.
      Returns:
      whether this control has an error set
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class AbstractControl
    • hashCode

      public int hashCode()
      Description copied from class: AbstractControl
      Returns the hash code for this object.
      Specified by:
      hashCode in class AbstractControl
      Returns:
      hash code
    • toString

      public String toString()
      Overrides:
      toString in class AbstractControl
    • encode

      public byte[] encode()
      Description copied from interface: RequestControl
      Provides the BER encoding of this control.
      Specified by:
      encode in interface RequestControl
      Returns:
      BER encoded request control
    • decode

      public void decode(DERBuffer encoded)
      Description copied from interface: ResponseControl
      Initializes this response control with the supplied BER encoded data.
      Specified by:
      decode in interface ResponseControl
      Parameters:
      encoded - BER encoded response control