@PublicApi public interface

SearchRequestManager

implements SharedEntityAccessor<S extends SharedEntity>
com.atlassian.jira.issue.search.SearchRequestManager
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

This manager is responsible for SearchRequests. SearchRequests encapsulate all information used for searches in the issue navigator.

Summary

Public Methods
SearchRequest create(SearchRequest request)
Takes a SearchRequest, user, name of search request and description and persists the XML representation of the SearchRequest object to the database along with the rest of the details
void delete(Long id)
Removes the SearchRequest GenericValue from the database based on its id
List<SearchRequest> findByNameIgnoreCase(String name)
EnclosedIterable<SearchRequest> getAll()
This method is deprecated. Use visitAll(Visitor) instead. Since v5.2.
Collection<SearchRequest> getAllOwnedSearchRequests(ApplicationUser user)
Retrieves a collection of SearchRequest objects that a user created.
Collection<SearchRequest> getAllOwnedSearchRequests(User user)
This method is deprecated. Use getAllOwnedSearchRequests(com.atlassian.jira.user.ApplicationUser) instead. Since v6.0. Retrieves a collection of SearchRequest objects that a user created.
SearchRequest getOwnedSearchRequestByName(ApplicationUser author, String name)
Find a search request given the author and the request name.
SearchRequest getOwnedSearchRequestByName(User author, String name)
This method is deprecated. Use getOwnedSearchRequestByName(com.atlassian.jira.user.ApplicationUser, String) instead. Since v6.0. Find a search request given the author and the request name.
SearchRequest getSearchRequestById(Long id)
Return the search request as stored in the database without any permission checks.
SearchRequest getSearchRequestById(ApplicationUser user, Long id)
Return the search request as stored in the database if the user has permission to see it.
SearchRequest getSearchRequestById(User user, Long id)
This method is deprecated. Use getSearchRequestById(com.atlassian.jira.user.ApplicationUser, Long) instead. Since v6.0. Return the search request as stored in the database if the user has permission to see it.
ApplicationUser getSearchRequestOwner(Long id)
String getSearchRequestOwnerUserName(Long id)
This method is deprecated. Use getSearchRequestOwner(Long) instead. Since v6.0. Return the owner of the passed SearchRequest. This is mainly used for permission checks.
SharedEntitySearchResult<SearchRequest> search(SharedEntitySearchParameters searchParameters, ApplicationUser user, int pagePosition, int pageWidth)
Search for the SearchRequests that match the passed searchParameters.
SharedEntitySearchResult<SearchRequest> search(SharedEntitySearchParameters searchParameters, User user, int pagePosition, int pageWidth)
This method is deprecated. Use search(com.atlassian.jira.sharing.search.SharedEntitySearchParameters, com.atlassian.jira.user.ApplicationUser, int, int) instead. Since v6.0. Search for the SearchRequests that match the passed searchParameters. The result can be paged so that a subset of the results can be returned.
SearchRequest update(SearchRequest request)
Updates an existing search request in the database.
void visitAll(Visitor<SearchRequestEntity> visitor)
Iterates over all SearchRequests using a Visitor pattern callback.
[Expand]
Inherited Methods
From interface com.atlassian.jira.sharing.SharedEntityAccessor

Public Methods

public SearchRequest create (SearchRequest request)

Takes a SearchRequest, user, name of search request and description and persists the XML representation of the SearchRequest object to the database along with the rest of the details

Parameters
request SearchResult that should be persisted
Returns
  • SearchRequest object that was persisted to the database

public void delete (Long id)

Removes the SearchRequest GenericValue from the database based on its id

Parameters
id of the search request to be removed from storage

public List<SearchRequest> findByNameIgnoreCase (String name)

public EnclosedIterable<SearchRequest> getAll ()

This method is deprecated.
Use visitAll(Visitor) instead. Since v5.2.

Get all SearchRequests. WARNING: This method will run horribly slow on systems with a lot of saved filters.

Returns

public Collection<SearchRequest> getAllOwnedSearchRequests (ApplicationUser user)

Retrieves a collection of SearchRequest objects that a user created.

Parameters
user The user who created the SearchRequests
Returns

public Collection<SearchRequest> getAllOwnedSearchRequests (User user)

This method is deprecated.
Use getAllOwnedSearchRequests(com.atlassian.jira.user.ApplicationUser) instead. Since v6.0. Retrieves a collection of SearchRequest objects that a user created.

Parameters
user The user who created the SearchRequests
Returns

public SearchRequest getOwnedSearchRequestByName (ApplicationUser author, String name)

Find a search request given the author and the request name.

Parameters
author The author of the SearchRequest
name The name of the SearchRequest
Returns
  • The SearchRequest, or null if there is no matching request

public SearchRequest getOwnedSearchRequestByName (User author, String name)

This method is deprecated.
Use getOwnedSearchRequestByName(com.atlassian.jira.user.ApplicationUser, String) instead. Since v6.0. Find a search request given the author and the request name.

Parameters
author The author of the SearchRequest
name The name of the SearchRequest
Returns
  • The SearchRequest, or null if there is no matching request

public SearchRequest getSearchRequestById (Long id)

Return the search request as stored in the database without any permission checks.

Parameters
id The id of the filter
Returns
  • The SearchRequest, or null if the request id does not exist

public SearchRequest getSearchRequestById (ApplicationUser user, Long id)

Return the search request as stored in the database if the user has permission to see it.

Parameters
user The user to check shares with
id The id of the filter
Returns
  • The SearchRequest, or null if the request id does not exist

public SearchRequest getSearchRequestById (User user, Long id)

This method is deprecated.
Use getSearchRequestById(com.atlassian.jira.user.ApplicationUser, Long) instead. Since v6.0. Return the search request as stored in the database if the user has permission to see it.

Parameters
user The user to check shares with
id The id of the filter
Returns
  • The SearchRequest, or null if the request id does not exist

public ApplicationUser getSearchRequestOwner (Long id)

public String getSearchRequestOwnerUserName (Long id)

This method is deprecated.
Use getSearchRequestOwner(Long) instead. Since v6.0. Return the owner of the passed SearchRequest. This is mainly used for permission checks.

Parameters
id the identifier of the SearchRequest.
Returns
  • the username of the owner of the SearchRequest. Null is returned if the SearchRequest does not exist.

public SharedEntitySearchResult<SearchRequest> search (SharedEntitySearchParameters searchParameters, ApplicationUser user, int pagePosition, int pageWidth)

Search for the SearchRequests that match the passed searchParameters. The result can be paged so that a subset of the results can be returned.

Parameters
searchParameters the searchParameters to query.
user the user performing the search.
pagePosition the page to return.
pageWidth the number of results per page.
Returns
  • the result of the search.

public SharedEntitySearchResult<SearchRequest> search (SharedEntitySearchParameters searchParameters, User user, int pagePosition, int pageWidth)

This method is deprecated.
Use search(com.atlassian.jira.sharing.search.SharedEntitySearchParameters, com.atlassian.jira.user.ApplicationUser, int, int) instead. Since v6.0. Search for the SearchRequests that match the passed searchParameters. The result can be paged so that a subset of the results can be returned.

Parameters
searchParameters the searchParameters to query.
user the user performing the search.
pagePosition the page to return.
pageWidth the number of results per page.
Returns
  • the result of the search.

public SearchRequest update (SearchRequest request)

Updates an existing search request in the database.

Parameters
request the request to persist
Returns

public void visitAll (Visitor<SearchRequestEntity> visitor)

Iterates over all SearchRequests using a Visitor pattern callback.