Interface BatchManager
-
- All Known Implementing Classes:
BatchManagerComponent
public interface BatchManagerService interface to collect inputs (Blobs) for an operation or operation chain.- Since:
- 5.4.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description voidaddBlob(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.voidaddBlob(String batchId, String index, Blob blob, String name, String mime)Adds a blob to a batch.voidaddStream(String batchId, String index, InputStream is, int chunkCount, int chunkIndex, String name, String mime, long fileSize)Deprecated.since 10.1, useaddBlob(String, String, Blob, int, int, String, String, long)insteadvoidaddStream(String batchId, String index, InputStream is, String name, String mime)Deprecated.since 10.1, useaddBlob(String, String, Blob, String, String)insteadvoidclean(String batchId)Cleans up the temporary storage associated to the batch.Objectexecute(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.Objectexecute(String batchId, String chainOrOperationId, CoreSession session, Map<String,Object> contextParams, Map<String,Object> operationParams)Executes the chain or operation on theBlobsfrom the givenbatchId.ObjectexecuteAndClean(String batchId, String chainOrOperationId, CoreSession session, Map<String,Object> contextParams, Map<String,Object> operationParams)Executes the chain or operation on theBlobsfrom the givenbatchId.BatchgetBatch(String batchId)Fetches information about a batch.BlobgetBlob(String batchId, String fileIndex)BlobgetBlob(String batchId, String fileIndex, int timeoutS)List<Blob>getBlobs(String batchId)Gets Blobs associated to a given batch.List<Blob>getBlobs(String batchId, int timeoutS)Gets Blobs associated to a given batch.List<BatchFileEntry>getFileEntries(String batchId)BatchFileEntrygetFileEntry(String batchId, String fileIndex)BatchHandlergetHandler(String handlerName)Gets a batch handler.Set<String>getSupportedHandlers()Returns the supported batch handler names.TransientStoregetTransientStore()Deprecated.since 10.10, each batch handler has its own transient storebooleanhasBatch(String batchId)Returns true if there is a batch for the givenbatchId, false otherwise.StringinitBatch()Initializes a batch by with an automatically generated id.BatchinitBatch(String handlerName)Initiates a new batch with the given handler.StringinitBatch(String batchId, String contextName)Deprecated.since 7.10, useinitBatch()instead.booleanremoveFileEntry(String batchId, String filedIdx)Removes a file from a batch.
-
-
-
Method Detail
-
getTransientStore
@Deprecated TransientStore 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
void addBlob(String batchId, String index, Blob blob, String name, String mime) throws IOException
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
boolean hasBatch(String batchId)
Returns true if there is a batch for the givenbatchId, 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
-
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
@Deprecated String initBatch(String batchId, String contextName)
Deprecated.since 7.10, useinitBatch()instead.Initializes a batch with a given batchId and Context Name. If batchId is not provided, it will be automatically generated.- Returns:
- the batchId
-
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 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
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
nullif 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
nullif it doesn't exist - Since:
- 10.1
-
-