Class CursorResult<C,O>

java.lang.Object
org.nuxeo.ecm.core.api.CursorResult<C,O>
Type Parameters:
C - The cursor type.
O - The cursor item type.
All Implemented Interfaces:
Closeable, AutoCloseable, Iterator<O>
Direct Known Subclasses:
DefaultAuditBackend.SQLAuditCursorResult, ESAuditBackend.ESCursorResult

public class CursorResult<C,O> extends Object implements Iterator<O>, Closeable
A cursor result which holds a DB cursor and additional information to scroll this DB cursor.
Since:
9.1
  • Field Details

    • cursor

      protected C cursor
    • batchSize

      protected final int batchSize
    • keepAliveSeconds

      protected final int keepAliveSeconds
    • lastCallTimestamp

      protected volatile long lastCallTimestamp
  • Constructor Details

    • CursorResult

      public CursorResult(C cursor, int batchSize, int keepAliveSeconds)
  • Method Details

    • getCursor

      public C getCursor()
    • getBatchSize

      public int getBatchSize()
    • touch

      public void touch()
    • timedOut

      public boolean timedOut()
    • hasNext

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

      public O next()
      Specified by:
      next in interface Iterator<C>
    • close

      public void close()
      CAUTION: if your cursor doesn't implement Closeable, we just set the field to null
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable