|
aerogear-controller 1.0.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.aerogear.controller.router.rest.pagination.AbstractPaginationStrategy
public abstract class AbstractPaginationStrategy
A PaginationStrategy that expects the target endpoint method to take a PaginationInfo as a parameter.
setResponseHeaders(PaginationMetadata, HttpServletResponse, int) to set the HTTP Response
headers.
| Constructor Summary | |
|---|---|
AbstractPaginationStrategy()
|
|
| Method Summary | |
|---|---|
private int |
argAsInt(Map<String,Object> args,
String argName)
|
private PaginationMetadata |
createMetadata(RouteContext routeContext,
PaginationInfo pagingInfo)
|
PaginationInfo |
createPaginationInfo(RouteContext routeContext,
Map<String,Object> args)
Creates a PaginationInfo instance. |
private String |
getResourcePath(RouteContext routeContext)
|
private List<Object> |
merge(PaginationInfo paginationInfo,
Map<String,Object> arguments)
|
Object |
postInvocation(Collection<?> results,
RouteContext routeContext,
PaginationInfo pagingInfo)
Called after the target endpoint method has been invoked and allows the strategy to set HTTP Response headers. |
Object[] |
preInvocation(PaginationInfo paginationInfo,
Map<String,Object> arguments)
Called before the target endpoint method has been invoked and enables a concrete strategy to manipulate the arguments that will be passed to the target endpoint method. |
abstract void |
setResponseHeaders(PaginationMetadata metadata,
javax.servlet.http.HttpServletResponse response,
int resultSize)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractPaginationStrategy()
| Method Detail |
|---|
public abstract void setResponseHeaders(PaginationMetadata metadata,
javax.servlet.http.HttpServletResponse response,
int resultSize)
public PaginationInfo createPaginationInfo(RouteContext routeContext,
Map<String,Object> args)
PaginationStrategy
createPaginationInfo in interface PaginationStrategyrouteContext - the RouteContext of the route being processed.args - the extracted arguments from the current request.
PaginationInfo the information required for paging.
public Object[] preInvocation(PaginationInfo paginationInfo,
Map<String,Object> arguments)
PaginationStrategy
preInvocation in interface PaginationStrategypaginationInfo - the PaginationInfo instance created by this strategy.arguments - the extracted arguments from the current request.
Object[] the arguments that will be passed to the target endpoint method.
private List<Object> merge(PaginationInfo paginationInfo,
Map<String,Object> arguments)
public Object postInvocation(Collection<?> results,
RouteContext routeContext,
PaginationInfo pagingInfo)
PaginationStrategy
postInvocation in interface PaginationStrategyresults - the result returned from the target endpoint method.routeContext - the RouteContext.pagingInfo - the PaginationInfo instance created by this strategy.
Object Either the unchanged result or a modified result depending on the underlying implementation.
private PaginationMetadata createMetadata(RouteContext routeContext,
PaginationInfo pagingInfo)
private String getResourcePath(RouteContext routeContext)
private int argAsInt(Map<String,Object> args,
String argName)
|
aerogear-controller 1.0.1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||