Class DefaultSearchHandlerManager
java.lang.Object
com.atlassian.jira.issue.search.managers.DefaultSearchHandlerManager
- All Implemented Interfaces:
InitializingComponent
,SearchHandlerManager
,FieldIndexerAccessor
,FieldIndexerStatCollectorAccessor
@ThreadSafe
public final class DefaultSearchHandlerManager
extends Object
implements SearchHandlerManager, InitializingComponent, FieldIndexerAccessor, FieldIndexerStatCollectorAccessor
Default JIRA implementation of
SearchHandlerManager
.- Since:
- v4.0
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultSearchHandlerManager
(FieldManager fieldManager, CustomFieldManager customFieldManager, SystemClauseHandlerFactory systemClauseHandlerFactory, QueryCache queryCache, com.atlassian.cache.CacheManager cacheManager, JqlAliasManager jqlAliasManager, IndexingFeatures indexingFeatures) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Called after all the beans are constructed and the ApplicationContext is fully populated.Return all the active searchers in JIRA.getClauseHandler
(ApplicationUser user, String jqlClauseName) Return a collection ofClauseHandler
s registered against the passed JQL clause name.getClauseHandler
(String jqlClauseName) Return a collection ofClauseHandler
s 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 theClauseNames
associated 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 ofIssueSearcher
s 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.void
onClearCache
(ClearCacheEvent event) void
void
refresh()
Refreshes theSearchHandlerManager
.
-
Constructor Details
-
DefaultSearchHandlerManager
public DefaultSearchHandlerManager(FieldManager fieldManager, CustomFieldManager customFieldManager, SystemClauseHandlerFactory systemClauseHandlerFactory, QueryCache queryCache, com.atlassian.cache.CacheManager cacheManager, JqlAliasManager jqlAliasManager, IndexingFeatures indexingFeatures)
-
-
Method Details
-
afterInstantiation
Description copied from interface:InitializingComponent
Called after all the beans are constructed and the ApplicationContext is fully populated. Order of execution is order of bean creation, driven by InitializingComponentProcessor.- Specified by:
afterInstantiation
in interfaceInitializingComponent
- Throws:
Exception
-
onClearCache
-
onJiraPluginCacheResetEvent
-
getClauseHandler
@Nonnull public Collection<ClauseHandler> getClauseHandler(ApplicationUser user, String jqlClauseName) Description copied from interface:SearchHandlerManager
Return a collection ofClauseHandler
s registered against the passed JQL clause name. This will only return the handlers that the user has permission to see as specified by theinvalid reference
com.atlassian.jira.jql.permission.ClausePermissionHandler#hasPermissionToUseClause(User)
- Specified by:
getClauseHandler
in interfaceSearchHandlerManager
- 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
Description copied from interface:SearchHandlerManager
Return a collection ofClauseHandler
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!- Specified by:
getClauseHandler
in interfaceSearchHandlerManager
- 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
Description copied from interface:SearchHandlerManager
Get theClauseNames
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.
- Specified by:
getJqlClauseNames
in interfaceSearchHandlerManager
- Parameters:
fieldId
- theField.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.
-
getVisibleJqlClauseNames
Description copied from interface:SearchHandlerManager
Get all the available clause names that the searcher can see.- Specified by:
getVisibleJqlClauseNames
in interfaceSearchHandlerManager
- 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.
-
getVisibleClauseHandlers
Description copied from interface:SearchHandlerManager
Get all the available clause handlers that the searcher can see.- Specified by:
getVisibleClauseHandlers
in interfaceSearchHandlerManager
- 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.
-
getFieldIds
Description copied from interface:SearchHandlerManager
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 theinvalid reference
com.atlassian.jira.jql.permission.ClausePermissionHandler#hasPermissionToUseClause(com.atlassian.crowd.embedded.api.User)
- Specified by:
getFieldIds
in interfaceSearchHandlerManager
- 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
Description copied from interface:SearchHandlerManager
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.- Specified by:
getFieldIds
in interfaceSearchHandlerManager
- 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
-
getSearchersByClauseName
@Nonnull public Collection<IssueSearcher<?>> getSearchersByClauseName(ApplicationUser user, String jqlClauseName) Description copied from interface:SearchHandlerManager
Return a collection ofIssueSearcher
s registered against the passed JQL clause name. This will only return the IssueSearchers that the user has permission to see as specified by theinvalid reference
com.atlassian.jira.issue.search.searchers.renderer.SearchRenderer#isShown(User, com.atlassian.jira.issue.search.SearchContext)
- Specified by:
getSearchersByClauseName
in interfaceSearchHandlerManager
- 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.
-
getSearchers
Description copied from interface:SearchHandlerManager
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.- Specified by:
getSearchers
in interfaceSearchHandlerManager
- Parameters:
searcher
- performing this action.context
- for the list of searchers. Must not be null- Returns:
- Collection of
IssueSearcher
-
getAllSearchers
Description copied from interface:SearchHandlerManager
Return all the active searchers in JIRA. It will not return the searchers unless they are associated with a field.- Specified by:
getAllSearchers
in interfaceSearchHandlerManager
- Returns:
- all the searchers in JIRA.
-
getSearcherGroups
Description copied from interface:SearchHandlerManager
Get all searcher groups. Note that theSearcherGroup
will still appear even if noIssueSearcher
are shown for the group.- Specified by:
getSearcherGroups
in interfaceSearchHandlerManager
- Returns:
- Collection of
SearcherGroup
-
getSearcher
Description copied from interface:SearchHandlerManager
Get a searcher by the searchers name.- Specified by:
getSearcher
in interfaceSearchHandlerManager
- Parameters:
id
- the string identifier returned byinvalid @link
{@link com.atlassian.jira.issue.search.searchers.IssueSearcher#getSearchInformation()#getId()
- Returns:
- the searcher matching the id, null if none is found.
-
getAllFieldIndexers
- Specified by:
getAllFieldIndexers
in interfaceFieldIndexerAccessor
-
getIndexerStatsCollectors
- Specified by:
getIndexerStatsCollectors
in interfaceFieldIndexerStatCollectorAccessor
-
refresh
public void refresh()Description copied from interface:SearchHandlerManager
Refreshes theSearchHandlerManager
.- Specified by:
refresh
in interfaceSearchHandlerManager
-