Class PasswordPolicyControl

  • All Implemented Interfaces:
    Control, RequestControl, ResponseControl

    public class PasswordPolicyControl
    extends AbstractControl
    implements RequestControl, ResponseControl
    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 Detail

      • HASH_CODE_SEED

        private static final int HASH_CODE_SEED
        hash code seed.
        See Also:
        Constant Field Values
      • timeBeforeExpiration

        private int timeBeforeExpiration
        Ppolicy warning.
      • graceAuthNsRemaining

        private int graceAuthNsRemaining
        Ppolicy warning.
    • Constructor Detail

      • PasswordPolicyControl

        public PasswordPolicyControl()
        Default constructor.
      • PasswordPolicyControl

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

      • 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
      • getTimeBeforeExpiration

        public int getTimeBeforeExpiration()
        Returns the time before expiration in seconds.
        Returns:
        time before expiration
      • setTimeBeforeExpiration

        public void setTimeBeforeExpiration​(int time)
        Sets the time before expiration in seconds.
        Parameters:
        time - before expiration
      • getGraceAuthNsRemaining

        public int getGraceAuthNsRemaining()
        Returns the number of grace authentications remaining.
        Returns:
        number of grace authentications remaining
      • setGraceAuthNsRemaining

        public void setGraceAuthNsRemaining​(int count)
        Sets the number of grace authentications remaining.
        Parameters:
        count - number of grace authentications remaining
      • setError

        public void setError​(PasswordPolicyControl.Error e)
        Sets the password policy error.
        Parameters:
        e - password policy error
      • 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
      • 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