com.atlassian.jira.issue.search
Class SearchRequestFactory

java.lang.Object
  extended bycom.atlassian.jira.issue.search.SearchRequestFactory

public class SearchRequestFactory
extends java.lang.Object


Constructor Summary
SearchRequestFactory()
           
 
Method Summary
static SearchRequest getRequest(User searcher, java.lang.Long id)
          Find a search request given the searcher and the search request ID.
static SearchRequest getRequest(User author, java.lang.String name, User searcher)
          Find a search request given the author and the request name.
static java.util.List getRequests()
          Retrieves all the SearchRequest GenericValues
static java.util.Collection getRequests(User author)
          Retrieves all the SearchRequest GenericValues from a particular user
static java.util.List getVisibleRequests(User user)
          Return a list of all search requests visible to a given user.
static SearchRequest loadByMap(java.util.Map fields, User searcher)
           
static void remove(User author, java.lang.Long id)
          Removes the SearchRequest GenericValue from the database based on its id and User
static GenericValue save(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
static GenericValue update(SearchRequest request)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SearchRequestFactory

public SearchRequestFactory()
Method Detail

save

public static GenericValue save(SearchRequest request)
                         throws GenericEntityException
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:
GenericValue object that was persisted to the database
Throws:
GenericEntityException

update

public static GenericValue update(SearchRequest request)
                           throws GenericEntityException
Throws:
GenericEntityException

remove

public static void remove(User author,
                          java.lang.Long id)
                   throws SearchException
Removes the SearchRequest GenericValue from the database based on its id and User

Parameters:
author - of the SearchRequest
id - of the search request to be removed from storage
Throws:
SearchException

getRequests

public static java.util.List getRequests()
                                  throws GenericEntityException
Retrieves all the SearchRequest GenericValues

Returns:
Returns a list of searchRequest GenericValues
Throws:
GenericEntityException

getRequests

public static java.util.Collection getRequests(User author)
                                        throws GenericEntityException
Retrieves all the SearchRequest GenericValues from a particular user

Parameters:
author - to retrieve all the SearchRequests for
Returns:
Returns a list of searchRequest GenericValues
Throws:
GenericEntityException
See Also:
getVisibleRequests(User)

getRequest

public static SearchRequest getRequest(User author,
                                       java.lang.String name,
                                       User searcher)
                                throws GenericEntityException
Find a search request given the author and the request name.

Returns:
The SearchRequest, or null if there is no matching request
Throws:
GenericEntityException - If any exceptions occur finding the request

getRequest

public static SearchRequest getRequest(User searcher,
                                       java.lang.Long id)
                                throws GenericEntityException
Find a search request given the searcher and the search request ID.

Returns:
The SearchRequest, or null if there is no matching request for this searcher.
Throws:
GenericEntityException - If any exceptions occur finding the request

loadByMap

public static SearchRequest loadByMap(java.util.Map fields,
                                      User searcher)
                               throws GenericEntityException
Parameters:
fields -
Returns:
Throws:
GenericEntityException

getVisibleRequests

public static java.util.List getVisibleRequests(User user)
                                         throws GenericEntityException
Return a list of all search requests visible to a given user.

Parameters:
user - The user to find search requests for
Returns:
A list of visible search requests
Throws:
GenericEntityException