Package com.atlassian.jira.user.util
Enum Class UserManager.UserState
- All Implemented Interfaces:
Serializable,Comparable<UserManager.UserState>,Constable
- Enclosing interface:
- UserManager
The current state of a user with regard to the same username existing in other
user directories. Only the first occurrence of a username in list of user
directories is effective. If the same username is found in other directories,
then those entries are said to be "shadowed". This value represents the results
of searching for the username across all of the directories to determine whether
or not shadowing is relevant for the given user.
Using the various test methods like isInMultipleDirectories() and
isValid() should be preferred over testing for exact matches.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionIndicates that the specified user was not valid, meaning that the directory ID is invalid, that directory is disabled, or the directory does not have a user with the specified username.Indicates that there is only a single active user with that username across all active user directories and shadowing is not relevant for the user.Indicates that the specified username was first found in the specified directory is active and that there is at least one user with the same username defined in another directory that is ordered after it, so this user has a shadow (it is the effective version of the user, and is hiding others).Indicates that an active user with the same name was found in a directory that currently takes priority over directory and username that were specified, meaning that the specified user is shadowed by another. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether or not the user is the same user that would be returned by a call toUserManager.getUserByName(String).booleanReturnstrueif the user is in multiple active user directories, regardless of whether or not the specified directory ID was the active one.booleanisValid()Convenience method that only returnstruefor all of the valid user types.static UserManager.UserStateReturns the enum constant of this class with the specified name.static UserManager.UserState[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INVALID_USER
Indicates that the specified user was not valid, meaning that the directory ID is invalid, that directory is disabled, or the directory does not have a user with the specified username. -
SHADOW_USER
Indicates that an active user with the same name was found in a directory that currently takes priority over directory and username that were specified, meaning that the specified user is shadowed by another. -
NORMAL_USER
Indicates that there is only a single active user with that username across all active user directories and shadowing is not relevant for the user. -
NORMAL_USER_WITH_SHADOW
Indicates that the specified username was first found in the specified directory is active and that there is at least one user with the same username defined in another directory that is ordered after it, so this user has a shadow (it is the effective version of the user, and is hiding others).
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException- if the argument is null
-
isEffective
public boolean isEffective()Returns whether or not the user is the same user that would be returned by a call toUserManager.getUserByName(String). This is, it was the first matching user found. -
isValid
public boolean isValid()Convenience method that only returnstruefor all of the valid user types.- Returns:
trueif the specified username and directory ID was valid;falseif the user does not actually exist
-
isInMultipleDirectories
public boolean isInMultipleDirectories()Returnstrueif the user is in multiple active user directories, regardless of whether or not the specified directory ID was the active one.- Returns:
trueif the user is in multiple active user directories;falseif the user is only in one or does not exist at all
-