@Override
  public PageRequest getPageRequest() {

    String pageSize = m_uriInfo.getQueryParameters().getFirst(QueryLexer.QUERY_PAGE_SIZE);
    String from     = m_uriInfo.getQueryParameters().getFirst(QueryLexer.QUERY_FROM);
    String to       = m_uriInfo.getQueryParameters().getFirst(QueryLexer.QUERY_TO);

    if (pageSize == null && from == null && to == null) {
      return null;
    }

    int offset = 0;
    PageRequest.StartingPoint startingPoint;

    // TODO : support other starting points
    if (from != null) {
      if(from.equals("start")) {
        startingPoint = PageRequest.StartingPoint.Beginning;
      } else {
        offset = Integer.parseInt(from);
        startingPoint = PageRequest.StartingPoint.OffsetStart;
      }
    } else if (to != null ) {
      if (to.equals("end")) {
        startingPoint = PageRequest.StartingPoint.End;
      } else {
        offset = Integer.parseInt(to);
        startingPoint = PageRequest.StartingPoint.OffsetEnd;
      }
    } else {
      startingPoint = PageRequest.StartingPoint.Beginning;
    }

    // TODO : support predicate and comparator
    return new PageRequestImpl(startingPoint,
        pageSize == null ? DEFAULT_PAGE_SIZE : Integer.parseInt(pageSize), offset, null, null);
  }
Constructor.

@param headers           http headers
@param body              http body
@param uriInfo           uri information
@param resource          associated resource definition
ambari-server/src/main/java/org/apache/ambari/server/api/services/BaseRequest.java