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 TypeMethodDescriptionvoid
addBlob
(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.void
Adds a blob to a batch.void
addStream
(String batchId, String index, InputStream is, int chunkCount, int chunkIndex, String name, String mime, long fileSize) Deprecated.void
Deprecated.since 10.1, useaddBlob(String, String, Blob, String, String)
insteadvoid
Cleans 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 theBlob
from the givenbatchId
andfileIndex
.execute
(String batchId, String chainOrOperationId, CoreSession session, Map<String, Object> contextParams, Map<String, Object> operationParams) Executes the chain or operation on theBlobs
from the givenbatchId
.executeAndClean
(String batchId, String chainOrOperationId, CoreSession session, Map<String, Object> contextParams, Map<String, Object> operationParams) Executes the chain or operation on theBlobs
from 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 storeboolean
Returns 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.boolean
removeFileEntry
(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 theTransientStore
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.since 10.1, useaddBlob(String, String, Blob, String, String)
insteadAdds an inputStream as a blob to a batch. Will create a newBatch
if needed.Streams are persisted as temporary files.
- Throws:
IOException
-
addBlob
Adds a blob to a batch. Will create a newBatch
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 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 newBatch
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 newBatch
if 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 theBlobs
from 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 theBlob
from the givenbatchId
andfileIndex
.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 theBlobs
from the givenbatchId
.This method cleans the temporary storage associated to the
batchId
after 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
null
if 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
null
if it doesn't exist - Since:
- 10.1
-
addBlob(String, String, Blob, int, int, String, String, long)
instead