public class DefaultUserPickerSearchService extends Object implements UserPickerSearchService, UserSearchService
| Constructor and Description | 
|---|
| DefaultUserPickerSearchService(UserManager userManager,
                              ApplicationProperties applicationProperties,
                              JiraAuthenticationContext authenticationContext,
                              PermissionManager permissionManager,
                              GroupManager groupManager,
                              ProjectManager projectManager,
                              ProjectRoleManager projectRoleManager,
                              com.atlassian.crowd.embedded.api.CrowdService crowdService,
                              com.atlassian.crowd.manager.directory.DirectoryManager directoryManager,
                              com.atlassian.crowd.embedded.api.ApplicationFactory applicationFactory,
                              UserKeyStore userKeyStore) | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | canPerformAjaxSearch(ApplicationUser user)Determines whether the given user could perform AJAX search. | 
| boolean | canPerformAjaxSearch(JiraServiceContext jiraServiceContext)Returns true only if UserPicker Ajax search is enabled AND the user in the context has com.atlassian.jira.user.ApplicationUser Browse permission. | 
| boolean | canShowEmailAddresses(JiraServiceContext jiraServiceContext)Whether or not the UserPicker Ajax should search or show email addresses | 
| List<ApplicationUser> | filterUsers(List<ApplicationUser> applicationUsers,
           String nameQuery,
           String emailQuery,
           UserSearchParams userSearchParams)Filter a list of  ApplicationUserbased on provided criteria and return only those users that match. | 
| List<ApplicationUser> | filterUsers(List<ApplicationUser> applicationUsers,
           String nameQuery,
           UserSearchParams userSearchParams)Filter a list of  ApplicationUserbased on provided criteria and return only those users that match. | 
| Iterable<String> | findUserKeysByEmail(String email)Searches for a user with the specified e-mail address. | 
| Iterable<String> | findUserKeysByFullName(String fullName)Searches for a user with the specified full name. | 
| List<String> | findUserNames(String nameQuery,
             String emailQuery,
             UserSearchParams userSearchParams)Get user names based on query strings. | 
| List<String> | findUserNames(String query,
             UserSearchParams userSearchParams)Get user names based on a query string. | 
| List<ApplicationUser> | findUsers(JiraServiceContext jiraServiceContext,
         String query)Get Users based on a query string. | 
| List<ApplicationUser> | findUsers(JiraServiceContext jiraServiceContext,
         String query,
         UserSearchParams userSearchParams)Get Users based on a query string. | 
| List<ApplicationUser> | findUsers(String nameQuery,
         String emailQuery,
         UserSearchParams userSearchParams)Get Users based on query strings. | 
| List<ApplicationUser> | findUsers(String query,
         UserSearchParams userSearchParams)Get Users based on a query string. | 
| List<ApplicationUser> | findUsersAllowEmptyQuery(JiraServiceContext jiraServiceContext,
                        String query)Get Users based on a query string. | 
| Iterable<ApplicationUser> | findUsersByEmail(String email)Searches for a user with the specified e-mail address. | 
| Iterable<ApplicationUser> | findUsersByFullName(String fullName)Searches for a user with the specified full name. | 
| ApplicationUser | getUserByName(JiraServiceContext jiraServiceContext,
             String query)Returns a user by exact username | 
| boolean | userMatches(ApplicationUser user,
           UserSearchParams userSearchParams)Determine whether a user matches the search criteria specified in the  userSearchParamsparameter. | 
public DefaultUserPickerSearchService(UserManager userManager, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, PermissionManager permissionManager, GroupManager groupManager, ProjectManager projectManager, ProjectRoleManager projectRoleManager, com.atlassian.crowd.embedded.api.CrowdService crowdService, com.atlassian.crowd.manager.directory.DirectoryManager directoryManager, com.atlassian.crowd.embedded.api.ApplicationFactory applicationFactory, UserKeyStore userKeyStore)
public List<ApplicationUser> findUsers(JiraServiceContext jiraServiceContext, String query)
UserPickerSearchServiceMatches on start of username, full name and email as well as all the tokenised (on spaces, '.', '@' etc) words Only returns active users.
 Results are sorted according to the UserCachingComparator.
