|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gcube.opensearch.opensearchoperator.Pager
public class Pager
A pager class that will be used to handle search query paging
Constructor Summary | |
---|---|
Pager(int numOfResults,
int itemsPerPage,
java.lang.String resourceName,
int clientStartPage,
int clientStartIndex,
int clientCount)
Creates a new Pages |
Method Summary | |
---|---|
int |
getCurrentPageResultCount()
Returns the number of results in the current page |
int |
getCurrPage()
Returns the current page number |
java.net.URL |
getPageQuery()
Returns a query for the current page of search results using a query builder among the ones available |
QueryBuilder |
getQueryBuilder()
Returns the query builder used to construct queries |
int |
getTotalResultCount()
Returns the number of results obtained so far |
boolean |
hasNext()
Determines whether there exist more results available in a next page |
void |
next(OpenSearchResponse response,
int resultsRetrieved)
Advances the current page by one |
void |
setContext(java.util.List<QueryBuilder> queryBuilders,
java.lang.String MIMEType)
Provides the pager with a list of query builders to be used and the type of the search results that the provider returns |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Pager(int numOfResults, int itemsPerPage, java.lang.String resourceName, int clientStartPage, int clientStartIndex, int clientCount)
numOfResults
- The total number of results that should be obtaineditemsPerPage
- The items to request per pageresourceName
- The name of the OpenSearch provider that is being queriedclientStartPage
- The start page requested by the client which invoked the OpenSearchOp
, as present in its queryclientStartIndex
- The start index requested by the client which invoked the OpenSearchOp
, as present in its queryclientCount
- The result count requested by the client which invoked the OpenSearchOp
, as present in its queryMethod Detail |
---|
public void setContext(java.util.List<QueryBuilder> queryBuilders, java.lang.String MIMEType)
queryBuilders
- The query builders to useMIMEType
- The MIME type of the search results that the provider returnspublic java.net.URL getPageQuery() throws java.lang.Exception
java.lang.Exception
- If an error occurred while formulating a query, if the context is not set or in case of other errorpublic void next(OpenSearchResponse response, int resultsRetrieved)
response
- The search response for the current page, potentially including OpenSearch response attributesresultsRetrieved
- The number of results retrieved in the current pagepublic boolean hasNext()
public int getTotalResultCount()
public int getCurrentPageResultCount()
public QueryBuilder getQueryBuilder()
public int getCurrPage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |