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
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
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
addBlob(String batchId, String index, Blob blob, String name, String mime)
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.since 10.1, useaddBlob(String, String, Blob, int, int, String, String, long)
insteadvoid
addStream(String batchId, String index, InputStream is, String name, String mime)
Deprecated.since 10.1, useaddBlob(String, String, Blob, String, String)
insteadvoid
clean(String batchId)
Cleans up the temporary storage associated to the batch.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
.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
.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
.Batch
getBatch(String batchId)
Fetches information about a batch.Blob
getBlob(String batchId, String fileIndex)
Blob
getBlob(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)
BatchFileEntry
getFileEntry(String batchId, String fileIndex)
BatchHandler
getHandler(String handlerName)
Gets a batch handler.Set<String>
getSupportedHandlers()
Returns the supported batch handler names.TransientStore
getTransientStore()
Deprecated.since 10.10, each batch handler has its own transient storeboolean
hasBatch(String batchId)
Returns true if there is a batch for the givenbatchId
, false otherwise.String
initBatch()
Initializes a batch by with an automatically generated id.Batch
initBatch(String handlerName)
Initiates a new batch with the given handler.String
initBatch(String batchId, String contextName)
Deprecated.since 7.10, useinitBatch()
instead.boolean
removeFileEntry(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 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
void addBlob(String batchId, String index, Blob blob, String name, String mime) throws IOException
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
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 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
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
-
-