Interface SearchHandlerManager
- All Known Implementing Classes:
DefaultSearchHandlerManager
@PublicApi
public interface SearchHandlerManager
Manager that holds all references to search related information in JIRA.
- Since:
- v4.0
-
Method Summary
Modifier and TypeMethodDescriptionReturn all the active searchers in JIRA.getClauseHandler(ApplicationUser user, String jqlClauseName) Return a collection ofClauseHandlers registered against the passed JQL clause name.getClauseHandler(String jqlClauseName) Return a collection ofClauseHandlers registered against the passed JQL clause name.getFieldIds(ApplicationUser searcher, String jqlClauseName) Gets the field ids that are associated with the provided jqlClauseName.getFieldIds(String jqlClauseName) Gets the field ids that are associated with the provided jqlClauseName.getJqlClauseNames(String fieldId) Get theClauseNamesassociated with the provided field name.getSearcher(String id) Get a searcher by the searchers name.Get all searcher groups.getSearchers(ApplicationUser searcher, SearchContext context) Get searchers that are applicable for a given context.getSearchersByClauseName(ApplicationUser user, String jqlClauseName) Return a collection ofIssueSearchers registered against the passed JQL clause name.getVisibleClauseHandlers(ApplicationUser searcher) Get all the available clause handlers that the searcher can see.getVisibleJqlClauseNames(ApplicationUser searcher) Get all the available clause names that the searcher can see.voidrefresh()Refreshes theSearchHandlerManager.
-
Method Details
-
getSearchers
Get searchers that are applicable for a given context. This is found through the invalid input: '{@link com.atlassian.jira.issue.search.searchers.IssueSearcher#getSearchRenderer()#isShown(com.atlassian.jira.issue.search.SearchContext)'} method.- Parameters:
searcher- performing this action.context- for the list of searchers. Must not be null- Returns:
- Collection of
IssueSearcher
-
getAllSearchers
Collection<IssueSearcher<?>> getAllSearchers()Return all the active searchers in JIRA. It will not return the searchers unless they are associated with a field.- Returns:
- all the searchers in JIRA.
-
getSearcherGroups
Collection<SearcherGroup> getSearcherGroups()Get all searcher groups. Note that theSearcherGroupwill still appear even if noIssueSearcherare shown for the group.- Returns:
- Collection of
SearcherGroup
-
getSearcher
Get a searcher by the searchers name.- Parameters:
id- the string identifier returned by}invalid @link
{@link com.atlassian.jira.issue.search.searchers.IssueSearcher#getSearchInformation()#getId()- Returns:
- the searcher matching the id, null if none is found.
-
refresh
void refresh()Refreshes theSearchHandlerManager. -
getClauseHandler
Return a collection ofClauseHandlers registered against the passed JQL clause name. This will only return the handlers that the user has permission to see as specified by themethod. The reason this is returning a collection is that custom fields can have the same JQL clause name and therefore resolve to multiple clause handlers. This will never be the case for System fields; we don't allow it!invalid reference
com.atlassian.jira.jql.permission.ClausePermissionHandler#hasPermissionToUseClause(User)- Parameters:
user- that will be used to perform a permission check.jqlClauseName- the clause name to search for.- Returns:
- A collection of ClauseHandler that are associated with the passed JQL clause name. An empty collection will be returned to indicate failure.
-
getClauseHandler
Return a collection ofClauseHandlers registered against the passed JQL clause name. This will return all available handlers, regardless of permissions. The reason this is returning a collection is that custom fields can have the same JQL clause name and therefore resolve to multiple clause handlers. This will never be the case for System fields; we don't allow it!- Parameters:
jqlClauseName- the clause name to search for.- Returns:
- A collection of ClauseHandler that are associated with the passed JQL clause name. An empty collection will be returned to indicate failure.
-
getJqlClauseNames
Get theClauseNamesassociated with the provided field name.A collection can be returned because it is possible for multiple clause handlers to register against the same field.
- Parameters:
fieldId- theField.getId().- Returns:
- the
ClauseNamesassociated with the provided field name. Empty collection is returned when the field has no JQL names (i.e. no clause handlers) associated with it.
-
getFieldIds
Gets the field ids that are associated with the provided jqlClauseName. The reason this returns a collection is that custom fields can have the same JQL clause name and therefore resolve to multiple field ids. This will only return the fields associated with clause handlers that the user has permission to see as specified by themethod.invalid reference
com.atlassian.jira.jql.permission.ClausePermissionHandler#hasPermissionToUseClause(com.atlassian.crowd.embedded.api.User)- Parameters:
searcher- that will be used to perform a permission check.jqlClauseName- the clause name to find the field id for.- Returns:
- the field ids that are associated with the provided jqlClauseName, empty collection if not found
-
getFieldIds
Gets the field ids that are associated with the provided jqlClauseName. The reason this returns a collection is that custom fields can have the same JQL clause name and therefore resolve to multiple field ids.- Parameters:
jqlClauseName- the clause name to find the field id for.- Returns:
- the field ids that are associated with the provided jqlClauseName, empty collection if not found
-
getVisibleJqlClauseNames
Get all the available clause names that the searcher can see.- Parameters:
searcher- that will be used to perform a permission check.- Returns:
- the
ClauseNamesvisible to the user. Empty collection is returned when the can see no clauses.
-
getVisibleClauseHandlers
Get all the available clause handlers that the searcher can see.- Parameters:
searcher- that will be used to perform a permission check.- Returns:
- the
ClauseHandlervisible to the user. Empty collection is returned when the can see no clauses.
-
getSearchersByClauseName
@Nonnull Collection<IssueSearcher<?>> getSearchersByClauseName(ApplicationUser user, String jqlClauseName) Return a collection ofIssueSearchers registered against the passed JQL clause name. This will only return the IssueSearchers that the user has permission to see as specified by themethod.invalid reference
com.atlassian.jira.issue.search.searchers.renderer.SearchRenderer#isShown(User, com.atlassian.jira.issue.search.SearchContext)- Parameters:
user- that will be used to perform a permission check.jqlClauseName- the clause name to search for.- Returns:
- A collection of IssueSearchers that are associetd with the passed JQL clause name. An empty collection will be returned to indicate failure.
-