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>
DelegatingCursor is a base Cursor implementation that temporarily holds data fetched in one run and
delegates iteration.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDelegatingCursor.PartialResultprovided by a round trip to SolrClient loading data for an iteration.Nested classes/interfaces inherited from interface org.springframework.data.solr.core.query.result.Cursor
Cursor.State -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDelegatingCursor(org.apache.solr.client.solrj.SolrQuery query) protectedDelegatingCursor(org.apache.solr.client.solrj.SolrQuery query, String initalCursorMark) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()protected voiddoClose()Customization hook for clean up operationsprotected abstract DelegatingCursor.PartialResult<T>doLoad(org.apache.solr.client.solrj.SolrQuery nativeQuery) Read data from Solr.protected voidCustomization hook foropen().Get the current set cursorMarklongbooleanhasNext()booleanisClosed()booleanbooleanisOpen()booleanisReady()protected TMove one position next in given source.next()open()Opens the cursor.voidremove()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
DelegatingCursor
protected DelegatingCursor(org.apache.solr.client.solrj.SolrQuery query) -
DelegatingCursor
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
moveNext
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
Description copied from interface:CursorOpens the cursor.
OnlyCursor.State.READYcursors can be opened. -
doOpen
Customization hook foropen().- Parameters:
cursorMark-
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
doClose
protected void doClose()Customization hook for clean up operations -
remove
public void remove() -
getPosition
public long getPosition()- Specified by:
getPositionin interfaceCursor<T>- Returns:
- the current position starting a zero.
-
getCursorMark
Description copied from interface:CursorGet the current set cursorMark- Specified by:
getCursorMarkin interfaceCursor<T>- Returns:
-
isReady
public boolean isReady()- Returns:
- true if
Cursor.State.REDAY
-
isOpen
public boolean isOpen()- Specified by:
isOpenin interfaceCursor<T>- Returns:
- true if
Cursor.State.OPEN
-
isFinished
public boolean isFinished()- Returns:
- true if
Cursor.State.FINISHED
-
isClosed
public boolean isClosed()- Specified by:
isClosedin interfaceCursor<T>- Returns:
- true if
Cursor.State.CLOSED
-