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
 
 public class CursorService<C,O,R> extends Object A low level holder of DB cursors that manages cleaning on timeout.- Since:
- 9.1
 
- 
- 
Field SummaryFields Modifier and Type Field Description protected Map<String,CursorResult<C,O>>cursorResultsprotected Function<O,R>extractor
 - 
Constructor SummaryConstructors Constructor Description CursorService(Function<O,R> extractor)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckForTimedOutScroll()voidclear()Clear and close all cursors owned by this service.protected booleanisScrollTimedOut(String scrollId, CursorResult<C,O> cursorResult)StringregisterCursor(C cursor, int batchSize, int keepAliveSeconds)Registers the inputCursorServiceand generates a newscrollIdto associate with.StringregisterCursor(String scrollId, C cursor, int batchSize, int keepAliveSeconds)Registers the inputCursorServiceassociated to the inputscrollId.StringregisterCursorResult(String scrollId, CursorResult<C,O> cursorResult)Registers the inputCursorResultassociated to the inputscrollId.StringregisterCursorResult(CursorResult<C,O> cursorResult)Registers the inputCursorResultand generates a newscrollIdto associate with.ScrollResult<R>scroll(String scrollId)booleanunregisterCursor(String scrollId)Unregisters cursor associated to the inputscrollId.
 
- 
- 
- 
Method Detail- 
checkForTimedOutScrollpublic void checkForTimedOutScroll() 
 - 
isScrollTimedOutprotected boolean isScrollTimedOut(String scrollId, CursorResult<C,O> cursorResult) 
 - 
registerCursorpublic String registerCursor(C cursor, int batchSize, int keepAliveSeconds) Registers the inputCursorServiceand generates a newscrollIdto associate with.- Returns:
- the scrollId associated to the cursor.
 
 - 
registerCursorpublic String registerCursor(String scrollId, C cursor, int batchSize, int keepAliveSeconds) Registers the inputCursorServiceassociated to the inputscrollId.- Returns:
- the scrollId associated to the cursor.
 
 - 
registerCursorResultpublic String registerCursorResult(CursorResult<C,O> cursorResult) Registers the inputCursorResultand generates a newscrollIdto associate with.- Returns:
- the scrollId associated to the cursor result.
 
 - 
registerCursorResultpublic String registerCursorResult(String scrollId, CursorResult<C,O> cursorResult) Registers the inputCursorResultassociated to the inputscrollId.- Returns:
- the scrollId associated to the cursor result.
 
 - 
unregisterCursorpublic boolean unregisterCursor(String scrollId) Unregisters cursor associated to the inputscrollId.- Parameters:
- scrollId- The scoll id of- CursorResultto unregister
- Returns:
- Whether or not the cursor was unregistered.
 
 - 
scrollpublic ScrollResult<R> scroll(String scrollId) - Returns:
- the next batch of cursor associated to the input scrollId
 
 - 
clearpublic void clear() Clear and close all cursors owned by this service.
 
- 
 
-