Package org.nuxeo.ecm.core.api
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 Summary
Fields Modifier and Type Field Description protected int
batchSize
protected C
cursor
protected int
keepAliveSeconds
protected long
lastCallTimestamp
-
Constructor Summary
Constructors Constructor Description CursorResult(C cursor, int batchSize, int keepAliveSeconds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
CAUTION: if your cursor doesn't implementCloseable
, we just set the field to nullint
getBatchSize()
C
getCursor()
boolean
hasNext()
O
next()
boolean
timedOut()
void
touch()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Field Detail
-
cursor
protected C cursor
-
batchSize
protected final int batchSize
-
keepAliveSeconds
protected final int keepAliveSeconds
-
lastCallTimestamp
protected volatile long lastCallTimestamp
-
-
Constructor Detail
-
CursorResult
public CursorResult(C cursor, int batchSize, int keepAliveSeconds)
-
-
Method Detail
-
getCursor
public C getCursor()
-
getBatchSize
public int getBatchSize()
-
touch
public void touch()
-
timedOut
public boolean timedOut()
-
close
public void close()
CAUTION: if your cursor doesn't implementCloseable
, we just set the field to null- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
-