Interface FilteredResultsProcessor<R>

Type Parameters:
R - the result item type
All Superinterfaces:
AutoCloseable, Closeable, Flushable
All Known Implementing Classes:
AbstractFilteredResultsProcessor, CsvFilteredResultsProcessor, ObjectMapperFilteredResultsProcessor

public interface FilteredResultsProcessor<R> extends Closeable, Flushable
API for a service that can directly handle filtered results, in a streaming fashion.
Since:
1.2
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.util.MimeType
    Get the MIME type generated by this processor.
    void
    handleResultItem(R resultItem)
    Process a result item.
    void
    start(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 interface java.io.Closeable

    close

    Methods inherited from interface java.io.Flushable

    flush
  • 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 IOException
      Called 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 known
      startingOffset - a starting offset within the total result count, or null if not known
      expectedResultCount - the expected number of results to be returned to handleResultItem(Object)
      attributes - optional implementation-specific attributes to pass to the processor
      Throws:
      IOException - if an IO error occurs
    • handleResultItem

      void handleResultItem(R resultItem) throws IOException
      Process a result item.

      This method should only be called after

      invalid reference
      #start(Long, Integer, Integer)
      has been called.

      Parameters:
      resultItem - the result item to process
      Throws:
      IOException - if an IO error occurs