Interface BatchManager

All Known Implementing Classes:
BatchManagerComponent

public interface BatchManager
Service interface to collect inputs (Blobs) for an operation or operation chain.
Since:
5.4.2
  • Method Details

    • getTransientStore

      @Deprecated TransientStore getTransientStore()
      Deprecated.
      since 10.10, each batch handler has its own transient store
      Returns the TransientStore backing the batches of the default handler.
      Since:
      7.4
    • addStream

      @Deprecated void addStream(String batchId, String index, InputStream is, String name, String mime) throws IOException
      Deprecated.
      Adds an inputStream as a blob to a batch. Will create a new Batch if needed.

      Streams are persisted as temporary files.

      Throws:
      IOException
    • addBlob

      void addBlob(String batchId, String index, Blob blob, String name, String mime) throws IOException
      Adds a blob to a batch. Will create a new Batch if needed.
      Throws:
      IOException
      Since:
      10.1
    • addStream

      @Deprecated void addStream(String batchId, String index, InputStream is, int chunkCount, int chunkIndex, String name, String mime, long fileSize) throws IOException
      Adds an inputStream as a chunk to a batch. Will create a new Batch if needed.

      Streams are persisted as temporary files.

      Throws:
      IOException
      Since:
      7.4
    • addBlob

      void addBlob(String batchId, String index, Blob blob, int chunkCount, int chunkIndex, String name, String mime, long fileSize) throws IOException
      Adds a blob as a chunk to a batch. Will create a new Batch if needed.
      Throws:
      IOException
      Since:
      10.1
    • hasBatch

      boolean hasBatch(String batchId)
      Returns true if there is a batch for the given batchId, false otherwise.
      Since:
      5.7.2
    • getBlobs

      List<Blob> getBlobs(String batchId)
      Gets Blobs associated to a given batch. Returns null if batch does not exist.
    • getBlobs

      List<Blob> getBlobs(String batchId, int timeoutS)
      Gets Blobs associated to a given batch. Returns null if batch does not exist. Waits for upload in progress if needed.
      Since:
      5.7
    • getBlob

      Blob getBlob(String batchId, String fileIndex)
    • getBlob

      Blob getBlob(String batchId, String fileIndex, int timeoutS)
    • getFileEntries

      List<BatchFileEntry> getFileEntries(String batchId)
      Since:
      7.4
    • getFileEntry

      BatchFileEntry getFileEntry(String batchId, String fileIndex)
      Since:
      7.4
    • clean

      void clean(String batchId)
      Cleans up the temporary storage associated to the batch.
    • initBatch

      String initBatch()
      Initializes a batch by with an automatically generated id.
      Returns:
      the batch id
      Since:
      7.4
    • initBatch

      Batch initBatch(String handlerName)
      Initiates a new batch with the given handler.
      Parameters:
      handlerName - the batch handler name
      Returns:
      the newly created batch
      Throws:
      IllegalArgumentException - it the batch handler does not exist
      Since:
      10.1
    • execute

      Object execute(String batchId, String chainOrOperationId, CoreSession session, Map<String,Object> contextParams, Map<String,Object> operationParams)
      Executes the chain or operation on the Blobs from the given batchId.

      This method does not clean the temporary storage associated to the batchId.

      Since:
      5.7
    • execute

      Object execute(String batchId, String fileIndex, String chainOrOperationId, CoreSession session, Map<String,Object> contextParams, Map<String,Object> operationParams)
      Executes the chain or operation on the Blob from the given batchId and fileIndex.

      This method does not clean the temporary storage associated to the batchId.

      Since:
      5.7.2
    • executeAndClean

      Object executeAndClean(String batchId, String chainOrOperationId, CoreSession session, Map<String,Object> contextParams, Map<String,Object> operationParams)
      Executes the chain or operation on the Blobs from the given batchId.

      This method cleans the temporary storage associated to the batchId after the execution.

      Since:
      5.7
    • removeFileEntry

      boolean removeFileEntry(String batchId, String filedIdx)
      Removes a file from a batch.
      Since:
      8.4
    • getBatch

      Batch getBatch(String batchId)
      Fetches information about a batch.
      Parameters:
      batchId - the batch id
      Returns:
      the batch, or null if it doesn't exist
      Since:
      10.1
    • getSupportedHandlers

      Set<String> getSupportedHandlers()
      Returns the supported batch handler names.
      Returns:
      the supported batch handler names
      Since:
      10.1
    • getHandler

      BatchHandler getHandler(String handlerName)
      Gets a batch handler.
      Parameters:
      handlerName - the batch handler name
      Returns:
      the batch handler, or null if it doesn't exist
      Since:
      10.1