Class UserPickerResourceHelperImpl
java.lang.Object
com.atlassian.jira.rest.v2.issue.users.UserPickerResourceHelperImpl
- All Implemented Interfaces:
UserPickerResourceHelper
@Component
public class UserPickerResourceHelperImpl
extends Object
implements UserPickerResourceHelper
A helper for finding users
- Since:
- v5.2
-
Constructor Summary
ConstructorsConstructorDescriptionUserPickerResourceHelperImpl(UserSearchService userSearchService, I18nHelper i18n, AvatarService avatarService, JiraAuthenticationContext authContext, GlobalPermissionManager globalPermissionManager, FeatureManager featureManager) -
Method Summary
Modifier and TypeMethodDescriptionfindActiveUsers(String searchString) Finds active users, throws exception if search string is nullfindTopAssignableUsers(String searchString, UserSearchIssueContext issueContext, Integer maxResults, boolean ignorePermissionCheck) Finds topmaxResultsassignable usersfindUsers(String searchString, UserSearchParams userSearchParams) Finds users, throws exception if search string is nullFinds users, throws exception if search string is nullfindUsers(String searchString, Boolean includeActive, Boolean includeInactive, boolean allowEmptySearchString) Finds users, throws exception if search string is nullfindUsers(String searchString, Boolean includeActive, Boolean includeInactive, boolean allowEmptySearchString, com.google.common.base.Predicate<com.atlassian.crowd.embedded.api.User> userFilter) Finds users, throws exception if search string is nullfindUsers(String searchString, Boolean includeActive, Boolean includeInactive, boolean allowEmptySearchString, com.google.common.base.Predicate<com.atlassian.crowd.embedded.api.User> userFilter, Integer maxResults) Finds users, throws exception if search string is nullReturns a list of users matching query with highlighting.findUsersAsBean(String query, Integer maxResults, Boolean showAvatar, List<String> excludeUsers, UserSearchParams userSearchParams) Returns a list of users matching query with highlighting.findUsersWithBrowsePermission(String searchString, UserSearchIssueContext issueContext, Integer maxResults, boolean ignorePermissionCheck) Finds users with browse permission, throws exception if search string is nullgetUserByName(String userName) Returns a user if supplied userName is exact match to their username.limitUserSearch(Integer startAt, Integer maxResults, Iterable<ApplicationUser> users, Iterable<String> excludeUsers)
-
Constructor Details
-
UserPickerResourceHelperImpl
@Autowired public UserPickerResourceHelperImpl(UserSearchService userSearchService, I18nHelper i18n, AvatarService avatarService, JiraAuthenticationContext authContext, GlobalPermissionManager globalPermissionManager, FeatureManager featureManager)
-
-
Method Details
-
findUsersAsBean
public UserPickerResultsBean findUsersAsBean(String query, Integer maxResults, Boolean showAvatar, List<String> excludeUsers) Returns a list of users matching query with highlighting. This resource cannot be accessed anonymously.- Specified by:
findUsersAsBeanin interfaceUserPickerResourceHelper- Parameters:
query- A string used to search username, Name or e-mail addressmaxResults- the maximum number of users to return (defaults to 50). The maximum allowed value is 1000. If you specify a value that is higher than this number, your search results will be truncated.showAvatar-excludeUsers-- Returns:
- An object containing list of matched user objects, with html representing highlighting.
-
findUsersAsBean
public UserPickerResultsBean findUsersAsBean(String query, Integer maxResults, Boolean showAvatar, List<String> excludeUsers, UserSearchParams userSearchParams) Description copied from interface:UserPickerResourceHelperReturns a list of users matching query with highlighting. This resource cannot be assessed anonymously.- Specified by:
findUsersAsBeanin interfaceUserPickerResourceHelper- Parameters:
query- A string used to search username, Name or e-mail address. Empty query is not allowed.maxResults- the maximum number of users to return (defaults to 50). The maximum allowed value is 1000. If you specify a value that is higher than this number, your search results will be truncated.showAvatar- get avatar urlexcludeUsers- exclude these users from search resultsuserSearchParams- additional search parameters. allowEmptyQuery is ignored, always treated as false.- Returns:
- An object containing list of matched user objects, with html representing highlighting.
-
limitUserSearch
public List<ApplicationUser> limitUserSearch(Integer startAt, Integer maxResults, Iterable<ApplicationUser> users, @Nullable Iterable<String> excludeUsers) - Specified by:
limitUserSearchin interfaceUserPickerResourceHelper- Parameters:
startAt- start the search at this indexmaxResults- max resultsusers- search results to limitexcludeUsers- exclude these users from search results- Returns:
- adjusted search results
-
findActiveUsers
Description copied from interface:UserPickerResourceHelperFinds active users, throws exception if search string is null- Specified by:
findActiveUsersin interfaceUserPickerResourceHelper- Parameters:
searchString- user query- Returns:
- List of matching users
-
findUsers
public List<ApplicationUser> findUsers(String searchString, Boolean includeActive, Boolean includeInactive) Description copied from interface:UserPickerResourceHelperFinds users, throws exception if search string is null- Specified by:
findUsersin interfaceUserPickerResourceHelper- Parameters:
searchString- user query, no users returned if emptyincludeActive- whether to include active users (null implies true)includeInactive- whether to include inactive users (null implies false)- Returns:
- List of matching users
-
findUsers
public List<ApplicationUser> findUsers(String searchString, Boolean includeActive, Boolean includeInactive, boolean allowEmptySearchString) Description copied from interface:UserPickerResourceHelperFinds users, throws exception if search string is null- Specified by:
findUsersin interfaceUserPickerResourceHelper- Parameters:
searchString- user queryincludeActive- whether to include active users (null implies true)includeInactive- whether to include inactive users (null implies false)allowEmptySearchString- controls whether users are returned if searchString is empty- Returns:
- List of matching users
-
findUsers
public List<ApplicationUser> findUsers(String searchString, Boolean includeActive, Boolean includeInactive, boolean allowEmptySearchString, com.google.common.base.Predicate<com.atlassian.crowd.embedded.api.User> userFilter) Description copied from interface:UserPickerResourceHelperFinds users, throws exception if search string is null- Specified by:
findUsersin interfaceUserPickerResourceHelper- Parameters:
searchString- user queryincludeActive- whether to include active users (null implies true)includeInactive- whether to include inactive users (null implies false)allowEmptySearchString- controls whether users are returned if searchString is emptyuserFilter- filter to post-process user results with. May be null for no filtering.- Returns:
- List of matching users
-
findUsers
public List<ApplicationUser> findUsers(String searchString, Boolean includeActive, Boolean includeInactive, boolean allowEmptySearchString, com.google.common.base.Predicate<com.atlassian.crowd.embedded.api.User> userFilter, Integer maxResults) Description copied from interface:UserPickerResourceHelperFinds users, throws exception if search string is null- Specified by:
findUsersin interfaceUserPickerResourceHelper- Parameters:
searchString- user queryincludeActive- whether to include active users (null implies true)includeInactive- whether to include inactive users (null implies false)allowEmptySearchString- controls whether users are returned if searchString is emptyuserFilter- filter to post-process user results with. May be null for no filtering.maxResults- the result limit, use null for no limit.- Returns:
- List of matching users
-
findUsers
Description copied from interface:UserPickerResourceHelperFinds users, throws exception if search string is null- Specified by:
findUsersin interfaceUserPickerResourceHelper- Parameters:
searchString- user queryuserSearchParams- search parameters, including "includeActive", "includeInactive", etc. allowEmptyQuery is ignored, always treated as false.- Returns:
- List of matching users
-
findUsersWithBrowsePermission
public List<ApplicationUser> findUsersWithBrowsePermission(String searchString, UserSearchIssueContext issueContext, Integer maxResults, boolean ignorePermissionCheck) Description copied from interface:UserPickerResourceHelperFinds users with browse permission, throws exception if search string is null- Specified by:
findUsersWithBrowsePermissionin interfaceUserPickerResourceHelper- Parameters:
searchString- user queryissueContext- context for issuemaxResults- the result limit, use null for no limit.ignorePermissionCheck- controls if user making call must have Browse User permission- Returns:
- List of matching users
-
findTopAssignableUsers
public List<ApplicationUser> findTopAssignableUsers(String searchString, UserSearchIssueContext issueContext, Integer maxResults, boolean ignorePermissionCheck) Description copied from interface:UserPickerResourceHelperFinds topmaxResultsassignable users- Specified by:
findTopAssignableUsersin interfaceUserPickerResourceHelper- Parameters:
searchString- user queryissueContext- context for issuemaxResults- the result limit, use null for no limitignorePermissionCheck- controls if user making call must have Browse User permission- Returns:
- List of matching users
-
getUserByName
Description copied from interface:UserPickerResourceHelperReturns a user if supplied userName is exact match to their username.- Specified by:
getUserByNamein interfaceUserPickerResourceHelper- Parameters:
userName- The username query- Returns:
- User The exact user or null if not found.
-