Class FindUserHelper
java.lang.Object
com.atlassian.confluence.user.persistence.dao.compatibility.FindUserHelper
A utility class that centralises the 'hackyness' involved during the period
we support both username related APIs and the change to user keys.
Find all usages of this class and you will find all the places that 'transitional hackyness' is taking place.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ConfluenceUser
getUser
(@Nullable com.atlassian.user.User user) static ConfluenceUser
getUserByUserKey
(com.atlassian.sal.api.user.UserKey userKey) Get a user byUserKey
static @Nullable ConfluenceUser
getUserByUsername
(@Nullable String username) Get a user by username.
-
Constructor Details
-
FindUserHelper
public FindUserHelper()
-
-
Method Details
-
getUserByUsername
Get a user by username.- Parameters:
username
- the username of the user required- Returns:
- user with the given username or null if the username is null or empty or no user is found.
-
getUserByUserKey
Get a user byUserKey
- Parameters:
userKey
-- Returns:
- the identified user
- Throws:
IllegalArgumentException
- if no user can be found for the key
-
getUser
- Returns:
- ConfluenceUser (Hibernate) for the given user
-