com.atlassian.jira.issue.search.managers
Interface SearchHandlerManager

All Known Implementing Classes:
DefaultSearchHandlerManager

public interface SearchHandlerManager

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

Since:
v4.0

Method Summary
 java.util.Collection<IssueSearcher<?>> getAllSearchers()
          Return all the active searchers in JIRA.
 java.util.Collection<ClauseHandler> getClauseHandler(java.lang.String jqlClauseName)
          Return a collection of ClauseHandlers registered against the passed JQL clause name.
 java.util.Collection<ClauseHandler> getClauseHandler(com.opensymphony.user.User user, java.lang.String jqlClauseName)
          Return a collection of ClauseHandlers registered against the passed JQL clause name.
 java.util.Collection<java.lang.String> getFieldIds(java.lang.String jqlClauseName)
          Gets the field ids that are associated with the provided jqlClauseName.
 java.util.Collection<java.lang.String> getFieldIds(com.opensymphony.user.User searcher, java.lang.String jqlClauseName)
          Gets the field ids that are associated with the provided jqlClauseName.
 java.util.Collection<ClauseNames> getJqlClauseNames(java.lang.String fieldId)
          Get the ClauseNames associated with the provided field name.
 IssueSearcher<?> getSearcher(java.lang.String id)
          Get a searcher by the searchers name.
 java.util.Collection<SearcherGroup> getSearcherGroups(SearchContext searchContext)
          Get all searcher groups with the IssueSearcher that are applicable for the context.
 java.util.Collection<IssueSearcher<?>> getSearchers(com.opensymphony.user.User searcher, SearchContext context)
          Get searchers that are applicable for a given context.
 java.util.Collection<IssueSearcher<?>> getSearchersByClauseName(com.opensymphony.user.User user, java.lang.String jqlClauseName, SearchContext searchContext)
          Return a collection of IssueSearchers registered against the passed JQL clause name.
 java.util.Collection<ClauseHandler> getVisibleClauseHandlers(com.opensymphony.user.User searcher)
          Get all the available clause handlers that the searcher can see.
 java.util.Collection<ClauseNames> getVisibleJqlClauseNames(com.opensymphony.user.User searcher)
          Get all the available clause names that the searcher can see.
 void refresh()
          Refreshes the SearchHandlerManager.
 

Method Detail

getSearchers

java.util.Collection<IssueSearcher<?>> getSearchers(com.opensymphony.user.User 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:
Collection of IssueSearcher

getAllSearchers

java.util.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

java.util.Collection<SearcherGroup> getSearcherGroups(SearchContext searchContext)
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:
Collection of SearcherGroup

getSearcher

IssueSearcher<?> getSearcher(java.lang.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.

refresh

void refresh()
Refreshes the SearchHandlerManager.


getClauseHandler

@NotNull
java.util.Collection<ClauseHandler> getClauseHandler(com.opensymphony.user.User user,
                                                             java.lang.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 ClausePermissionChecker.hasPermissionToUseClause(com.opensymphony.user.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.

getClauseHandler

@NotNull
java.util.Collection<ClauseHandler> getClauseHandler(java.lang.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.

getJqlClauseNames

@NotNull
java.util.Collection<ClauseNames> getJqlClauseNames(java.lang.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 Field.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.

getFieldIds

@NotNull
java.util.Collection<java.lang.String> getFieldIds(com.opensymphony.user.User searcher,
                                                           java.lang.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 ClausePermissionChecker.hasPermissionToUseClause(com.opensymphony.user.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

getFieldIds

@NotNull
java.util.Collection<java.lang.String> getFieldIds(java.lang.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

getVisibleJqlClauseNames

@NotNull
java.util.Collection<ClauseNames> getVisibleJqlClauseNames(com.opensymphony.user.User 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.

getVisibleClauseHandlers

@NotNull
java.util.Collection<ClauseHandler> getVisibleClauseHandlers(com.opensymphony.user.User 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.

getSearchersByClauseName

@NotNull
java.util.Collection<IssueSearcher<?>> getSearchersByClauseName(com.opensymphony.user.User user,
                                                                        java.lang.String jqlClauseName,
                                                                        SearchContext searchContext)
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 SearchRenderer.isShown(com.opensymphony.user.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.


Copyright © 2002-2010 Atlassian. All Rights Reserved.