com.atlassian.jira.issue.search
Class SearchRequest

java.lang.Object
  extended bycom.atlassian.jira.issue.search.SearchRequest
All Implemented Interfaces:
Serializable

public class SearchRequest
extends Object
implements Serializable

A class representing a Search Request. Sometimes also referred to as a "Saved search", "Saved Filter", "Search Filter". This sits in the session so all non-serializable properties should be transient and accessed through accessors.

See Also:
Serialized Form

Constructor Summary
SearchRequest(boolean turnOffSecurity)
          This constructor should only be used by internal JIRA queries, as the results will be unprotected (ie no permission checks are done).
SearchRequest(electric.xml.Document doc)
          Construct a SearchRequest from its XML representation.
SearchRequest(electric.xml.Document doc, User searcher)
           
SearchRequest(org.ofbiz.core.entity.GenericValue gv, User searcher)
           
SearchRequest(SearchRequest oldSearchRequest, User searcher)
           
SearchRequest(User searcher)
           
SearchRequest(User searcher, String name, String description)
           
 
Method Summary
 void addParameter(SearchParameter parameter)
           
 void addParameters(Collection searchParams)
           
 void addSearchSort(SearchSort searchSort)
           
 SearchRequest cloneSearchRequest()
           
 boolean equals(Object o)
           
 User getAuthor()
           
 String getDescription()
           
 String getGroup()
           
 Long getId()
           
 List getLuceneParameters()
           
 String getName()
           
 SearchParameter getParam(String paramName)
          Returns the first SearchParameter that matches the given name.
 List getParameters()
          Returns all the parameters for the search request as a List of SearchParameter
 org.ofbiz.core.entity.GenericValue getProject()
           
 String getQueryString()
          Returns the encoded query string of the current search request
 String getQueryStringWithSorts()
          Returns the encoded query string of the current search request with sort info
 List getReleventSearchers()
           
 SearchContext getSearchContext()
           
 org.ofbiz.core.entity.GenericValue getSearchFilterGV()
           
 Long getSearchFilterId()
           
 SearchRequest getSearchRequestWithSubstitutions(List substitutions)
          This method will return an new instance of a SearchRequest that will have the same parameters as in this SearchRequest except that any parameters listed in the substitutions list will exist in the new SearchRequest in place of any of the same parameters that may have been in this SearchRequest.
 Collection getSearchSorts()
           
 Collection getSearchSortsReverse()
           
 String getUser()
           
 List getValues(String paramName)
          Returns the values of the first SearchParameter that matches the given name.
 electric.xml.Document getXml()
          Returns the search request as an XML document
 int hashCode()
           
 boolean isContainsParam(String paramName)
          Whether the SR contains this param name
 boolean isLoaded()
           
 boolean isModified()
           
 boolean isOverRideSecurity()
           
 void removeParameter(SearchParameter parameter)
          This method will remove a parameter by name.
 void setAuthor(User author)
           
 void setDescription(String description)
           
 void setGroup(String group)
           
 void setLoaded(boolean loaded)
           
 void setModified(boolean modified)
           
 void setName(String name)
           
 void setSearchContext(SearchContext searchContext)
           
 void setSearchSorts(Collection searchSorts)
           
 void setUseColumns(boolean useColumns)
           
 void setUser(String user)
           
 String toString()
           
 boolean useColumns()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchRequest

public SearchRequest(User searcher)

SearchRequest

public SearchRequest(User searcher,
                     String name,
                     String description)

SearchRequest

public SearchRequest(boolean turnOffSecurity)
This constructor should only be used by internal JIRA queries, as the results will be unprotected (ie no permission checks are done).


SearchRequest

public SearchRequest(electric.xml.Document doc)
Construct a SearchRequest from its XML representation.


SearchRequest

public SearchRequest(electric.xml.Document doc,
                     User searcher)

SearchRequest

public SearchRequest(SearchRequest oldSearchRequest,
                     User searcher)

SearchRequest

public SearchRequest(org.ofbiz.core.entity.GenericValue gv,
                     User searcher)
              throws SearchException
Method Detail

getSearchContext

public SearchContext getSearchContext()

setSearchContext

public void setSearchContext(SearchContext searchContext)

getReleventSearchers

public List getReleventSearchers()

addParameter

public void addParameter(SearchParameter parameter)

addParameters

public void addParameters(Collection searchParams)

removeParameter

public void removeParameter(SearchParameter parameter)
This method will remove a parameter by name. If the SearchRequest contains any parameters of the type passed in then all instances will be removed.

Parameters:
parameter - the type of parameter to remove.

getParameters

public List getParameters()
Returns all the parameters for the search request as a List of SearchParameter

Returns:
List of SearchParameter

getLuceneParameters

public List getLuceneParameters()

getValues

public List getValues(String paramName)
Returns the values of the first SearchParameter that matches the given name.

Parameters:
paramName - name of a the SearchParameter
Returns:
values for the paramName. Null if no SearchParameter found

getParam

public SearchParameter getParam(String paramName)
Returns the first SearchParameter that matches the given name.

Parameters:
paramName - name of a the SearchParameter
Returns:
Null if no SearchParameter found else the SearchParameter itself

isContainsParam

public boolean isContainsParam(String paramName)
Whether the SR contains this param name

Parameters:
paramName - name of a the SearchParameter
Returns:
true if it exists else false

getQueryString

public String getQueryString()
Returns the encoded query string of the current search request


getQueryStringWithSorts

public String getQueryStringWithSorts()
Returns the encoded query string of the current search request with sort info


getSearchRequestWithSubstitutions

public SearchRequest getSearchRequestWithSubstitutions(List substitutions)
This method will return an new instance of a SearchRequest that will have the same parameters as in this SearchRequest except that any parameters listed in the substitutions list will exist in the new SearchRequest in place of any of the same parameters that may have been in this SearchRequest.

Parameters:
substitutions - a list containing SearchParameter objects that will be inserted into the new SearchRequest object.
Returns:
a new SearchRequest object based off of this SearchRequest but with the substitutions list included.

cloneSearchRequest

public SearchRequest cloneSearchRequest()

getXml

public electric.xml.Document getXml()
Returns the search request as an XML document

Returns:
XML document representation of the search request

addSearchSort

public void addSearchSort(SearchSort searchSort)

getSearchSorts

public Collection getSearchSorts()

setSearchSorts

public void setSearchSorts(Collection searchSorts)

getSearchSortsReverse

public Collection getSearchSortsReverse()

toString

public String toString()

equals

public boolean equals(Object o)

hashCode

public int hashCode()

getSearchFilterGV

public org.ofbiz.core.entity.GenericValue getSearchFilterGV()

getProject

public org.ofbiz.core.entity.GenericValue getProject()

getName

public String getName()

setName

public void setName(String name)

getId

public Long getId()

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getAuthor

public User getAuthor()

setAuthor

public void setAuthor(User author)

getSearchFilterId

public Long getSearchFilterId()

getUser

public String getUser()

setUser

public void setUser(String user)

getGroup

public String getGroup()

setGroup

public void setGroup(String group)

isModified

public boolean isModified()

setModified

public void setModified(boolean modified)

isLoaded

public boolean isLoaded()

setLoaded

public void setLoaded(boolean loaded)

useColumns

public boolean useColumns()

setUseColumns

public void setUseColumns(boolean useColumns)

isOverRideSecurity

public boolean isOverRideSecurity()


Copyright © 2002-2006 Atlassian. All Rights Reserved.