Class NativeUserService

java.lang.Object
com.codebarrel.jira.user.NativeUserService
All Implemented Interfaces:
UserService

@Component public class NativeUserService extends Object implements UserService
  • Constructor Details

  • Method Details

    • isAutomationAppUser

      public boolean isAutomationAppUser(TenantContext context, String userAccountId)
      Description copied from interface: UserService
      Determines if the passed in user account id, matches the app user in cloud.
      Specified by:
      isAutomationAppUser in interface UserService
      Parameters:
      context - The tenant execution context
      userAccountId - the user's account id to check.
      Returns:
      true if the passed user is the app user.
    • getMyself

      public Optional<UserBean> getMyself(TenantActor tenantActor)
      Description copied from interface: UserService
      Looks up myself on the remote tenant.
      Specified by:
      getMyself in interface UserService
      Parameters:
      tenantActor - The tenant context to retrieve the user details from
      Returns:
      The UserBean or null if no user could be found.
    • getUser

      public Optional<UserBean> getUser(TenantActor tenantActor, String userKey)
      Description copied from interface: UserService
      Looks up a user on the remote tenant.
      Specified by:
      getUser in interface UserService
      Parameters:
      tenantActor - The tenant context to retrieve the user details from
      userKey - The user to lookup.
      Returns:
      The UserBean or null if no user could be found.
    • getUserByAccountId

      public Optional<UserBean> getUserByAccountId(TenantActor tenantActor, String accountId)
      Description copied from interface: UserService
      Looks up a user on the remote tenant using the new accountId.
      Specified by:
      getUserByAccountId in interface UserService
      Parameters:
      tenantActor - The tenant context to retrieve the user details from
      accountId - The user to lookup.
      Returns:
      The UserBean or null if no user could be found.
    • getUserByName

      public Optional<UserBean> getUserByName(TenantActor tenantActor, String username)
      Description copied from interface: UserService
      Looks up a user on the remote tenant by username. In general you *should not* use this method and use the lookup by key above!
      Specified by:
      getUserByName in interface UserService
      Parameters:
      tenantActor - The tenant context to retrieve the user details from
      username - The user to lookup.
      Returns:
      The UserBean or null if no user could be found.
    • getUsersByEmail

      public List<UserBean> getUsersByEmail(TenantActor tenantActor, String email)
      Description copied from interface: UserService
      This will try the following:
      • Run a search for users with this e-mail address
      • Only return users where there's a case insensitive match for e-mail address
      • If that search didn't find anything it will call UserService.getUser(TenantActor, String) in case e-mails are masked/hidden as a fallback.
      Specified by:
      getUsersByEmail in interface UserService
      Parameters:
      tenantActor - The tenant context to retrieve the user details from
      email - The e-mail address of the user
      Returns:
      The UserBean or null if no user could be found.
    • getEstimatedUserCount

      public int getEstimatedUserCount(TenantContext context)
      Description copied from interface: UserService
      Gets the estimated total count of users from the remote tenant.
      Specified by:
      getEstimatedUserCount in interface UserService
      Parameters:
      context - The tenant context to retrieve the count from
      Returns:
      count of users
    • resolveEmail

      public Optional<String> resolveEmail(TenantActor tenantActor, UserBean user)
      Description copied from interface: UserService
      Retrieves a user's e-mail address
      Specified by:
      resolveEmail in interface UserService
      Parameters:
      tenantActor - The tenant context to retrieve the user details from
      user - the user lookup e-mail for
      Returns:
      Email or empty