@ThreadSafe public final class DefaultSearchHandlerManager extends Object implements SearchHandlerManager
SearchHandlerManager
.Constructor and Description |
---|
DefaultSearchHandlerManager(FieldManager fieldManager,
CustomFieldManager customFieldManager,
SystemClauseHandlerFactory systemClauseHandlerFactory,
QueryCache queryCache,
com.atlassian.cache.CacheManager cacheManager,
JqlAliasManager jqlAliasManager) |
Modifier and Type | Method and Description |
---|---|
Collection<IssueSearcher<?>> |
getAllSearchers()
Return all the active searchers in JIRA.
|
Collection<ClauseHandler> |
getClauseHandler(ApplicationUser user,
String jqlClauseName)
Return a collection of
ClauseHandler s registered against the passed JQL clause
name. |
Collection<ClauseHandler> |
getClauseHandler(String jqlClauseName)
Return a collection of
ClauseHandler s registered against the passed JQL clause
name. |
Collection<String> |
getFieldIds(ApplicationUser searcher,
String jqlClauseName)
Gets the field ids that are associated with the provided jqlClauseName.
|
Collection<String> |
getFieldIds(String jqlClauseName)
Gets the field ids that are associated with the provided jqlClauseName.
|
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.
|
Collection<SearcherGroup> |
getSearcherGroups()
Get all searcher groups.
|
Collection<SearcherGroup> |
getSearcherGroups(SearchContext searchContext)
Get all searcher groups with the
IssueSearcher that are applicable for the context. |
Collection<IssueSearcher<?>> |
getSearchers(ApplicationUser searcher,
SearchContext context)
Get searchers that are applicable for a given context.
|
Collection<IssueSearcher<?>> |
getSearchersByClauseName(ApplicationUser user,
String jqlClauseName)
Return a collection of
IssueSearcher s registered against the
passed JQL clause name. |
Collection<IssueSearcher<?>> |
getSearchersByClauseName(ApplicationUser user,
String jqlClauseName,
SearchContext searchContext)
Return a collection of
IssueSearcher s registered against the
passed JQL clause name. |
Collection<ClauseHandler> |
getVisibleClauseHandlers(ApplicationUser searcher)
Get all the available clause handlers that the searcher can see.
|
Collection<ClauseNames> |
getVisibleJqlClauseNames(ApplicationUser searcher)
Get all the available clause names that the searcher can see.
|
void |
onClearCache(ClearCacheEvent event) |
void |
onJiraPluginCacheResetEvent(JiraPluginCacheResetEvent event) |
void |
refresh()
Refreshes the
SearchHandlerManager . |
public DefaultSearchHandlerManager(FieldManager fieldManager, CustomFieldManager customFieldManager, SystemClauseHandlerFactory systemClauseHandlerFactory, QueryCache queryCache, com.atlassian.cache.CacheManager cacheManager, JqlAliasManager jqlAliasManager)
@EventListener public void onClearCache(ClearCacheEvent event)
@EventListener public void onJiraPluginCacheResetEvent(JiraPluginCacheResetEvent event)
@Nonnull public Collection<ClauseHandler> getClauseHandler(ApplicationUser user, String jqlClauseName)
SearchHandlerManager
ClauseHandler
s 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!getClauseHandler
in interface SearchHandlerManager
user
- that will be used to perform a permission check.jqlClauseName
- the clause name to search for.@Nonnull public Collection<ClauseHandler> getClauseHandler(String jqlClauseName)
SearchHandlerManager
ClauseHandler
s 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!getClauseHandler
in interface SearchHandlerManager
jqlClauseName
- the clause name to search for.@Nonnull public Collection<ClauseNames> getJqlClauseNames(String fieldId)
SearchHandlerManager
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.
getJqlClauseNames
in interface SearchHandlerManager
fieldId
- the Field.getId()
.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.@Nonnull public Collection<ClauseNames> getVisibleJqlClauseNames(ApplicationUser searcher)
SearchHandlerManager
getVisibleJqlClauseNames
in interface SearchHandlerManager
searcher
- that will be used to perform a permission check.ClauseNames
visible to the user. Empty collection
is returned when the can see no clauses.@Nonnull public Collection<ClauseHandler> getVisibleClauseHandlers(ApplicationUser searcher)
SearchHandlerManager
getVisibleClauseHandlers
in interface SearchHandlerManager
searcher
- that will be used to perform a permission check.ClauseHandler
visible to the user. Empty collection
is returned when the can see no clauses.@Nonnull public Collection<String> getFieldIds(ApplicationUser searcher, String jqlClauseName)
SearchHandlerManager
com.atlassian.jira.jql.permission.ClausePermissionHandler#hasPermissionToUseClause(com.atlassian.crowd.embedded.api.User)
method.getFieldIds
in interface SearchHandlerManager
searcher
- that will be used to perform a permission check.jqlClauseName
- the clause name to find the field id for.@Nonnull public Collection<String> getFieldIds(String jqlClauseName)
SearchHandlerManager
getFieldIds
in interface SearchHandlerManager
jqlClauseName
- the clause name to find the field id for.@Nonnull public Collection<IssueSearcher<?>> getSearchersByClauseName(ApplicationUser user, String jqlClauseName, SearchContext searchContext)
SearchHandlerManager
IssueSearcher
s 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.getSearchersByClauseName
in interface SearchHandlerManager
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@Nonnull public Collection<IssueSearcher<?>> getSearchersByClauseName(ApplicationUser user, String jqlClauseName)
SearchHandlerManager
IssueSearcher
s 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.getSearchersByClauseName
in interface SearchHandlerManager
user
- that will be used to perform a permission check.jqlClauseName
- the clause name to search for.public Collection<IssueSearcher<?>> getSearchers(ApplicationUser searcher, SearchContext context)
SearchHandlerManager
com.atlassian.jira.issue.search.searchers.IssueSearcher#getSearchRenderer()#isShown(com.atlassian.jira.issue.search.SearchContext)
method.getSearchers
in interface SearchHandlerManager
searcher
- performing this action.context
- for the list of searchers. Must not be nullIssueSearcher
public Collection<IssueSearcher<?>> getAllSearchers()
SearchHandlerManager
getAllSearchers
in interface SearchHandlerManager
public Collection<SearcherGroup> getSearcherGroups(SearchContext searchContext)
SearchHandlerManager
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.getSearcherGroups
in interface SearchHandlerManager
searchContext
- for the searcher groups.SearcherGroup
public Collection<SearcherGroup> getSearcherGroups()
SearchHandlerManager
SearcherGroup
will
still appear even if no IssueSearcher
are shown for the group.getSearcherGroups
in interface SearchHandlerManager
SearcherGroup
public IssueSearcher<?> getSearcher(String id)
SearchHandlerManager
getSearcher
in interface SearchHandlerManager
id
- the string identifier returned by com.atlassian.jira.issue.search.searchers.IssueSearcher#getSearchInformation()#getId()
public void refresh()
SearchHandlerManager
SearchHandlerManager
.refresh
in interface SearchHandlerManager
Copyright © 2002-2022 Atlassian. All Rights Reserved.