Enum PasswordAction
- java.lang.Object
-
- java.lang.Enum<PasswordAction>
-
- org.cyclos.model.access.passwords.PasswordAction
-
- All Implemented Interfaces:
Serializable,Comparable<PasswordAction>,HasMessageKey
public enum PasswordAction extends Enum<PasswordAction> implements HasMessageKey
Contains the possible actions over a user's password with the allowed status and modes.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ACTIVATEActivate a generated password by the owner userALLOW_ACTIVATIONFor password types which require admin authorization to generate, allow users to generate themCHANGEManually change a manual password, or generate a new generated passwordDISABLEDisables a password, making it unusable until being enabled againENABLEEnables a disabled password (could be either manually disabled or by exceeding the wrong tries, depending on the type configuration)RESETResets a generated password, making it go back to the pending stateRESET_AND_SENDResets a manual password to a generated value and send it to the user.UNBLOCKUnblocks a blocked password
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowed(PasswordStatus status)booleanallowed(PasswordMode mode)booleanallowed(PasswordMode mode, PasswordStatus status)Returns true if this action is allowed for both (status and mode)voidcheckAllowed(PasswordStatus status)voidcheckAllowed(PasswordMode mode)MessageKeygetMessageKey()static PasswordActionvalueOf(String name)Returns the enum constant of this type with the specified name.static PasswordAction[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ACTIVATE
public static final PasswordAction ACTIVATE
Activate a generated password by the owner user
-
ALLOW_ACTIVATION
public static final PasswordAction ALLOW_ACTIVATION
For password types which require admin authorization to generate, allow users to generate them
-
CHANGE
public static final PasswordAction CHANGE
Manually change a manual password, or generate a new generated password
-
DISABLE
public static final PasswordAction DISABLE
Disables a password, making it unusable until being enabled again
-
ENABLE
public static final PasswordAction ENABLE
Enables a disabled password (could be either manually disabled or by exceeding the wrong tries, depending on the type configuration)
-
RESET
public static final PasswordAction RESET
Resets a generated password, making it go back to the pending state
-
RESET_AND_SEND
public static final PasswordAction RESET_AND_SEND
Resets a manual password to a generated value and send it to the user. Can also be used to reset and send the access password of the main channel (login password) if it is generated. The new password is initially reset, so the user needs to change it on first login (in case of login password).
-
UNBLOCK
public static final PasswordAction UNBLOCK
Unblocks a blocked password
-
-
Method Detail
-
values
public static PasswordAction[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (PasswordAction c : PasswordAction.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static PasswordAction valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
allowed
public boolean allowed(PasswordMode mode)
-
allowed
public boolean allowed(PasswordMode mode, PasswordStatus status)
Returns true if this action is allowed for both (status and mode)
-
allowed
public boolean allowed(PasswordStatus status)
-
checkAllowed
public void checkAllowed(PasswordMode mode)
-
checkAllowed
public void checkAllowed(PasswordStatus status)
-
getMessageKey
public MessageKey getMessageKey()
- Specified by:
getMessageKeyin interfaceHasMessageKey
-
-