Class PagedQueryIterator

java.lang.Object
org.apache.sling.resourceresolver.impl.mapping.PagedQueryIterator
All Implemented Interfaces:
Iterator<org.apache.sling.api.resource.Resource>

public class PagedQueryIterator extends Object implements Iterator<org.apache.sling.api.resource.Resource>
Utility class for running paged queries.
  • Constructor Details

    • PagedQueryIterator

      public PagedQueryIterator(String subject, String propertyName, org.apache.sling.api.resource.ResourceResolver resolver, String query, int pageSize)
      Parameters:
      subject - name of the query, will be used only for logging
      propertyName - name of multivalued string property to query on (used for diagnostics)
      resolver - resource resolver
      query - query string in SQL2 syntax
      pageSize - page size (start a new query after page size is exceeded)
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<org.apache.sling.api.resource.Resource>
    • next

      public org.apache.sling.api.resource.Resource next() throws NoSuchElementException
      Specified by:
      next in interface Iterator<org.apache.sling.api.resource.Resource>
      Throws:
      NoSuchElementException
    • getStatistics

      @NotNull public @NotNull String getStatistics()
    • getWarning

      @NotNull public @NotNull String getWarning()