API FinTP REST
 All Classes Namespaces Files Functions Variables
ro.allevo.fintpws.resources.PagedCollection Class Reference
Inheritance diagram for ro.allevo.fintpws.resources.PagedCollection:
ro.allevo.fintpws.resources.EventsResource ro.allevo.fintpws.resources.MessagesResource ro.allevo.fintpws.resources.QueuesResource

Public Member Functions

 PagedCollection (UriInfo uriInfo, Query itemsQuery, Query totalQuery)
 Constructor for PagedCollection. More...
 
List<?> getItems ()
 Method getItems. More...
 
Query getItemsQuery ()
 Method getItemsQuery. More...
 
Query getTotalQuery ()
 Method getTotalQuery. More...
 
void setItemsQuery (Query itemsQuery)
 Method setItemsQuery. More...
 
void setTotalQuery (Query totalQuery)
 Method setTotalQuery. More...
 
boolean hasMore ()
 Method has_more. More...
 
UriInfo getUriInfo ()
 Method getUriInfo. More...
 

Protected Member Functions

void getPage ()
 Method getPage. More...
 
JSONObject asJson () throws JSONException
 Method asJson. More...
 

Private Attributes

int page
 
int pageSize
 
List<?> items
 
Integer total
 
UriInfo uriInfo
 
Query itemsQuery
 
Query totalQuery
 
boolean needsTotal
 
boolean hasMore
 

Static Private Attributes

static Logger logger
 Field logger. More...
 
static final int DEFAULT_PAGE = 1
 Field DEFAULT_PAGE. More...
 
static final int DEFAULT_PAGE_SIZE = 100
 Field DEFAULT_PAGE_SIZE. More...
 
static final int MAX_PAGE_SIZE = 100
 Field MAX_PAGE_SIZE. More...
 

Detailed Description

Author
horia
Version
Revision:
1.0

Constructor & Destructor Documentation

ro.allevo.fintpws.resources.PagedCollection.PagedCollection ( UriInfo  uriInfo,
Query  itemsQuery,
Query  totalQuery 
)
inline

Constructor for PagedCollection.

Parameters
uriInfoUriInfo
queryQuery

Member Function Documentation

JSONObject ro.allevo.fintpws.resources.PagedCollection.asJson ( ) throws JSONException
inlineprotected

Method asJson.

Returns
JSONObject
Exceptions
JSONException
List<?> ro.allevo.fintpws.resources.PagedCollection.getItems ( )
inline

Method getItems.

Returns
List<?>
Query ro.allevo.fintpws.resources.PagedCollection.getItemsQuery ( )
inline

Method getItemsQuery.

Returns
Query
void ro.allevo.fintpws.resources.PagedCollection.getPage ( )
inlineprotected

Method getPage.

Sanitizes the input query string parameters [page] and [page_size] and retrieves the requested page of items from the database page_size is limited to 100 If page is invalid ( not a number, <1 ), the first page is returned If page_size is invalid ( not a number, <0, >100 ), the page size is set to 100

Query ro.allevo.fintpws.resources.PagedCollection.getTotalQuery ( )
inline

Method getTotalQuery.

Returns
Query
UriInfo ro.allevo.fintpws.resources.PagedCollection.getUriInfo ( )
inline

Method getUriInfo.

Returns
UriInfo
boolean ro.allevo.fintpws.resources.PagedCollection.hasMore ( )
inline

Method has_more.

Returns
boolean
void ro.allevo.fintpws.resources.PagedCollection.setItemsQuery ( Query  itemsQuery)
inline

Method setItemsQuery.

Parameters
itemsQueryQuery
void ro.allevo.fintpws.resources.PagedCollection.setTotalQuery ( Query  totalQuery)
inline

Method setTotalQuery.

Parameters
totalQueryQuery

Member Data Documentation

final int ro.allevo.fintpws.resources.PagedCollection.DEFAULT_PAGE = 1
staticprivate

Field DEFAULT_PAGE.

(value is 1)

final int ro.allevo.fintpws.resources.PagedCollection.DEFAULT_PAGE_SIZE = 100
staticprivate

Field DEFAULT_PAGE_SIZE.

(value is 100)

boolean ro.allevo.fintpws.resources.PagedCollection.hasMore
private
List<?> ro.allevo.fintpws.resources.PagedCollection.items
private
Query ro.allevo.fintpws.resources.PagedCollection.itemsQuery
private
Logger ro.allevo.fintpws.resources.PagedCollection.logger
staticprivate
Initial value:
= LogManager.getLogger(PagedCollection.class
.getName())

Field logger.

final int ro.allevo.fintpws.resources.PagedCollection.MAX_PAGE_SIZE = 100
staticprivate

Field MAX_PAGE_SIZE.

(value is 100)

boolean ro.allevo.fintpws.resources.PagedCollection.needsTotal
private
int ro.allevo.fintpws.resources.PagedCollection.page
private
int ro.allevo.fintpws.resources.PagedCollection.pageSize
private
Integer ro.allevo.fintpws.resources.PagedCollection.total
private
Query ro.allevo.fintpws.resources.PagedCollection.totalQuery
private
UriInfo ro.allevo.fintpws.resources.PagedCollection.uriInfo
private

The documentation for this class was generated from the following file: