@PublicApi public interface

SearchHandlerManager

com.atlassian.jira.issue.search.managers.SearchHandlerManager
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

Manager that holds all references to search related information in JIRA.

Summary

Public Methods
Collection<IssueSearcher<?>> getAllSearchers()
Return all the active searchers in JIRA.
@Nonnull Collection<ClauseHandler> getClauseHandler(ApplicationUser user, String jqlClauseName)
Return a collection of ClauseHandlers registered against the passed JQL clause name.
@Nonnull Collection<ClauseHandler> getClauseHandler(String jqlClauseName)
Return a collection of ClauseHandlers registered against the passed JQL clause name.
@Nonnull Collection<String> getFieldIds(ApplicationUser searcher, String jqlClauseName)
Gets the field ids that are associated with the provided jqlClauseName.
@Nonnull Collection<String> getFieldIds(String jqlClauseName)
Gets the field ids that are associated with the provided jqlClauseName.
@Nonnull Collection<ClauseNames> getJqlClauseNames(String fieldId)
Get the ClauseNames associated with the provided field name.
IssueSearcher<?> getSearcher(String id)
Get a searcher by the searchers name.
@Deprecated Collection<SearcherGroup> getSearcherGroups(SearchContext searchContext)
This method is deprecated. Since 6.3.4. The SearchContext parameter is no longer needed. Use getSearcherGroups()
Collection<SearcherGroup> getSearcherGroups()
Get all searcher groups.
Collection<IssueSearcher<?>> getSearchers(ApplicationUser searcher, SearchContext context)
Get searchers that are applicable for a given context.
@Deprecated @Nonnull Collection<IssueSearcher<?>> getSearchersByClauseName(ApplicationUser user, String jqlClauseName, SearchContext searchContext)
This method is deprecated. Since 6.3.3. The SearchContext parameter is no longer needed. Use #getSearchersByClauseName(com.atlassian.crowd.embedded.api.User, String).
@Nonnull Collection<IssueSearcher<?>> getSearchersByClauseName(ApplicationUser user, String jqlClauseName)
Return a collection of IssueSearchers registered against the passed JQL clause name.
@Nonnull Collection<ClauseHandler> getVisibleClauseHandlers(ApplicationUser searcher)
Get all the available clause handlers that the searcher can see.
@Nonnull Collection<ClauseNames> getVisibleJqlClauseNames(ApplicationUser searcher)
Get all the available clause names that the searcher can see.
void refresh()
Refreshes the SearchHandlerManager.

Public Methods

public 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.

@Nonnull public Collection<ClauseHandler> getClauseHandler (ApplicationUser user, String jqlClauseName)

Return a collection of ClauseHandlers registered against the passed JQL clause name. This will only return the handlers that the user has permission to see as specified by the com.atlassian.jira.jql.permission.ClausePermissionHandler#hasPermissionToUseClause(User) method. 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
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.

@Nonnull public Collection<ClauseHandler> getClauseHandler (String jqlClauseName)

Return a collection of ClauseHandlers 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.

@Nonnull public Collection<String> getFieldIds (ApplicationUser searcher, String jqlClauseName)

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 the com.atlassian.jira.jql.permission.ClausePermissionHandler#hasPermissionToUseClause(com.atlassian.crowd.embedded.api.User) method.

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

@Nonnull public Collection<String> getFieldIds (String jqlClauseName)

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

@Nonnull public Collection<ClauseNames> getJqlClauseNames (String fieldId)

Get the ClauseNames associated 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 the getId().
Returns
  • the ClauseNames associated with the provided field name. Empty collection is returned when the field has no JQL names (i.e. no clause handlers) associated with it.

public IssueSearcher<?> getSearcher (String id)

Get a searcher by the searchers name.

Parameters
id the string identifier returned by com.atlassian.jira.issue.search.searchers.IssueSearcher#getSearchInformation()#getId()
Returns
  • the searcher matching the id, null if none is found.

@Deprecated public Collection<SearcherGroup> getSearcherGroups (SearchContext searchContext)

This method is deprecated.
Since 6.3.4. The SearchContext parameter is no longer needed. Use getSearcherGroups()

Get all searcher groups with the IssueSearcher that are applicable for the context. com.atlassian.jira.issue.search.searchers.IssueSearcher#getSearchRenderer()#isShown(SearchContext) method. Note that the SearcherGroup will still appear even if no IssueSearcher are shown for the group.

Parameters
searchContext for the searcher groups.
Returns

public Collection<SearcherGroup> getSearcherGroups ()

Get all searcher groups. Note that the SearcherGroup will still appear even if no IssueSearcher are shown for the group.

Returns

public Collection<IssueSearcher<?>> getSearchers (ApplicationUser searcher, SearchContext context)

Get searchers that are applicable for a given context. This is found through the 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

@Deprecated @Nonnull public Collection<IssueSearcher<?>> getSearchersByClauseName (ApplicationUser user, String jqlClauseName, SearchContext searchContext)

This method is deprecated.
Since 6.3.3. The SearchContext parameter is no longer needed. Use #getSearchersByClauseName(com.atlassian.crowd.embedded.api.User, String).

Return a collection of IssueSearchers registered against the passed JQL clause name. This will only return the IssueSearchers that the user has permission to see as specified by the com.atlassian.jira.issue.search.searchers.renderer.SearchRenderer#isShown(User, com.atlassian.jira.issue.search.SearchContext) method.

Parameters
user that will be used to perform a permission check.
jqlClauseName the clause name to search for.
searchContext the search context under which the searchers must be shown
Returns
  • A collection of IssueSearchers that are associetd with the passed JQL clause name. An empty collection will be returned to indicate failure.

@Nonnull public Collection<IssueSearcher<?>> getSearchersByClauseName (ApplicationUser user, String jqlClauseName)

Return a collection of IssueSearchers registered against the passed JQL clause name. This will only return the IssueSearchers that the user has permission to see as specified by the com.atlassian.jira.issue.search.searchers.renderer.SearchRenderer#isShown(User, com.atlassian.jira.issue.search.SearchContext) method.

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.

@Nonnull public Collection<ClauseHandler> getVisibleClauseHandlers (ApplicationUser searcher)

Get all the available clause handlers that the searcher can see.

Parameters
searcher that will be used to perform a permission check.
Returns
  • the ClauseHandler visible to the user. Empty collection is returned when the can see no clauses.

@Nonnull public Collection<ClauseNames> getVisibleJqlClauseNames (ApplicationUser searcher)

Get all the available clause names that the searcher can see.

Parameters
searcher that will be used to perform a permission check.
Returns
  • the ClauseNames visible to the user. Empty collection is returned when the can see no clauses.

public void refresh ()

Refreshes the SearchHandlerManager.