Class DelegatingCursor<T>

java.lang.Object
org.springframework.data.solr.core.query.result.DelegatingCursor<T>
Type Parameters:
T -
All Implemented Interfaces:
Closeable, AutoCloseable, Iterator<T>, Cursor<T>

public abstract class DelegatingCursor<T> extends Object implements Cursor<T>
DelegatingCursor is a base Cursor implementation that temporarily holds data fetched in one run and delegates iteration.
  • Constructor Details

    • DelegatingCursor

      protected DelegatingCursor(org.apache.solr.client.solrj.SolrQuery query)
    • DelegatingCursor

      protected DelegatingCursor(org.apache.solr.client.solrj.SolrQuery query, String initalCursorMark)
  • Method Details

    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<T>
    • next

      public T next()
      Specified by:
      next in interface Iterator<T>
    • moveNext

      protected T moveNext(Iterator<T> source)
      Move one position next in given source.
      Parameters:
      source -
      Returns:
    • doLoad

      protected abstract DelegatingCursor.PartialResult<T> doLoad(org.apache.solr.client.solrj.SolrQuery nativeQuery)
      Read data from Solr.
      Parameters:
      nativeQuery - The query to execute already positioned at the next cursor mark.
      Returns:
    • open

      public DelegatingCursor<T> open()
      Description copied from interface: Cursor
      Opens the cursor.
      Only Cursor.State.READY cursors can be opened.
      Specified by:
      open in interface Cursor<T>
      Returns:
    • doOpen

      protected void doOpen(@Nullable String cursorMark)
      Customization hook for open().
      Parameters:
      cursorMark -
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • doClose

      protected void doClose()
      Customization hook for clean up operations
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<T>
    • getPosition

      public long getPosition()
      Specified by:
      getPosition in interface Cursor<T>
      Returns:
      the current position starting a zero.
    • getCursorMark

      @Nullable public String getCursorMark()
      Description copied from interface: Cursor
      Get the current set cursorMark
      Specified by:
      getCursorMark in interface Cursor<T>
      Returns:
    • isReady

      public boolean isReady()
      Returns:
      true if Cursor.State.REDAY
    • isOpen

      public boolean isOpen()
      Specified by:
      isOpen in interface Cursor<T>
      Returns:
      true if Cursor.State.OPEN
    • isFinished

      public boolean isFinished()
      Returns:
      true if Cursor.State.FINISHED
    • isClosed

      public boolean isClosed()
      Specified by:
      isClosed in interface Cursor<T>
      Returns:
      true if Cursor.State.CLOSED