Interface ImportBatchHandler

All Known Implementing Classes:
AbstractImportBatchHandler

public interface ImportBatchHandler
The main extension point for responding to a batch coming in from import services. These handlers are ordered and injected into the BatchListener which is the one that receives an event. In the case of multiple registered handlers, the first one that says it can handle the batch will be the one that handles it
Author:
Phillip Verheyden (phillipuniverse)
  • Method Details

    • canHandle

      boolean canHandle(BatchRequest batch)
      Whether or not this handler can actually deal with the given batch. Checks will generally be based on BatchRequest.getType().
      Parameters:
      batch -
      Returns:
      whether or not this handler can actually handle the given batch
    • initializeContextForBatch

      default void initializeContextForBatch(BatchRequest batch)
      Handles initializing some context state before handling this batch. This could include setting up the CurrencyContext, a base ContextInfo to be used for various persistent and de/serialization operations later on, or other relevant state.

      NOTE: This is called by BatchListener before handle(BatchRequest) is called.
      Parameters:
      batch - The batch to be processed.
    • finalizeContextForBatch

      default void finalizeContextForBatch(BatchRequest batch)
    • handle

      Handle the batch and emit completions for all items within the batch.
      Parameters:
      batch - a batch of records that this handler should deal with
      Returns:
      the result of handling a batch
    • getDataRouteKey

      String getDataRouteKey()
      The data route key that is relevant to the import process
      Returns:
      The data route key that is relevant to the import process