Package org.nuxeo.ecm.core.api
Class CursorService<C,O,R>
java.lang.Object
org.nuxeo.ecm.core.api.CursorService<C,O,R>
- Type Parameters:
C
- The cursor type.O
- The cursor item type.R
- The result type.
- Direct Known Subclasses:
MongoDBCursorService
A low level holder of DB cursors that manages cleaning on timeout.
- Since:
- 9.1
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
void
clear()
Clear and close all cursors owned by this service.protected boolean
isScrollTimedOut
(String scrollId, CursorResult<C, O> cursorResult) registerCursor
(C cursor, int batchSize, int keepAliveSeconds) Registers the inputCursorService
and generates a newscrollId
to associate with.registerCursor
(String scrollId, C cursor, int batchSize, int keepAliveSeconds) Registers the inputCursorService
associated to the inputscrollId
.registerCursorResult
(String scrollId, CursorResult<C, O> cursorResult) Registers the inputCursorResult
associated to the inputscrollId
.registerCursorResult
(CursorResult<C, O> cursorResult) Registers the inputCursorResult
and generates a newscrollId
to associate with.boolean
unregisterCursor
(String scrollId) Unregisters cursor associated to the inputscrollId
.
-
Field Details
-
cursorResults
-
extractor
-
-
Constructor Details
-
CursorService
-
-
Method Details
-
checkForTimedOutScroll
public void checkForTimedOutScroll() -
isScrollTimedOut
-
registerCursor
Registers the inputCursorService
and generates a newscrollId
to associate with.- Returns:
- the scrollId associated to the cursor.
-
registerCursor
Registers the inputCursorService
associated to the inputscrollId
.- Returns:
- the scrollId associated to the cursor.
-
registerCursorResult
Registers the inputCursorResult
and generates a newscrollId
to associate with.- Returns:
- the scrollId associated to the cursor result.
-
registerCursorResult
Registers the inputCursorResult
associated to the inputscrollId
.- Returns:
- the scrollId associated to the cursor result.
-
unregisterCursor
Unregisters cursor associated to the inputscrollId
.- Parameters:
scrollId
- The scoll id ofCursorResult
to unregister- Returns:
- Whether or not the cursor was unregistered.
-
scroll
- Returns:
- the next batch of cursor associated to the input
scrollId
-
clear
public void clear()Clear and close all cursors owned by this service.
-