@PublicApi
public interface UserSearchService
ApplicationUser
objects based on a partial query stringModifier 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
ApplicationUser based on provided criteria and return only those users that match. |
List<ApplicationUser> |
filterUsers(List<ApplicationUser> applicationUsers,
String nameQuery,
UserSearchParams userSearchParams)
Filter a list of
ApplicationUser based 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
userSearchParams parameter. |
List<ApplicationUser> findUsers(JiraServiceContext jiraServiceContext, String query)
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
.
jiraServiceContext
- Jira Service Contextquery
- String to search for.ApplicationUser
objects that match criteria.findUsers(JiraServiceContext, String, UserSearchParams)
ApplicationUser getUserByName(JiraServiceContext jiraServiceContext, String query)
jiraServiceContext
- Jira Service Contextquery
- String to search for.ApplicationUser
object with supplied username.List<ApplicationUser> findUsersAllowEmptyQuery(JiraServiceContext jiraServiceContext, String query)
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
.
jiraServiceContext
- Jira Service Contextquery
- String to search for.ApplicationUser
objects that match criteria.findUsers(JiraServiceContext, String, UserSearchParams)
List<ApplicationUser> findUsers(JiraServiceContext jiraServiceContext, String query, UserSearchParams userSearchParams)
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.
jiraServiceContext
- Jira Service Contextquery
- String to search for.userSearchParams
- Additional search parametersApplicationUser
objects that match criteria.List<ApplicationUser> findUsers(String query, UserSearchParams userSearchParams)
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.
query
- the query to search username, display name and email addressuserSearchParams
- the search criteriaList<ApplicationUser> findUsers(String nameQuery, String emailQuery, UserSearchParams userSearchParams)
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.
nameQuery
- the query to search username and display name.emailQuery
- the query to search email address, subject to userSearchParams.canMatchEmail.userSearchParams
- the search criteriaList<String> findUserNames(String query, UserSearchParams userSearchParams)
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.
query
- the query to search username, display name and email addressuserSearchParams
- the search criteriaList<String> findUserNames(String nameQuery, String emailQuery, UserSearchParams userSearchParams)
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.
nameQuery
- the query to search username and display name.emailQuery
- the query to search email address, subject to userSearchParams.canMatchEmail.userSearchParams
- the search criteriaboolean userMatches(ApplicationUser user, UserSearchParams userSearchParams)
userSearchParams
parameter.
allowEmptyQuery in userSearchParams
is ignored.
user
- the user to be matcheduserSearchParams
- the search criteriaboolean canPerformAjaxSearch(JiraServiceContext jiraServiceContext)
jiraServiceContext
- Jira Service Contextboolean canPerformAjaxSearch(ApplicationUser user)
boolean canShowEmailAddresses(JiraServiceContext jiraServiceContext)
jiraServiceContext
- Jira Service Context@Nonnull Iterable<String> findUserKeysByFullName(@Nullable String fullName)
fullName
- the full name to search for.@Nonnull Iterable<ApplicationUser> findUsersByFullName(@Nullable String fullName)
fullName
- the full name to search for.@Nonnull Iterable<String> findUserKeysByEmail(@Nullable String email)
email
- the e-mail address to search.@Nonnull Iterable<ApplicationUser> findUsersByEmail(@Nullable String email)
email
- the e-mail address to search.@Nonnull @ExperimentalApi List<ApplicationUser> filterUsers(List<ApplicationUser> applicationUsers, String nameQuery, UserSearchParams userSearchParams)
ApplicationUser
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.
applicationUsers
- the user to be filterednameQuery
- the query to search username and display name.userSearchParams
- the search criteria@Nonnull @ExperimentalApi List<ApplicationUser> filterUsers(List<ApplicationUser> applicationUsers, String nameQuery, String emailQuery, UserSearchParams userSearchParams)
ApplicationUser
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.
applicationUsers
- 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.