Package com.codebarrel.jira.user
Class NativeUserClient
java.lang.Object
com.codebarrel.jira.user.NativeUserClient
- All Implemented Interfaces:
UserClient
-
Field Summary
Fields inherited from interface com.codebarrel.jira.user.UserClient
GROUPS -
Constructor Summary
ConstructorsConstructorDescriptionNativeUserClient(JiraAuthenticationContext authenticationContext, UserSearchService userSearchService, UserBeanTransformer userBeanTransformer, UserService userService) -
Method Summary
Modifier and TypeMethodDescriptionReturns a list of matching users matching the provided query.Returns the currently logged in user.Retrieves a user bean with the given key from Jira's /api/2/user resourcegetUserByAccountId(String accountId, String... expand) getUserByName(String username, String... expand) Retrieves a user bean with the given username from Jira's /api/2/user resource.getUserEmail(String accountId) Returns a user's e-mail.getUsersByAccountId(Set<String> userAccountIds, int maxResults) Get users in bulk using their accountIds
-
Constructor Details
-
NativeUserClient
@Inject public NativeUserClient(JiraAuthenticationContext authenticationContext, UserSearchService userSearchService, UserBeanTransformer userBeanTransformer, UserService userService)
-
-
Method Details
-
getUserByAccountId
- Specified by:
getUserByAccountIdin interfaceUserClient
-
getUser
Description copied from interface:UserClientRetrieves a user bean with the given key from Jira's /api/2/user resource- Specified by:
getUserin interfaceUserClient- Parameters:
key- the key of the userexpand- values to expand- Returns:
- a user bean
-
getUserEmail
Description copied from interface:UserClientReturns a user's e-mail. This is needed, since email addresses may be null in Cloud and there's a specific API only available to some approved apps for retrieving the user's email address.- Specified by:
getUserEmailin interfaceUserClient- Parameters:
accountId- the account id of the user- Returns:
- Email address for user or empty
-
getUserByName
Description copied from interface:UserClientRetrieves a user bean with the given username from Jira's /api/2/user resource.In general this method should *not* be used. Use the
UserClient.getUser(String, String...)method instead.- Specified by:
getUserByNamein interfaceUserClient- Parameters:
username- the username of the userexpand- values to expand- Returns:
- a user bean
-
findUsers
Description copied from interface:UserClientReturns a list of matching users matching the provided query.- Specified by:
findUsersin interfaceUserClient- Parameters:
query- query string to search formaxResults- Max number of users to retrieve- Returns:
- matching users
-
getMyself
Description copied from interface:UserClientReturns the currently logged in user.- Specified by:
getMyselfin interfaceUserClient
-
getUsersByAccountId
Description copied from interface:UserClientGet users in bulk using their accountIds- Specified by:
getUsersByAccountIdin interfaceUserClient- Parameters:
userAccountIds- set or user accountIdsmaxResults- Max number of users to retrieve- Returns:
- matching users
-