aerogear-controller 1.0.2

org.jboss.aerogear.controller.router.rest.pagination
Interface PaginationStrategy

All Known Implementing Classes:
AbstractPaginationStrategy

public interface PaginationStrategy

A strategy for implementing pagination in AeroGear Controller.


Method Summary
 PaginationInfo createPaginationInfo(RouteContext routeContext, Map<String,Object> arguments)
          Creates a PaginationInfo instance.
 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 pagingInfo, 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.
 

Method Detail

createPaginationInfo

PaginationInfo createPaginationInfo(RouteContext routeContext,
                                    Map<String,Object> arguments)
Creates a PaginationInfo instance. How this information is gathered, be it from an Annotation on the target endpoint method, or by using separate request parameters is up to the concrete implementation.

Parameters:
routeContext - the RouteContext of the route being processed.
arguments - the extracted arguments from the current request.
Returns:
PaginationInfo the information required for paging.

preInvocation

Object[] preInvocation(PaginationInfo pagingInfo,
                       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.

Parameters:
pagingInfo - the PaginationInfo instance created by this strategy.
arguments - the extracted arguments from the current request.
Returns:
Object[] the arguments that will be passed to the target endpoint method.

postInvocation

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.

Parameters:
results - the result returned from the target endpoint method.
routeContext - the RouteContext.
pagingInfo - the PaginationInfo instance created by this strategy.
Returns:
Object Either the unchanged result or a modified result depending on the underlying implementation.

aerogear-controller 1.0.2

Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.