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 java.lang.Object
implements SearchRequestStore

OfBiz implementation of SearchRequestStore

Since:
v3.13

Constructor Summary
OfBizSearchRequestStore(OfBizDelegator delegator, JqlQueryParser jqlQueryParser, SearchService searchService)
           
 
Method Summary
 SearchRequest adjustFavouriteCount(java.lang.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(java.lang.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.
 java.util.Collection<SearchRequest> getAllOwnedSearchRequests(com.opensymphony.user.User author)
          Retrieves a collection of SearchRequest objects that a user created.
 java.util.Collection<SearchRequest> getAllRequests()
          Deprecated. loads them all into memory use getAll() instead
 SearchRequest getRequestByAuthorAndName(com.opensymphony.user.User author, java.lang.String name)
          Find a search request given the author and the request name.
 SearchRequest getSearchRequest(java.lang.Long id)
          Return the search request as stored in the database
 EnclosedIterable<SearchRequest> getSearchRequests(com.opensymphony.user.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.
 
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,
                               JqlQueryParser jqlQueryParser,
                               SearchService searchService)
Method Detail

getAllRequests

@Deprecated
public java.util.Collection<SearchRequest> 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 EnclosedIterable<SearchRequest> get(SharedEntityAccessor.RetrievalDescriptor descriptor)
Description copied from interface: SearchRequestStore
Get a EnclosedIterable of SearchRequests for the specified List of ids.

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

getAll

public EnclosedIterable<SearchRequest> getAll()
Description copied from interface: SearchRequestStore
Get a EnclosedIterable of all SearchRequests in the database.

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

getAllIndexableSharedEntities

public EnclosedIterable<IndexableSharedEntity<SearchRequest>> getAllIndexableSharedEntities()
Description copied from interface: SearchRequestStore
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.

Specified by:
getAllIndexableSharedEntities in interface SearchRequestStore
Returns:
CloseableIterable that contains reference to all IndexableSharedEntities representing SearchRequests.

getAllOwnedSearchRequests

public java.util.Collection<SearchRequest> getAllOwnedSearchRequests(com.opensymphony.user.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(com.opensymphony.user.User author,
                                               java.lang.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(java.lang.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(java.lang.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(java.lang.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 EnclosedIterable<SearchRequest> 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 EnclosedIterable<SearchRequest> getSearchRequests(com.opensymphony.user.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-2010 Atlassian. All Rights Reserved.