Package net.solarnetwork.central.support
Class AbstractFilteredResultsProcessor<R>
java.lang.Object
net.solarnetwork.central.support.AbstractFilteredResultsProcessor<R>
- Type Parameters:
R- the result item type
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable,FilteredResultsProcessor<R>
- Direct Known Subclasses:
CsvFilteredResultsProcessor,ObjectMapperFilteredResultsProcessor
public abstract class AbstractFilteredResultsProcessor<R>
extends Object
implements FilteredResultsProcessor<R>
Abstract convenience implementation of
FilteredResultsProcessor.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()voidflush()org.springframework.util.MimeTypeGet the MIME type generated by this processor.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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.solarnetwork.central.support.FilteredResultsProcessor
handleResultItem
-
Constructor Details
-
AbstractFilteredResultsProcessor
public AbstractFilteredResultsProcessor()
-
-
Method Details
-
flush
- Specified by:
flushin interfaceFlushable- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
getMimeType
public org.springframework.util.MimeType getMimeType()Description copied from interface:FilteredResultsProcessorGet the MIME type generated by this processor.- Specified by:
getMimeTypein interfaceFilteredResultsProcessor<R>- Returns:
- the media type
-
start
public void start(Long totalResultCount, Integer startingOffset, Integer expectedResultCount, Map<String, ?> attributes) throws IOExceptionDescription copied from interface:FilteredResultsProcessorCalled at the start of the export process, to initialize any necessary resources or write any header information.- Specified by:
startin interfaceFilteredResultsProcessor<R>- 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 toFilteredResultsProcessor.handleResultItem(Object)attributes- optional implementation-specific attributes to pass to the processor- Throws:
IOException- if an IO error occurs
-