public class ListingRequest
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
protected boolean |
mCalculateTotalAvailable
If true, calculates the total number of items before ranging.
|
protected QueryOptions |
mQueryOptions
The query options.
|
Constructor and Description |
---|
ListingRequest()
Constructs an instanceof ListingRequest
|
ListingRequest(QueryOptions pQueryOptions)
Construct listing request from query options.
|
Modifier and Type | Method and Description |
---|---|
Query |
andQueryWithBaseQuery(Query pQuery,
RepositoryView pView,
java.lang.String pIdAlias)
And the specified query with any base query that will be created based on
the previously parsed query params used to generate this ListingRequest.
|
Query |
createAfterQuery(RepositoryView pView,
java.lang.String pIdAlias)
Create the after query.
|
java.util.List<Query> |
createBaseQueryList(RepositoryView pView,
java.lang.String pIdAlias)
Create our base query.
|
Query |
createQueryFromRql(RepositoryView pView)
Return the Query from the RQL statement.
|
java.lang.String |
getAfter()
Returns property after.
|
int |
getEndingIndex()
Gets the ending index
|
int |
getLimit()
Returns the limit valued passed in via query parameters.
|
QueryOptions |
getQueryOptions()
Repository Query options for this request
|
protected RepositoryPropertyDescriptor |
getRepositoryIdPropertyDescriptor(RepositoryItemDescriptor pItemDesc)
Return the string name of the repository id.
|
RqlStatement |
getRqlStatement()
Returns property rqlStatement.
|
java.lang.String |
getRqlString()
Returns property rqlString.
|
SortDirectives |
getSort()
Gets the sort directives for this list
|
int |
getStartingIndex()
Gets the starting index
|
boolean |
isCalculateTotalAvailable() |
boolean |
isExpanded()
Returns property expanded.
|
boolean |
isGetForUpdate()
Returns property getForUpdate.
|
boolean |
isIncludeRqlInQueryGeneration()
Returns property includeRqlInQueryGeneration.
|
void |
range(int pStartingIndex,
int pEndingIndex)
Sets the range for this ListingRequest instance.
|
void |
setAfter(java.lang.String pAfter)
Sets property after.
|
void |
setCalculateTotalAvailable(boolean pCalculateTotalAvailable)
Sets total number of items available in the set of items available for the
criteria that created this list
|
void |
setEndingIndex(int pEndingIndex)
Sets the ending index
|
void |
setExpanded(boolean pExpanded)
Sets property expanded.
|
void |
setGetForUpdate(boolean pGetForUpdate)
Sets property getForUpdate.
|
void |
setIncludeRqlInQueryGeneration(boolean pIncludeRqlInQueryGeneration)
Sets property includeRqlInQueryGeneration.
|
void |
setLimit(int pLimit)
Sets the limit value passed in via query parameters
|
void |
setRqlStatement(RqlStatement pRqlStatement)
Sets property rqlStatement.
|
void |
setRqlString(java.lang.String pRqlString)
Sets property rqlString.
|
void |
setSort(SortDirectives pSortDirectives)
Sets the sort directives for this list
|
void |
setStartingIndex(int pStartingIndex)
Sets the starting index
|
java.lang.String |
toString() |
public static final java.lang.String CLASS_VERSION
protected QueryOptions mQueryOptions
protected boolean mCalculateTotalAvailable
public ListingRequest()
public ListingRequest(QueryOptions pQueryOptions)
pQueryOptions
- the query options.public int getLimit()
public void setLimit(int pLimit)
pLimit
- the limit to setpublic void setCalculateTotalAvailable(boolean pCalculateTotalAvailable)
pCalculateTotalAvailable
- total number of items availablepublic boolean isCalculateTotalAvailable()
public void setStartingIndex(int pStartingIndex)
pStartingIndex
- the starting index of the set of items in this list (inclusive)public int getStartingIndex()
public void setEndingIndex(int pEndingIndex)
pEndingIndex
- the ending index of the set of items in this list (exclusive)public int getEndingIndex()
public void setSort(SortDirectives pSortDirectives)
pSortDirectives
- the sort directives for this listpublic SortDirectives getSort()
public QueryOptions getQueryOptions()
public void setAfter(java.lang.String pAfter)
pAfter
- the value in the sort order that returned items should
be after.public java.lang.String getAfter()
public void setRqlString(java.lang.String pRqlString)
pRqlString
- the RQL query string.public java.lang.String getRqlString()
public void setIncludeRqlInQueryGeneration(boolean pIncludeRqlInQueryGeneration)
pIncludeRqlInQueryGeneration
- true if RqlString should be used.public boolean isIncludeRqlInQueryGeneration()
public void setExpanded(boolean pExpanded)
pExpanded
- true if listing is to be expanded.public boolean isExpanded()
public void setGetForUpdate(boolean pGetForUpdate)
pGetForUpdate
- true if GET output will be used as input for a PATCHpublic boolean isGetForUpdate()
public void setRqlStatement(RqlStatement pRqlStatement)
pRqlStatement
- the RQL statementpublic RqlStatement getRqlStatement() throws javax.servlet.ServletException
javax.servlet.ServletException
- if the defined RQL statement cannot be parsed.public void range(int pStartingIndex, int pEndingIndex)
pStartingIndex
- the starting index (inclusive)pEndingIndex
- the ending index (exclusive)public Query andQueryWithBaseQuery(Query pQuery, RepositoryView pView, java.lang.String pIdAlias) throws javax.servlet.ServletException
pQuery
- the query to and with the base query (if any). May be null.pView
- the view to create the after query from.pIdAlias
- an additional alias for the ID property, other than it's
repository property name. May be null.javax.servlet.ServletException
- should a failure happen interacting with repository.public java.util.List<Query> createBaseQueryList(RepositoryView pView, java.lang.String pIdAlias) throws javax.servlet.ServletException, RepositoryException
pView
- the view to create the after query from.pIdAlias
- an additional alias for the ID property, other than it's
repository property name. May be null.RepositoryException
- if error occurs interacting with repository.javax.servlet.ServletException
- if property specified for the sort is restricted or invalid.public Query createAfterQuery(RepositoryView pView, java.lang.String pIdAlias) throws javax.servlet.ServletException, RepositoryException
pView
- the view to create the after query from.pIdAlias
- an additional alias for the ID property, other than it's
repository property name. May be null.RepositoryException
- if error occurs interacting with repository.javax.servlet.ServletException
- if property specified for the sort is restricted or invalid.public Query createQueryFromRql(RepositoryView pView) throws javax.servlet.ServletException, RepositoryException
pView
- the view that that query should queryRepositoryException
- if error occurs interacting with repository.javax.servlet.ServletException
- if property specified for the sort is restricted or invalid.protected RepositoryPropertyDescriptor getRepositoryIdPropertyDescriptor(RepositoryItemDescriptor pItemDesc)
pItemDesc
- The item descriptor to query.public java.lang.String toString()
toString
in class java.lang.Object