Package net.solarnetwork.central.support
Interface FilteredResultsProcessor<R>
- Type Parameters:
R- the result item type
- All Superinterfaces:
AutoCloseable,Closeable,Flushable
- All Known Implementing Classes:
AbstractFilteredResultsProcessor,CsvFilteredResultsProcessor,ObjectMapperFilteredResultsProcessor
API for a service that can directly handle filtered results, in a streaming
fashion.
- Since:
- 1.2
-
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.util.MimeTypeGet the MIME type generated by this processor.voidhandleResultItem(R resultItem) Process a result item.voidstart(Long totalResultCount, Integer startingOffset, Integer expectedResultCount, Map<String, ?> attributes) Called at the start of the export process, to initialize any necessary resources or write any header information.
-
Method Details
-
getMimeType
org.springframework.util.MimeType getMimeType()Get the MIME type generated by this processor.- Returns:
- the media type
-
start
void start(Long totalResultCount, Integer startingOffset, Integer expectedResultCount, Map<String, ?> attributes) throws IOExceptionCalled at the start of the export process, to initialize any necessary resources or write any header information.- Parameters:
totalResultCount- the total number of results that match the given query, or null if the count is not knownstartingOffset- a starting offset within the total result count, or null if not knownexpectedResultCount- the expected number of results to be returned tohandleResultItem(Object)attributes- optional implementation-specific attributes to pass to the processor- Throws:
IOException- if an IO error occurs
-
handleResultItem
Process a result item.This method should only be called after
has been called.invalid reference
#start(Long, Integer, Integer)- Parameters:
resultItem- the result item to process- Throws:
IOException- if an IO error occurs
-