findUsers in interface UserPickerSearchServicefindUsers in interface UserSearchServicejiraServiceContext - Jira Service Contextquery - String to search for.ApplicationUser objects that match criteria.UserPickerSearchService.findUsers(JiraServiceContext, String, UserSearchParams)public ApplicationUser getUserByName(JiraServiceContext jiraServiceContext, String query)
UserPickerSearchServicegetUserByName in interface UserPickerSearchServicegetUserByName in interface UserSearchServicejiraServiceContext - Jira Service Contextquery - String to search for.ApplicationUser object with supplied username.public List<ApplicationUser> findUsersAllowEmptyQuery(JiraServiceContext jiraServiceContext, String query)
UserPickerSearchServiceMatches on start of username, full name and email as well as all the tokenised (on spaces, '.', '@' etc) words This will search even if the query passed is null or empty. Only returns active users.
 Results are sorted according to the UserCachingComparator.
findUsersAllowEmptyQuery in interface UserPickerSearchServicefindUsersAllowEmptyQuery in interface UserSearchServicejiraServiceContext - Jira Service Contextquery - String to search for.ApplicationUser objects that match criteria.UserPickerSearchService.findUsers(JiraServiceContext, String, UserSearchParams)public List<ApplicationUser> findUsers(JiraServiceContext jiraServiceContext, String query, UserSearchParams userSearchParams)
UserPickerSearchServiceMatches on start of username, full name and email as well as all the tokenised (on spaces, '.', '@' etc) words
 Results are sorted according to the UserCachingComparator.
 
If the users in the database change during this call results might not be consistent if a post processing filter and a result limit is used.
findUsers in interface UserPickerSearchServicefindUsers in interface UserSearchServicejiraServiceContext - Jira Service Contextquery - String to search for.userSearchParams - Additional search parametersApplicationUser objects that match criteria.public List<ApplicationUser> findUsers(String query, UserSearchParams userSearchParams)
UserPickerSearchServiceMatches on start of username, full name and email as well as all the tokenised (on spaces, '.', '@' etc) words
Matches email only when userSearchParams.canMatchEmail() is true.
Results are sorted according to the userSearchParams.comparator. If userSearchParams.comparator is null, no sorting will be performed.
If the users in the database change during this call results might not be consistent if a post processing filter and a result limit is used.
findUsers in interface UserPickerSearchServicefindUsers in interface UserSearchServicequery - the query to search username, display name and email addressuserSearchParams - the search criteriapublic List<ApplicationUser> findUsers(String nameQuery, String emailQuery, UserSearchParams userSearchParams)
UserPickerSearchServiceMatches nameQuery on start of username, full name and email as well as all the tokenised (on spaces, '.', '@' etc) words
Matches emailQuery on start of email, as well as the tokenised words. Email matching is performed only when userSearchParams.canMatchEmail() is true.
Results are sorted according to the userSearchParams.comparator. If userSearchParams.comparator is null, no sorting will be performed.
If the users in the database change during this call results might not be consistent if a post processing filter and a result limit is used.
findUsers in interface UserPickerSearchServicefindUsers in interface UserSearchServicenameQuery - the query to search username and display name.emailQuery - the query to search email address, subject to userSearchParams.canMatchEmail.userSearchParams - the search criteriapublic List<String> findUserNames(String query, UserSearchParams userSearchParams)
UserSearchServiceMatches on start of username, full name and email as well as all the tokenised (on spaces, '.', '@' etc) words
Matches email only when userSearchParams.canMatchEmail() is true.
If the users in the database change during this call results might not be consistent if a post processing filter and a result limit is used.
findUserNames in interface UserSearchServicequery - the query to search username, display name and email addressuserSearchParams - the search criteriapublic List<String> findUserNames(String nameQuery, String emailQuery, UserSearchParams userSearchParams)
UserSearchServiceMatches nameQuery on start of username, full name and email as well as all the tokenised (on spaces, '.', '@' etc) words
Matches emailQuery on start of email, as well as the tokenised words. Email matching is performed only when userSearchParams.canMatchEmail() is true. If email matching is enabled, nameQuery AND emailQuery criteria must match returned users.
If the users in the database change during this call results might not be consistent if a post processing filter and a result limit is used.
findUserNames in interface UserSearchServicenameQuery - the query to search username and display name.emailQuery - the query to search email address, subject to userSearchParams.canMatchEmail.userSearchParams - the search criteriapublic boolean userMatches(ApplicationUser user, UserSearchParams userSearchParams)
UserPickerSearchServiceuserSearchParams parameter.
 
 allowEmptyQuery in userSearchParams is ignored.
