Class AccountUsableResponseControl


  • public class AccountUsableResponseControl
    extends Control
    This class implements the account usable response control. This is a Sun-defined control with OID 1.3.6.1.4.1.42.2.27.9.5.8. The value of this control is composed according to the following BNF:
     ACCOUNT_USABLE_RESPONSE ::= CHOICE {
          is_available           [0] INTEGER, -- Seconds before expiration --
          is_not_available       [1] MORE_INFO }
    
     MORE_INFO ::= SEQUENCE {
          inactive               [0] BOOLEAN DEFAULT FALSE,
          reset                  [1] BOOLEAN DEFAULT FALSE,
          expired                [2] BOOLEAN DEFAULT_FALSE,
          remaining_grace        [3] INTEGER OPTIONAL,
          seconds_before_unlock  [4] INTEGER OPTIONAL }
     
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static ControlDecoder<AccountUsableResponseControl> DECODER
      The Control Decoder that can be used to decode this control.
      static byte TYPE_EXPIRED
      The BER type to use for the MORE_INFO element that indicates that the user's password is expired.
      static byte TYPE_INACTIVE
      The BER type to use for the MORE_INFO element that indicates that the account has been inactivated.
      static byte TYPE_MORE_INFO
      The BER type to use for the MORE_INFO sequence when the account is not available.
      static byte TYPE_REMAINING_GRACE_LOGINS
      The BER type to use for the MORE_INFO element that provides the number of remaining grace logins.
      static byte TYPE_RESET
      The BER type to use for the MORE_INFO element that indicates that the password has been administratively reset.
      static byte TYPE_SECONDS_BEFORE_EXPIRATION
      The BER type to use for the seconds before expiration when the account is available.
      static byte TYPE_SECONDS_BEFORE_UNLOCK
      The BER type to use for the MORE_INFO element that indicates that the password has been administratively reset.
    • Constructor Summary

      Constructors 
      Constructor Description
      AccountUsableResponseControl​(boolean isCritical, boolean isInactive, boolean isReset, boolean isExpired, int remainingGraceLogins, boolean isLocked, int secondsBeforeUnlock)
      Creates a new account usability response control that may be used to indicate that the account is not available and provide information about the underlying reason.
      AccountUsableResponseControl​(boolean isInactive, boolean isReset, boolean isExpired, int remainingGraceLogins, boolean isLocked, int secondsBeforeUnlock)
      Creates a new account usability response control that may be used to indicate that the account is not available and provide information about the underlying reason.
      AccountUsableResponseControl​(boolean isCritical, int secondsBeforeExpiration)
      Creates a new account usability response control that may be used to indicate that the account is available and provide the number of seconds until expiration.
      AccountUsableResponseControl​(int secondsBeforeExpiration)
      Creates a new account usability response control that may be used to indicate that the account is available and provide the number of seconds until expiration.
    • Field Detail

      • TYPE_SECONDS_BEFORE_EXPIRATION

        public static final byte TYPE_SECONDS_BEFORE_EXPIRATION
        The BER type to use for the seconds before expiration when the account is available.
        See Also:
        Constant Field Values
      • TYPE_MORE_INFO

        public static final byte TYPE_MORE_INFO
        The BER type to use for the MORE_INFO sequence when the account is not available.
        See Also:
        Constant Field Values
      • TYPE_INACTIVE

        public static final byte TYPE_INACTIVE
        The BER type to use for the MORE_INFO element that indicates that the account has been inactivated.
        See Also:
        Constant Field Values
      • TYPE_RESET

        public static final byte TYPE_RESET
        The BER type to use for the MORE_INFO element that indicates that the password has been administratively reset.
        See Also:
        Constant Field Values
      • TYPE_EXPIRED

        public static final byte TYPE_EXPIRED
        The BER type to use for the MORE_INFO element that indicates that the user's password is expired.
        See Also:
        Constant Field Values
      • TYPE_REMAINING_GRACE_LOGINS

        public static final byte TYPE_REMAINING_GRACE_LOGINS
        The BER type to use for the MORE_INFO element that provides the number of remaining grace logins.
        See Also:
        Constant Field Values
      • TYPE_SECONDS_BEFORE_UNLOCK

        public static final byte TYPE_SECONDS_BEFORE_UNLOCK
        The BER type to use for the MORE_INFO element that indicates that the password has been administratively reset.
        See Also:
        Constant Field Values
    • Constructor Detail

      • AccountUsableResponseControl

        public AccountUsableResponseControl​(int secondsBeforeExpiration)
        Creates a new account usability response control that may be used to indicate that the account is available and provide the number of seconds until expiration. It will use the default OID and criticality.
        Parameters:
        secondsBeforeExpiration - The length of time in seconds until the user's password expires, or -1 if the user's password will not expire or the expiration time is unknown.
      • AccountUsableResponseControl

        public AccountUsableResponseControl​(boolean isCritical,
                                            int secondsBeforeExpiration)
        Creates a new account usability response control that may be used to indicate that the account is available and provide the number of seconds until expiration. It will use the default OID and criticality.
        Parameters:
        isCritical - Indicates whether this control should be considered critical in processing the request.
        secondsBeforeExpiration - The length of time in seconds until the user's password expires, or -1 if the user's password will not expire or the expiration time is unknown.
      • AccountUsableResponseControl

        public AccountUsableResponseControl​(boolean isCritical,
                                            boolean isInactive,
                                            boolean isReset,
                                            boolean isExpired,
                                            int remainingGraceLogins,
                                            boolean isLocked,
                                            int secondsBeforeUnlock)
        Creates a new account usability response control that may be used to indicate that the account is not available and provide information about the underlying reason. It will use the default OID and criticality.
        Parameters:
        isCritical - Indicates whether this control should be considered critical in processing the request.
        isInactive - Indicates whether the user's account has been inactivated by an administrator.
        isReset - Indicates whether the user's password has been reset by an administrator.
        isExpired - Indicates whether the user's password is expired.
        remainingGraceLogins - The number of grace logins remaining. A value of zero indicates that there are none remaining. A value of -1 indicates that grace login functionality is not enabled.
        isLocked - Indicates whether the user's account is currently locked out.
        secondsBeforeUnlock - The length of time in seconds until the account is unlocked. A value of -1 indicates that the account will not be automatically unlocked and must be reset by an administrator.
      • AccountUsableResponseControl

        public AccountUsableResponseControl​(boolean isInactive,
                                            boolean isReset,
                                            boolean isExpired,
                                            int remainingGraceLogins,
                                            boolean isLocked,
                                            int secondsBeforeUnlock)
        Creates a new account usability response control that may be used to indicate that the account is not available and provide information about the underlying reason. It will use the default OID and criticality.
        Parameters:
        isInactive - Indicates whether the user's account has been inactivated by an administrator.
        isReset - Indicates whether the user's password has been reset by an administrator.
        isExpired - Indicates whether the user's password is expired.
        remainingGraceLogins - The number of grace logins remaining. A value of zero indicates that there are none remaining. A value of -1 indicates that grace login functionality is not enabled.
        isLocked - Indicates whether the user's account is currently locked out.
        secondsBeforeUnlock - The length of time in seconds until the account is unlocked. A value of -1 indicates that the account will not be automatically unlocked and must be reset by an administrator.
    • Method Detail

      • writeValue

        public void writeValue​(ASN1Writer writer)
                        throws IOException
        Description copied from class: Control
        Writes this control's value to an ASN.1 writer. The value (if any) must be written as an ASN1OctetString.
        Specified by:
        writeValue in class Control
        Parameters:
        writer - The ASN.1 writer to use.
        Throws:
        IOException - If a problem occurs while writing to the stream.
      • isUsable

        public boolean isUsable()
        Indicates whether the associated user account is available for use.
        Returns:
        true if the associated user account is available, or false if not.
      • getSecondsBeforeExpiration

        public int getSecondsBeforeExpiration()
        Retrieves the length of time in seconds before the user's password expires. This value is unreliable if the account is not available.
        Returns:
        The length of time in seconds before the user's password expires, or -1 if it is unknown or password expiration is not enabled for the user.
      • isInactive

        public boolean isInactive()
        Indicates whether the user's account has been inactivated by an administrator.
        Returns:
        true if the user's account has been inactivated by an administrator, or false if not.
      • isReset

        public boolean isReset()
        Indicates whether the user's password has been administratively reset and the user must change that password before any other operations will be allowed.
        Returns:
        true if the user's password has been administratively reset, or false if not.
      • isExpired

        public boolean isExpired()
        Indicates whether the user's password is expired.
        Returns:
        true if the user's password is expired, or false if not.
      • getRemainingGraceLogins

        public int getRemainingGraceLogins()
        Retrieves the number of remaining grace logins for the user. This value is unreliable if the user's password is not expired.
        Returns:
        The number of remaining grace logins for the user, or -1 if the grace logins feature is not enabled for the user.
      • isLocked

        public boolean isLocked()
        Indicates whether the user's account is locked for some reason.
        Returns:
        true if the user's account is locked, or false if it is not.
      • getSecondsBeforeUnlock

        public int getSecondsBeforeUnlock()
        Retrieves the length of time in seconds before the user's account is automatically unlocked. This value is unreliable is the user's account is not locked.
        Returns:
        The length of time in seconds before the user's account is automatically unlocked, or -1 if it requires administrative action to unlock the account.
      • toString

        public void toString​(StringBuilder buffer)
        Description copied from class: Control
        Appends a string representation of this control to the provided buffer.
        Overrides:
        toString in class Control
        Parameters:
        buffer - The buffer to which the information should be appended.