@ExperimentalApi public static final enum

UserManager.UserState

extends Enum<E extends Enum<E>>
java.lang.Object
   ↳ java.lang.Enum<E extends java.lang.Enum<E>>
     ↳ com.atlassian.jira.user.util.UserManager.UserState

@ExperimentalApi

This enum is considered usable by external developers but its contracts have not stabilized.

Experimental APIs may be changed at any time before being marked @Internal or @PublicApi.

Class Overview

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.

Summary

Enum Values
UserManager.UserState  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. 
UserManager.UserState  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. 
UserManager.UserState  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). 
UserManager.UserState  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. 
Public Methods
boolean isEffective()
Returns whether or not the user is the same user that would be returned by a call to getUserByName(String).
boolean isInMultipleDirectories()
Returns true if the user is in multiple active user directories, regardless of whether or not the specified directory ID was the active one.
boolean isValid()
Convenience method that only returns true for all of the valid user types.
static UserManager.UserState valueOf(String name)
final static UserState[] values()
[Expand]
Inherited Methods
From class java.lang.Enum
From class java.lang.Object
From interface java.lang.Comparable

Enum Values

public static final UserManager.UserState 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.

public static final UserManager.UserState 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.

public static final UserManager.UserState 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).

public static final UserManager.UserState 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.

Public Methods

public boolean isEffective ()

Returns whether or not the user is the same user that would be returned by a call to getUserByName(String). This is, it was the first matching user found.

public boolean isInMultipleDirectories ()

Returns true if the user is in multiple active user directories, regardless of whether or not the specified directory ID was the active one.

Returns
  • true if the user is in multiple active user directories; false if the user is only in one or does not exist at all

public boolean isValid ()

Convenience method that only returns true for all of the valid user types.

Returns
  • true if the specified username and directory ID was valid; false if the user does not actually exist

public static UserManager.UserState valueOf (String name)

public static final UserState[] values ()