userMatches in interface UserPickerSearchServiceuserMatches in interface UserSearchServiceuser - the user to be matcheduserSearchParams - the search criteriapublic boolean canShowEmailAddresses(JiraServiceContext jiraServiceContext)
UserPickerSearchServicecanShowEmailAddresses in interface UserPickerSearchServicecanShowEmailAddresses in interface UserSearchServicejiraServiceContext - Jira Service ContextUserSearchService.canShowEmailAddresses(com.atlassian.jira.bc.JiraServiceContext)public boolean canPerformAjaxSearch(JiraServiceContext jiraServiceContext)
UserPickerSearchServicecanPerformAjaxSearch in interface UserPickerSearchServicecanPerformAjaxSearch in interface UserSearchServicejiraServiceContext - Jira Service Contextpublic boolean canPerformAjaxSearch(ApplicationUser user)
UserPickerSearchServicecanPerformAjaxSearch in interface UserPickerSearchServicecanPerformAjaxSearch in interface UserSearchService@Nonnull public Iterable<String> findUserKeysByFullName(@Nullable String fullName)
UserSearchServicefindUserKeysByFullName in interface UserSearchServicefullName - the full name to search for.@Nonnull public Iterable<String> findUserKeysByEmail(@Nullable String email)
UserSearchServicefindUserKeysByEmail in interface UserSearchServiceemail - the e-mail address to search.@Nonnull public Iterable<ApplicationUser> findUsersByFullName(@Nullable String fullName)
UserSearchServicefindUsersByFullName in interface UserSearchServicefullName - the full name to search for.@Nonnull public Iterable<ApplicationUser> findUsersByEmail(@Nullable String email)
UserSearchServicefindUsersByEmail in interface UserSearchServiceemail - the e-mail address to search.@Nonnull public List<ApplicationUser> filterUsers(List<ApplicationUser> applicationUsers, String nameQuery, UserSearchParams userSearchParams)
UserSearchServiceApplicationUser based on provided criteria and return only those users that match.
 
 NB: The resultant list will be sorted and duplicates removed, if the UserSearchParams.isSorted() value
 is true. If this is set to false, then the resultant list will not be sorted and no duplicate checks performed,
 which may provide some better performance in specific scenarios, as the source list will be filtered as-is and
 all valid results returned in the order they were initially. If a max results value is provided (>= 0) in
 the UserSearchParams then it will be limited in size to that value.
filterUsers in interface UserSearchServiceapplicationUsers - the user to be filterednameQuery - the query to search username and display name.userSearchParams - the search criteria@Nonnull public List<ApplicationUser> filterUsers(List<ApplicationUser> applicationUsers, String nameQuery, String emailQuery, UserSearchParams userSearchParams)
UserSearchServiceApplicationUser based on provided criteria and return only those users that match.
 
 NB: The resultant list will be sorted and duplicates removed, if the UserSearchParams.isSorted() value
 is true. If this is set to false, then the resultant list will not be sorted and no duplicate checks performed,
 which may provide some better performance in specific scenarios, as the source list will be filtered as-is and
 all valid results returned in the order they were initially. If a max results value is provided (>= 0) in
 the UserSearchParams then it will be limited in size to that value.
filterUsers in interface UserSearchServiceapplicationUsers - the user to be filterednameQuery - the query to search username and display name.emailQuery - the query to search email address, subject to userSearchParams.canMatchEmail.userSearchParams - the search criteriaCopyright © 2002-2021 Atlassian. All Rights Reserved.