Class PagingRequest


  • @AlfrescoPublicApi
    public class PagingRequest
    extends java.lang.Object
    Simple wrapper for single page request (with optional request for total count up to a given max)
    Since:
    4.0
    Author:
    janv
    • Constructor Summary

      Constructors 
      Constructor Description
      PagingRequest​(int maxItems)
      Construct a page request
      PagingRequest​(int skipCount, int maxItems)
      Construct a page request
      PagingRequest​(int skipCount, int maxItems, java.lang.String queryExecutionId)
      Construct a page request
      PagingRequest​(int maxItems, java.lang.String queryExecutionId)
      Construct a page request
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getMaxItems()
      Size of the page - if skip count is 0 then return up to max items.
      java.lang.String getQueryExecutionId()
      Get a unique ID associated with these query results.
      int getRequestTotalCountMax()
      Get requested total count (up to a given maximum).
      int getSkipCount()
      Results to skip before retrieving the page.
      protected void setMaxItems​(int maxItems)
      Change the size of the page.
      protected void setQueryExecutionId​(java.lang.String queryExecutionId)
      Change the unique query ID for the results.
      void setRequestTotalCountMax​(int requestTotalCountMax)
      Set request total count (up to a given maximum).
      protected void setSkipCount​(int skipCount)
      Change the skip count.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PagingRequest

        public PagingRequest​(int maxItems)
        Construct a page request
        Parameters:
        maxItems - the maximum number of items per page
      • PagingRequest

        public PagingRequest​(int skipCount,
                             int maxItems)
        Construct a page request
        Parameters:
        maxItems - the maximum number of items per page
        skipCount - the number of items to skip before the first page
      • PagingRequest

        public PagingRequest​(int maxItems,
                             java.lang.String queryExecutionId)
        Construct a page request
        Parameters:
        maxItems - the maximum number of items per page
        queryExecutionId - a query execution ID associated with ealier paged requests
      • PagingRequest

        public PagingRequest​(int skipCount,
                             int maxItems,
                             java.lang.String queryExecutionId)
        Construct a page request
        Parameters:
        skipCount - the number of items to skip before the first page
        maxItems - the maximum number of items per page
        queryExecutionId - a query execution ID associated with ealier paged requests
    • Method Detail

      • getSkipCount

        public int getSkipCount()
        Results to skip before retrieving the page. Usually a multiple of page size (ie. page size * num pages to skip). Default is 0.
        Returns:
        the number of results to skip before the page
      • setSkipCount

        protected void setSkipCount​(int skipCount)
        Change the skip count. Must be called before the paging query is run.
      • getMaxItems

        public int getMaxItems()
        Size of the page - if skip count is 0 then return up to max items.
        Returns:
        the maximum size of the page
      • setMaxItems

        protected void setMaxItems​(int maxItems)
        Change the size of the page. Must be called before the paging query is run.
      • getRequestTotalCountMax

        public int getRequestTotalCountMax()
        Get requested total count (up to a given maximum).
      • setRequestTotalCountMax

        public void setRequestTotalCountMax​(int requestTotalCountMax)
        Set request total count (up to a given maximum). Default is 0 => do not request total count (which allows possible query optimisation).
        Parameters:
        requestTotalCountMax -
      • getQueryExecutionId

        public java.lang.String getQueryExecutionId()
        Get a unique ID associated with these query results. This must be available before and after execution i.e. it must depend on the type of query and the query parameters rather than the execution results. Client has the option to pass this back as a hint when paging.
        Returns:
        a unique ID associated with the query execution results
      • setQueryExecutionId

        protected void setQueryExecutionId​(java.lang.String queryExecutionId)
        Change the unique query ID for the results. Must be called before the paging query is run.