Class NativeUserClient

java.lang.Object
com.codebarrel.jira.user.NativeUserClient
All Implemented Interfaces:
UserClient

@Component public class NativeUserClient extends Object implements UserClient
  • Constructor Details

  • Method Details

    • getUserByAccountId

      public Optional<UserBean> getUserByAccountId(String accountId, String... expand)
      Specified by:
      getUserByAccountId in interface UserClient
    • getUser

      public Optional<UserBean> getUser(String key, String... expand)
      Description copied from interface: UserClient
      Retrieves a user bean with the given key from Jira's /api/2/user resource
      Specified by:
      getUser in interface UserClient
      Parameters:
      key - the key of the user
      expand - values to expand
      Returns:
      a user bean
    • getUserEmail

      public Optional<String> getUserEmail(String accountId)
      Description copied from interface: UserClient
      Returns 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:
      getUserEmail in interface UserClient
      Parameters:
      accountId - the account id of the user
      Returns:
      Email address for user or empty
    • getUserByName

      public Optional<UserBean> getUserByName(String username, String... expand)
      Description copied from interface: UserClient
      Retrieves 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:
      getUserByName in interface UserClient
      Parameters:
      username - the username of the user
      expand - values to expand
      Returns:
      a user bean
    • findUsers

      public List<UserBean> findUsers(String query, int maxResults)
      Description copied from interface: UserClient
      Returns a list of matching users matching the provided query.
      Specified by:
      findUsers in interface UserClient
      Parameters:
      query - query string to search for
      maxResults - Max number of users to retrieve
      Returns:
      matching users
    • getMyself

      public Optional<UserBean> getMyself()
      Description copied from interface: UserClient
      Returns the currently logged in user.
      Specified by:
      getMyself in interface UserClient
    • getUsersByAccountId

      public List<UserBean> getUsersByAccountId(Set<String> userAccountIds, int maxResults)
      Description copied from interface: UserClient
      Get users in bulk using their accountIds
      Specified by:
      getUsersByAccountId in interface UserClient
      Parameters:
      userAccountIds - set or user accountIds
      maxResults - Max number of users to retrieve
      Returns:
      matching users