com.atlassian.jira.issue.search
Interface SearchRequestManager

All Superinterfaces:
SharedEntityAccessor<SearchRequest>
All Known Implementing Classes:
DefaultSearchRequestManager

@PublicApi
public interface SearchRequestManager
extends SharedEntityAccessor<SearchRequest>

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


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.jira.sharing.SharedEntityAccessor
SharedEntityAccessor.Factory, SharedEntityAccessor.RetrievalDescriptor
 
Method Summary
 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()
          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(com.atlassian.crowd.embedded.api.User user)
          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(com.atlassian.crowd.embedded.api.User author, String name)
          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(ApplicationUser user, Long id)
          Return the search request as stored in the database if the user has permission to see it.
 SearchRequest getSearchRequestById(Long id)
          Return the search request as stored in the database without any permission checks.
 SearchRequest getSearchRequestById(com.atlassian.crowd.embedded.api.User user, Long id)
          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)
          Deprecated. Use getSearchRequestOwner(Long id) 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, com.atlassian.crowd.embedded.api.User user, int pagePosition, int pageWidth)
          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.
 
Methods inherited from interface com.atlassian.jira.sharing.SharedEntityAccessor
adjustFavouriteCount, get, get, getAllIndexableSharedEntities, getSharedEntity, getSharedEntity, getType, hasPermissionToUse
 

Method Detail

getAllOwnedSearchRequests

Collection<SearchRequest> getAllOwnedSearchRequests(ApplicationUser user)
Retrieves a collection of SearchRequest objects that a user created.

Parameters:
user - The user who created the SearchRequests
Returns:
Collection of all SearchRequest that user created.

getAllOwnedSearchRequests

Collection<SearchRequest> getAllOwnedSearchRequests(com.atlassian.crowd.embedded.api.User user)
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:
Collection of all SearchRequest that user created.

getOwnedSearchRequestByName

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

getOwnedSearchRequestByName

SearchRequest getOwnedSearchRequestByName(com.atlassian.crowd.embedded.api.User author,
                                          String name)
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

getSearchRequestById

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
See Also:
getSearchRequestById(Long)

getSearchRequestById

SearchRequest getSearchRequestById(com.atlassian.crowd.embedded.api.User user,
                                   Long id)
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
See Also:
getSearchRequestById(Long)

getSearchRequestById

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

getAll

EnclosedIterable<SearchRequest> getAll()
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.

Specified by:
getAll in interface SharedEntityAccessor<SearchRequest>
Returns:
an EnclosedIterable of SearchRequests

visitAll

void visitAll(Visitor<SearchRequestEntity> visitor)
Iterates over all SearchRequests using a Visitor pattern callback.


findByNameIgnoreCase

List<SearchRequest> findByNameIgnoreCase(String name)

getSearchRequestOwnerUserName

String getSearchRequestOwnerUserName(Long id)
Deprecated. Use getSearchRequestOwner(Long id) 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.

getSearchRequestOwner

ApplicationUser getSearchRequestOwner(Long id)

create

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

update

SearchRequest update(SearchRequest request)
Updates an existing search request in the database.

Parameters:
request - the request to persist
Returns:
A SearchRequest that was persisted to the database

delete

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

search

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.

search

SharedEntitySearchResult<SearchRequest> search(SharedEntitySearchParameters searchParameters,
                                               com.atlassian.crowd.embedded.api.User user,
                                               int pagePosition,
                                               int pageWidth)
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.


Copyright © 2002-2015 Atlassian. All Rights Reserved.