Package com.iizix.user
Enum LoginResult
- java.lang.Object
- java.lang.Enum<LoginResult>
- com.iizix.user.LoginResult
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<LoginResult>
public enum LoginResult extends java.lang.Enum<LoginResult>
Enum for user login result.Text IDs used by the LoginResult
userauth.success = Success. userauth.success.change_password = Success, change of password needed. userauth.invalid_password = Invalid password. userauth.too_many_invalid_logins_retry_later = Too many invalid logins. Please retry later. userauth.too_many_invalid_logins_retry_later_next_time_disable = Too many invalid logins. Please retry later. Upon next failure, your user will be disabled. userauth.invalid_password_next_attempt_will_disable = Invalid password. Upon next failure, your user will be disabled. userauth.disabled = Your user has been disabled, please contact your app supplier. userauth.invalid_user = Invalid user name. userauth.user_name_taken = User name taken, cannot sign up. userauth.app_id_not_found = Application ID is not found. userauth.app_disabled = The application is disabled. userauth.server_not_started = Server not started. userauth.server_stopping = Server is stopping. userauth.server_login_disabled = Login to server is currently disabled. userauth.system_failure = A system failure occurred when authentication your user.
- Author:
- Christopher Mindus
Enum Constant Summary
Enum Constants Enum Constant Description APP_DISABLED
The application is disabled.APP_ID_NOT_FOUND
Application ID is not found.INVALID_PASSWORD
Invalid password.INVALID_PASSWORD_NEXT_ATTEMPT_WILL_DISABLE
User has too many invalid logins: retry later, but next time, the user will be disabled upon a failure.INVALID_USER
Invalid user name.SERVER_LOGIN_DISABLED
Login to server is currently disabled.SERVER_NOT_STARTED
Server is not started.SERVER_STOPPING
Server is stopping.SUCCESS
Validation succeeded.SUCCESS_CHANGE_PASSWORD
Validation succeeded, but user has to change password.SYSTEM_FAILURE
System failure.TOO_MANY_INVALID_LOGINS_RETRY_LATER
User has too many invalid logins: retry later.TOO_MANY_INVALID_LOGINS_RETRY_LATER_NEXT_TIME_DISABLE
User has too many invalid logins: retry later.USER_DISABLED
User is disabled.USER_NAME_TAKEN
User name taken, cannot sign up.
Field Summary
Fields Modifier and Type Field Description java.lang.String
englishMessage
The English text message.java.lang.String
textID
The text ID for the message, starts with "userauth.".
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isSuccessful()
Returns if the login is successful, even if e.g.boolean
mustChangePassword()
Returns if the user must change password.static LoginResult
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static LoginResult[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
Enum Constant Detail
SUCCESS
public static final LoginResult SUCCESS
Validation succeeded.
SUCCESS_CHANGE_PASSWORD
public static final LoginResult SUCCESS_CHANGE_PASSWORD
Validation succeeded, but user has to change password.
INVALID_PASSWORD
public static final LoginResult INVALID_PASSWORD
Invalid password.
TOO_MANY_INVALID_LOGINS_RETRY_LATER
public static final LoginResult TOO_MANY_INVALID_LOGINS_RETRY_LATER
User has too many invalid logins: retry later.
TOO_MANY_INVALID_LOGINS_RETRY_LATER_NEXT_TIME_DISABLE
public static final LoginResult TOO_MANY_INVALID_LOGINS_RETRY_LATER_NEXT_TIME_DISABLE
User has too many invalid logins: retry later. A failure next time will disable the user.
INVALID_PASSWORD_NEXT_ATTEMPT_WILL_DISABLE
public static final LoginResult INVALID_PASSWORD_NEXT_ATTEMPT_WILL_DISABLE
User has too many invalid logins: retry later, but next time, the user will be disabled upon a failure.
USER_DISABLED
public static final LoginResult USER_DISABLED
User is disabled.
INVALID_USER
public static final LoginResult INVALID_USER
Invalid user name.
USER_NAME_TAKEN
public static final LoginResult USER_NAME_TAKEN
User name taken, cannot sign up.
APP_ID_NOT_FOUND
public static final LoginResult APP_ID_NOT_FOUND
Application ID is not found.
APP_DISABLED
public static final LoginResult APP_DISABLED
The application is disabled.
SERVER_NOT_STARTED
public static final LoginResult SERVER_NOT_STARTED
Server is not started.
SERVER_STOPPING
public static final LoginResult SERVER_STOPPING
Server is stopping.
SERVER_LOGIN_DISABLED
public static final LoginResult SERVER_LOGIN_DISABLED
Login to server is currently disabled.
SYSTEM_FAILURE
public static final LoginResult SYSTEM_FAILURE
System failure.
Method Detail
values
public static LoginResult[] 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 (LoginResult c : LoginResult.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
valueOf
public static LoginResult valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
isSuccessful
public boolean isSuccessful()
Returns if the login is successful, even if e.g. password must be changed.- Returns:
- true for SUCCESS and SUCCESS_CHANGE_PASSWORD, false otherwise.
mustChangePassword
public boolean mustChangePassword()
Returns if the user must change password.- Returns:
- true if user must change password to continue, i.e. SUCCESS_CHANGE_PASSWORD, false otherwise.