Package com.codebarrel.jira.user
Class NativeUserService
java.lang.Object
com.codebarrel.jira.user.NativeUserService
- All Implemented Interfaces:
UserService
-
Field Summary
Fields inherited from interface com.codebarrel.jira.user.UserService
MAX_USERS -
Constructor Summary
ConstructorsConstructorDescriptionNativeUserService(UserBeanTransformer userBeanTransformer, UserManager userManager, UserSearchService userSearchService, JiraAuthenticationContext authenticationContext) -
Method Summary
Modifier and TypeMethodDescriptionintgetEstimatedUserCount(TenantContext context) Gets the estimated total count of users from the remote tenant.getMyself(TenantActor tenantActor) Looks up myself on the remote tenant.getUser(TenantActor tenantActor, String userKey) Looks up a user on the remote tenant.getUserByAccountId(TenantActor tenantActor, String accountId) Looks up a user on the remote tenant using the new accountId.getUserByName(TenantActor tenantActor, String username) Looks up a user on the remote tenant by username.getUsersByEmail(TenantActor tenantActor, String email) 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 callUserService.getUser(TenantActor, String)in case e-mails are masked/hidden as a fallback.booleanisAutomationAppUser(TenantContext context, String userAccountId) Determines if the passed in user account id, matches the app user in cloud.resolveEmail(TenantActor tenantActor, UserBean user) Retrieves a user's e-mail address
-
Constructor Details
-
NativeUserService
@Inject public NativeUserService(UserBeanTransformer userBeanTransformer, UserManager userManager, UserSearchService userSearchService, JiraAuthenticationContext authenticationContext)
-
-
Method Details
-
isAutomationAppUser
Description copied from interface:UserServiceDetermines if the passed in user account id, matches the app user in cloud.- Specified by:
isAutomationAppUserin interfaceUserService- Parameters:
context- The tenant execution contextuserAccountId- the user's account id to check.- Returns:
- true if the passed user is the app user.
-
getMyself
Description copied from interface:UserServiceLooks up myself on the remote tenant.- Specified by:
getMyselfin interfaceUserService- Parameters:
tenantActor- The tenant context to retrieve the user details from- Returns:
- The UserBean or null if no user could be found.
-
getUser
Description copied from interface:UserServiceLooks up a user on the remote tenant.- Specified by:
getUserin interfaceUserService- Parameters:
tenantActor- The tenant context to retrieve the user details fromuserKey- The user to lookup.- Returns:
- The UserBean or null if no user could be found.
-
getUserByAccountId
Description copied from interface:UserServiceLooks up a user on the remote tenant using the new accountId.- Specified by:
getUserByAccountIdin interfaceUserService- Parameters:
tenantActor- The tenant context to retrieve the user details fromaccountId- The user to lookup.- Returns:
- The UserBean or null if no user could be found.
-
getUserByName
Description copied from interface:UserServiceLooks 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:
getUserByNamein interfaceUserService- Parameters:
tenantActor- The tenant context to retrieve the user details fromusername- The user to lookup.- Returns:
- The UserBean or null if no user could be found.
-
getUsersByEmail
Description copied from interface:UserServiceThis 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:
getUsersByEmailin interfaceUserService- Parameters:
tenantActor- The tenant context to retrieve the user details fromemail- The e-mail address of the user- Returns:
- The UserBean or null if no user could be found.
-
getEstimatedUserCount
Description copied from interface:UserServiceGets the estimated total count of users from the remote tenant.- Specified by:
getEstimatedUserCountin interfaceUserService- Parameters:
context- The tenant context to retrieve the count from- Returns:
- count of users
-
resolveEmail
Description copied from interface:UserServiceRetrieves a user's e-mail address- Specified by:
resolveEmailin interfaceUserService- Parameters:
tenantActor- The tenant context to retrieve the user details fromuser- the user lookup e-mail for- Returns:
- Email or empty
-