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 Summary
Modifier and TypeMethodDescriptionvoidaddBlob(String batchId, String index, Blob blob, int chunkCount, int chunkIndex, String name, String mime, long fileSize) Adds a blob as a chunk to a batch.voidAdds a blob to a batch.voidaddStream(String batchId, String index, InputStream is, int chunkCount, int chunkIndex, String name, String mime, long fileSize) Deprecated.voidDeprecated.since 10.1, useaddBlob(String, String, Blob, String, String)insteadvoidCleans up the temporary storage associated to the batch.execute(String batchId, String fileIndex, String chainOrOperationId, CoreSession session, Map<String, Object> contextParams, Map<String, Object> operationParams) Executes the chain or operation on theBlobfrom the givenbatchIdandfileIndex.execute(String batchId, String chainOrOperationId, CoreSession session, Map<String, Object> contextParams, Map<String, Object> operationParams) Executes the chain or operation on theBlobsfrom the givenbatchId.executeAndClean(String batchId, String chainOrOperationId, CoreSession session, Map<String, Object> contextParams, Map<String, Object> operationParams) Executes the chain or operation on theBlobsfrom the givenbatchId.Fetches information about a batch.Gets Blobs associated to a given batch.Gets Blobs associated to a given batch.getFileEntries(String batchId) getFileEntry(String batchId, String fileIndex) getHandler(String handlerName) Gets a batch handler.Returns the supported batch handler names.Deprecated.since 10.10, each batch handler has its own transient storebooleanReturns true if there is a batch for the givenbatchId, false otherwise.Initializes a batch by with an automatically generated id.Initiates a new batch with the given handler.booleanremoveFileEntry(String batchId, String filedIdx) Removes a file from a batch.
-
Method Details
-
getTransientStore
Deprecated.since 10.10, each batch handler has its own transient storeReturns theTransientStorebacking 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.since 10.1, useaddBlob(String, String, Blob, String, String)insteadAdds an inputStream as a blob to a batch. Will create a newBatchif needed.Streams are persisted as temporary files.
- Throws:
IOException
-
addBlob
Adds a blob to a batch. Will create a newBatchif 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 Deprecated.since 10.1, useaddBlob(String, String, Blob, int, int, String, String, long)insteadAdds an inputStream as a chunk to a batch. Will create a newBatchif 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 newBatchif needed.- Throws:
IOException- Since:
- 10.1
-
hasBatch
Returns true if there is a batch for the givenbatchId, false otherwise.- Since:
- 5.7.2
-
getBlobs
Gets Blobs associated to a given batch. Returns null if batch does not exist. -
getBlobs
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
-
getBlob
-
getFileEntries
- Since:
- 7.4
-
getFileEntry
- Since:
- 7.4
-
clean
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
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 theBlobsfrom the givenbatchId.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 theBlobfrom the givenbatchIdandfileIndex.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 theBlobsfrom the givenbatchId.This method cleans the temporary storage associated to the
batchIdafter the execution.- Since:
- 5.7
-
removeFileEntry
Removes a file from a batch.- Since:
- 8.4
-
getBatch
Fetches information about a batch.- Parameters:
batchId- the batch id- Returns:
- the batch, or
nullif it doesn't exist - Since:
- 10.1
-
getSupportedHandlers
Returns the supported batch handler names.- Returns:
- the supported batch handler names
- Since:
- 10.1
-
getHandler
Gets a batch handler.- Parameters:
handlerName- the batch handler name- Returns:
- the batch handler, or
nullif it doesn't exist - Since:
- 10.1
-
addBlob(String, String, Blob, int, int, String, String, long)instead