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,
FeatureManager featureManager,
GlobalPermissionManager globalPermissionManager) |
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
|
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
userSearchParams parameter. |
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, FeatureManager featureManager, GlobalPermissionManager globalPermissionManager)
public List<ApplicationUser> findUsers(JiraServiceContext jiraServiceContext, String query)
UserPickerSearchService
Matches 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 UserPickerSearchService
findUsers
in interface UserSearchService
jiraServiceContext
- Jira Service Contextquery
- String to search for.ApplicationUser
objects that match criteria.UserPickerSearchService.findUsers(JiraServiceContext, String, UserSearchParams)
public ApplicationUser getUserByName(JiraServiceContext jiraServiceContext, String query)
UserPickerSearchService
getUserByName
in interface UserPickerSearchService
getUserByName
in interface UserSearchService
jiraServiceContext
- Jira Service Contextquery
- String to search for.ApplicationUser
object with supplied username.public List<ApplicationUser> findUsersAllowEmptyQuery(JiraServiceContext jiraServiceContext, String query)
UserPickerSearchService
Matches 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 UserPickerSearchService
findUsersAllowEmptyQuery
in interface UserSearchService
jiraServiceContext
- 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)
UserPickerSearchService
Matches 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 UserPickerSearchService
findUsers
in interface UserSearchService
jiraServiceContext
- Jira Service Contextquery
- String to search for.userSearchParams
- Additional search parametersApplicationUser
objects that match criteria.public List<ApplicationUser> findUsers(String query, UserSearchParams userSearchParams)
UserPickerSearchService
Matches 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 UserPickerSearchService
findUsers
in interface UserSearchService
query
- the query to search username, display name and email addressuserSearchParams
- the search criteriapublic List<ApplicationUser> findUsers(String nameQuery, String emailQuery, UserSearchParams userSearchParams)
UserPickerSearchService
Matches 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 UserPickerSearchService
findUsers
in interface UserSearchService
nameQuery
- 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)
UserSearchService
Matches 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 UserSearchService
query
- the query to search username, display name and email addressuserSearchParams
- the search criteriapublic List<String> findUserNames(String nameQuery, String emailQuery, UserSearchParams userSearchParams)
UserSearchService
Matches 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 UserSearchService
nameQuery
- 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)
UserPickerSearchService
userSearchParams
parameter.
allowEmptyQuery in userSearchParams
is ignored.
userMatches
in interface UserPickerSearchService
userMatches
in interface UserSearchService
user
- the user to be matcheduserSearchParams
- the search criteriapublic boolean canShowEmailAddresses(JiraServiceContext jiraServiceContext)
UserPickerSearchService
canShowEmailAddresses
in interface UserPickerSearchService
canShowEmailAddresses
in interface UserSearchService
jiraServiceContext
- Jira Service ContextUserSearchService.canShowEmailAddresses(com.atlassian.jira.bc.JiraServiceContext)
public boolean canPerformAjaxSearch(JiraServiceContext jiraServiceContext)
UserPickerSearchService
canPerformAjaxSearch
in interface UserPickerSearchService
canPerformAjaxSearch
in interface UserSearchService
jiraServiceContext
- Jira Service Contextpublic boolean canPerformAjaxSearch(ApplicationUser user)
UserPickerSearchService
canPerformAjaxSearch
in interface UserPickerSearchService
canPerformAjaxSearch
in interface UserSearchService
@Nonnull public Iterable<String> findUserKeysByFullName(@Nullable String fullName)
UserSearchService
findUserKeysByFullName
in interface UserSearchService
fullName
- the full name to search for.@Nonnull public Iterable<String> findUserKeysByEmail(@Nullable String email)
UserSearchService
findUserKeysByEmail
in interface UserSearchService
email
- the e-mail address to search.@Nonnull public Iterable<ApplicationUser> findUsersByFullName(@Nullable String fullName)
UserSearchService
findUsersByFullName
in interface UserSearchService
fullName
- the full name to search for.@Nonnull public Iterable<ApplicationUser> findUsersByEmail(@Nullable String email)
UserSearchService
findUsersByEmail
in interface UserSearchService
email
- the e-mail address to search.Copyright © 2002-2015 Atlassian. All Rights Reserved.