public class UserUtils extends Object
Normally you should use dependency injection to get hold of a UserManager or a UserUtil instance.
| Constructor and Description |
|---|
UserUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Collection<ApplicationUser> |
getAllUsers()
Deprecated.
Since v7.0. Only retrieve the users you really need. See
UserSearchService |
static ApplicationUser |
getUser(String username)
Retrieves and returns the user by given username.
|
static ApplicationUser |
getUserByEmail(String emailAddress)
Return the first user found that matches the given email address (or null if not found).
|
static ApplicationUser |
getUserEvenWhenUnknown(String username)
Returns a
User based on user name. |
static UserManager |
getUserManager() |
static List<ApplicationUser> |
getUsersByEmail(String email)
Finds the users by the given e-mail address.
|
static boolean |
userExists(String username)
Checks if a user with given username exists.
|
public static boolean userExists(String username)
username - username to look uppublic static ApplicationUser getUser(String username)
username - the username to getpublic static ApplicationUser getUserEvenWhenUnknown(String username)
User based on user name.
If a null username is passed, then a null User object is returned, but it is guaranteed to return a non-null User in all other cases.
If the username is not null, but the User is not found then a proxy unknown immutable User object is returned.
username - the user name of the userpublic static ApplicationUser getUserByEmail(String emailAddress)
The email address is matched case insensitive.
emailAddress - user email addresspublic static List<ApplicationUser> getUsersByEmail(String email)
email - e-mail address@Deprecated public static Collection<ApplicationUser> getAllUsers()
UserSearchServiceWARNING: this could be very high in some JIRA installations, and may therefore pose a performance issue.
public static UserManager getUserManager()
Copyright © 2002-2019 Atlassian. All Rights Reserved.