com.atlassian.jira.issue.search
Interface SearchRequestStore

All Known Implementing Classes:
CachingSearchRequestStore, OfBizSearchRequestStore

public interface SearchRequestStore

Store used for CRUD of SearchRequests

Since:
v3.13

Method Summary
 SearchRequest adjustFavouriteCount(Long searchRequestId, int incrementValue)
          Updates the favourite count of the SearchRequest in the database.
 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
 EnclosedIterable<SearchRequest> get(SharedEntityAccessor.RetrievalDescriptor descriptor)
          Get a EnclosedIterable of SearchRequests for the specified List of ids.
 EnclosedIterable<SearchRequest> getAll()
          Get a EnclosedIterable of all SearchRequests in the database.
 EnclosedIterable<IndexableSharedEntity<SearchRequest>> getAllIndexableSharedEntities()
          Get a EnclosedIterable of all IndexableSharedEntities representing SearchRequests in the database.
 Collection<SearchRequest> getAllOwnedSearchRequests(com.atlassian.crowd.embedded.api.User user)
          Retrieves a collection of SearchRequest objects that a user created.
 Collection<SearchRequest> getAllRequests()
          Deprecated. use getAll()
 SearchRequest getRequestByAuthorAndName(com.atlassian.crowd.embedded.api.User author, String name)
          Find a search request given the author and the request name.
 SearchRequest getSearchRequest(Long id)
          Return the search request as stored in the database
 EnclosedIterable<SearchRequest> getSearchRequests(com.atlassian.crowd.embedded.api.Group group)
          Get all search requests associated with a given Group.
 EnclosedIterable<SearchRequest> getSearchRequests(Project project)
          Get all search requests associate with a given Project.
 SearchRequest update(SearchRequest request)
          Updates an existing search request in the database.
 

Method Detail

getAllRequests

@Deprecated
Collection<SearchRequest> getAllRequests()
Deprecated. use getAll()

Retrieves all the SearchRequests

Returns:
Returns a list of searchRequest

get

EnclosedIterable<SearchRequest> get(SharedEntityAccessor.RetrievalDescriptor descriptor)
Get a EnclosedIterable of SearchRequests for the specified List of ids.

Parameters:
descriptor - retrieval descriptor
Returns:
CloseableIterable that contains reference to SearchRequests with the specified ids.

getAll

EnclosedIterable<SearchRequest> getAll()
Get a EnclosedIterable of all SearchRequests in the database.

Returns:
CloseableIterable that contains reference to all SearchRequests.

getAllIndexableSharedEntities

EnclosedIterable<IndexableSharedEntity<SearchRequest>> getAllIndexableSharedEntities()
Get a EnclosedIterable of all IndexableSharedEntities representing SearchRequests in the database. Note: this is used so that we can retrieve all the meta data about a SearchRequest without having to deal with the Query.

Returns:
CloseableIterable that contains reference to all IndexableSharedEntities representing SearchRequests.

getAllOwnedSearchRequests

Collection<SearchRequest> getAllOwnedSearchRequests(com.atlassian.crowd.embedded.api.User 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.

getRequestByAuthorAndName

SearchRequest getRequestByAuthorAndName(com.atlassian.crowd.embedded.api.User author,
                                        String name)
Find a search request given the author and the request name.

Parameters:
author - Author of the SearchRequest
name - Name of the SearchRequest
Returns:
The SearchRequest, or null if there is no matching request

getSearchRequest

SearchRequest getSearchRequest(@NotNull
                               Long id)
Return the search request as stored in the database

Parameters:
id - Id of the SearchRequest
Returns:
The SearchRequest, or null if the request id does not exist

create

SearchRequest create(@NotNull
                     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(@NotNull
                     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

adjustFavouriteCount

SearchRequest adjustFavouriteCount(@NotNull
                                   Long searchRequestId,
                                   int incrementValue)
Updates the favourite count of the SearchRequest in the database.

Parameters:
searchRequestId - the identifier of the search request to decrease.
incrementValue - the value to increase the favourite count by. Can be a number < 0 to decrease the favourite count.
Returns:
the updated SearchRequest.

delete

void delete(@NotNull
            Long id)
Removes the SearchRequest GenericValue from the database based on its id

Parameters:
id - of the search request to be removed from storage

getSearchRequests

EnclosedIterable<SearchRequest> getSearchRequests(Project project)
Get all search requests associate with a given Project.

Parameters:
project - Project that is associated with the filters
Returns:
Collection of SearchRequest that have their project set to the given project

getSearchRequests

EnclosedIterable<SearchRequest> getSearchRequests(com.atlassian.crowd.embedded.api.Group group)
Get all search requests associated with a given Group.

Parameters:
group - the group that is associated with the filters
Returns:
Collection of SearchRequest that have their project set to the given project


Copyright © 2002-2011 Atlassian. All Rights Reserved.