Package org.opends.server.controls
Class AccountUsableResponseControl
- java.lang.Object
-
- org.opends.server.types.Control
-
- org.opends.server.controls.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>DECODERThe Control Decoder that can be used to decode this control.static byteTYPE_EXPIREDThe BER type to use for the MORE_INFO element that indicates that the user's password is expired.static byteTYPE_INACTIVEThe BER type to use for the MORE_INFO element that indicates that the account has been inactivated.static byteTYPE_MORE_INFOThe BER type to use for the MORE_INFO sequence when the account is not available.static byteTYPE_REMAINING_GRACE_LOGINSThe BER type to use for the MORE_INFO element that provides the number of remaining grace logins.static byteTYPE_RESETThe BER type to use for the MORE_INFO element that indicates that the password has been administratively reset.static byteTYPE_SECONDS_BEFORE_EXPIRATIONThe BER type to use for the seconds before expiration when the account is available.static byteTYPE_SECONDS_BEFORE_UNLOCKThe 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetRemainingGraceLogins()Retrieves the number of remaining grace logins for the user.intgetSecondsBeforeExpiration()Retrieves the length of time in seconds before the user's password expires.intgetSecondsBeforeUnlock()Retrieves the length of time in seconds before the user's account is automatically unlocked.booleanisExpired()Indicates whether the user's password is expired.booleanisInactive()Indicates whether the user's account has been inactivated by an administrator.booleanisLocked()Indicates whether the user's account is locked for some reason.booleanisReset()Indicates whether the user's password has been administratively reset and the user must change that password before any other operations will be allowed.booleanisUsable()Indicates whether the associated user account is available for use.voidtoString(StringBuilder buffer)Appends a string representation of this control to the provided buffer.voidwriteValue(ASN1Writer writer)Writes this control's value to an ASN.1 writer.-
Methods inherited from class org.opends.server.types.Control
getOID, isCritical, toString, write
-
-
-
-
Field Detail
-
DECODER
public static final ControlDecoder<AccountUsableResponseControl> DECODER
The Control Decoder that can be used to decode this control.
-
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:ControlWrites this control's value to an ASN.1 writer. The value (if any) must be written as an ASN1OctetString.- Specified by:
writeValuein classControl- 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:
trueif the associated user account is available, orfalseif 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:
trueif the user's account has been inactivated by an administrator, orfalseif 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:
trueif the user's password has been administratively reset, orfalseif not.
-
isExpired
public boolean isExpired()
Indicates whether the user's password is expired.- Returns:
trueif the user's password is expired, orfalseif 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:
trueif the user's account is locked, orfalseif 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:ControlAppends a string representation of this control to the provided buffer.
-
-