@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(String jqlClauseName)
Return a collection of
ClauseHandler s registered against the passed JQL clause
name. |
Collection<ClauseHandler> |
getClauseHandler(com.atlassian.crowd.embedded.api.User user,
String jqlClauseName)
Return a collection of
ClauseHandler s registered against the passed JQL clause
name. |
Collection<String> |
getFieldIds(String jqlClauseName)
Gets the field ids that are associated with the provided jqlClauseName.
|
Collection<String> |
getFieldIds(com.atlassian.crowd.embedded.api.User searcher,
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(com.atlassian.crowd.embedded.api.User searcher,
SearchContext context)
Get searchers that are applicable for a given context.
|
Collection<IssueSearcher<?>> |
getSearchersByClauseName(com.atlassian.crowd.embedded.api.User user,
String jqlClauseName)
Return a collection of
IssueSearcher s registered against the
passed JQL clause name. |
Collection<IssueSearcher<?>> |
getSearchersByClauseName(com.atlassian.crowd.embedded.api.User user,
String jqlClauseName,
SearchContext searchContext)
Return a collection of
IssueSearcher s registered against the
passed JQL clause name. |
Collection<ClauseHandler> |
getVisibleClauseHandlers(com.atlassian.crowd.embedded.api.User searcher)
Get all the available clause handlers that the searcher can see.
|
Collection<ClauseNames> |
getVisibleJqlClauseNames(com.atlassian.crowd.embedded.api.User searcher)
Get all the available clause names that the searcher can see.
|
void |
onClearCache(ClearCacheEvent event) |
void |
onPluginModuleDisabled(com.atlassian.plugin.event.events.PluginModuleDisabledEvent event) |
void |
onPluginModuleEnabled(com.atlassian.plugin.event.events.PluginModuleEnabledEvent 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 onPluginModuleEnabled(com.atlassian.plugin.event.events.PluginModuleEnabledEvent event)
@EventListener public void onPluginModuleDisabled(com.atlassian.plugin.event.events.PluginModuleDisabledEvent event)
@Nonnull public Collection<ClauseHandler> getClauseHandler(com.atlassian.crowd.embedded.api.User 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 ClausePermissionChecker.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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User 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(com.atlassian.crowd.embedded.api.User searcher, String jqlClauseName)
SearchHandlerManager
ClausePermissionChecker.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(com.atlassian.crowd.embedded.api.User 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 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(com.atlassian.crowd.embedded.api.User 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 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(com.atlassian.crowd.embedded.api.User 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-2015 Atlassian. All Rights Reserved.