com.atlassian.jira.issue.search
Class OfBizSearchRequestStore

java.lang.Object
  extended by com.atlassian.jira.issue.search.OfBizSearchRequestStore
All Implemented Interfaces:
SearchRequestStore

public class OfBizSearchRequestStore
extends Object
implements SearchRequestStore

OfBiz implementation of SearchRequestStore

Since:
v3.13

Constructor Summary
OfBizSearchRequestStore(OfBizDelegator delegator)
           
 
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
 CloseableIterable get(SharedEntityAccessor.RetrievalDescriptor descriptor)
          Get a CloseableIterable of SearchRequests for the specified List of ids.
 CloseableIterable getAll()
          Get a CloseableIterable of all SearchRequests in the database.
 Collection getAllOwnedSearchRequests(User author)
          Retrieves a collection of SearchRequest objects that a user created.
 Collection getAllRequests()
          Deprecated. loads them all into memory use getAll() instead
 SearchRequest getRequestByAuthorAndName(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
 CloseableIterable getSearchRequests(Group group)
          Get all search requests associated with a given Group.
 CloseableIterable getSearchRequests(Project project)
          Get all search requests associate with a given Project.
 SearchRequest update(SearchRequest request)
          Updates an existing search request in the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OfBizSearchRequestStore

public OfBizSearchRequestStore(OfBizDelegator delegator)
Method Detail

getAllRequests

public Collection getAllRequests()
Deprecated. loads them all into memory use getAll() instead

Description copied from interface: SearchRequestStore
Retrieves all the SearchRequests

Specified by:
getAllRequests in interface SearchRequestStore
Returns:
Returns a list of searchRequest

get

public CloseableIterable get(SharedEntityAccessor.RetrievalDescriptor descriptor)
Description copied from interface: SearchRequestStore
Get a CloseableIterable of SearchRequests for the specified List of ids.

Make sure any CloseableIterator constructed has its close method called after iterating.

Specified by:
get in interface SearchRequestStore
Parameters:
descriptor - retrieval descriptor
Returns:
CloseableIterable that contains reference to SearchRequests with the specified ids.

getAll

public CloseableIterable getAll()
Description copied from interface: SearchRequestStore
Get a CloseableIterable of all SearchRequests in the database.

Make sure any CloseableIterator constructed has its close method called after iterating.

Specified by:
getAll in interface SearchRequestStore
Returns:
CloseableIterable that contains reference to all SearchRequests.

getAllOwnedSearchRequests

public Collection getAllOwnedSearchRequests(User author)
Description copied from interface: SearchRequestStore
Retrieves a collection of SearchRequest objects that a user created.

Specified by:
getAllOwnedSearchRequests in interface SearchRequestStore
Parameters:
author - The user who created the SearchRequests
Returns:
Collection of all SearchRequest that user created.

getRequestByAuthorAndName

public SearchRequest getRequestByAuthorAndName(User author,
                                               String name)
Description copied from interface: SearchRequestStore
Find a search request given the author and the request name.

Specified by:
getRequestByAuthorAndName in interface SearchRequestStore
Parameters:
author - Author of the SearchRequest
name - Name of the SearchRequest
Returns:
The SearchRequest, or null if there is no matching request

getSearchRequest

public SearchRequest getSearchRequest(Long id)
Description copied from interface: SearchRequestStore
Return the search request as stored in the database

Specified by:
getSearchRequest in interface SearchRequestStore
Parameters:
id - Id of the SearchRequest
Returns:
The SearchRequest, or null if the request id does not exist

create

public SearchRequest create(SearchRequest request)
Description copied from interface: SearchRequestStore
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

Specified by:
create in interface SearchRequestStore
Parameters:
request - SearchResult that should be persisted
Returns:
SearchRequest object that was persisted to the database

update

public SearchRequest update(SearchRequest request)
Description copied from interface: SearchRequestStore
Updates an existing search request in the database.

Specified by:
update in interface SearchRequestStore
Parameters:
request - the request to persist.
Returns:
A SearchRequest that was persisted to the database

adjustFavouriteCount

public SearchRequest adjustFavouriteCount(Long searchRequestId,
                                          int incrementValue)
Description copied from interface: SearchRequestStore
Updates the favourite count of the SearchRequest in the database.

Specified by:
adjustFavouriteCount in interface SearchRequestStore
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

public void delete(Long id)
Description copied from interface: SearchRequestStore
Removes the SearchRequest GenericValue from the database based on its id

Specified by:
delete in interface SearchRequestStore
Parameters:
id - of the search request to be removed from storage

getSearchRequests

public CloseableIterable getSearchRequests(Project project)
Description copied from interface: SearchRequestStore
Get all search requests associate with a given Project.

Specified by:
getSearchRequests in interface SearchRequestStore
Parameters:
project - Project that is associated with the filters
Returns:
Collection of SearchRequest that have their project set to the given project

getSearchRequests

public CloseableIterable getSearchRequests(Group group)
Description copied from interface: SearchRequestStore
Get all search requests associated with a given Group.

Specified by:
getSearchRequests in interface SearchRequestStore
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-2009 Atlassian. All Rights Reserved.