public class BatchManagerComponent extends DefaultComponent implements BatchManager
BatchManager service with the TransientStore.| Modifier and Type | Field and Description | 
|---|---|
static String | 
CLIENT_BATCH_ID_FLAG  | 
static String | 
DEFAULT_BATCH_HANDLER
The default batch handler name. 
 | 
protected Map<String,BatchHandler> | 
handlers  | 
protected AtomicInteger | 
uploadInProgress  | 
static String | 
XP_BATCH_HANDLER  | 
lastModified, name| Constructor and Description | 
|---|
BatchManagerComponent()  | 
| Modifier and Type | Method and 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)
Adds an inputStream as a chunk to a batch. 
 | 
void | 
addStream(String batchId,
         String index,
         InputStream is,
         String name,
         String mime)
Adds an inputStream as a blob to a batch. 
 | 
void | 
clean(String batchId)
Cleans up the temporary storage associated to the batch. 
 | 
protected Object | 
execute(Object blobInput,
       String chainOrOperationId,
       CoreSession session,
       Map<String,Object> contextParams,
       Map<String,Object> operationParams)  | 
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. | 
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. | 
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. | 
Batch | 
getBatch(String batchId)
Fetches information about a batch. 
 | 
protected Blob | 
getBatchBlob(String batchId,
            String fileIndex)  | 
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.  
 | 
protected int | 
getUploadWaitTimeout()  | 
boolean | 
hasBatch(String batchId)
Returns true if there is a batch for the given  
batchId, 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.  
 | 
protected Batch | 
initBatchInternal(String batchId)  | 
boolean | 
removeFileEntry(String batchId,
               String filedIdx)
Removes a file from a batch. 
 | 
void | 
start(ComponentContext context)
Start the component. 
 | 
void | 
stop(ComponentContext context)
Stop the component. 
 | 
activate, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerContribution, registerExtension, setLastModified, setModifiedNow, setName, unregister, unregisterContribution, unregisterExtensionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitapplicationStarted, getApplicationStartedOrderpublic static final String CLIENT_BATCH_ID_FLAG
public static final String DEFAULT_BATCH_HANDLER
public static final String XP_BATCH_HANDLER
protected Map<String,BatchHandler> handlers
protected final AtomicInteger uploadInProgress
public BatchManagerComponent()
public void start(ComponentContext context)
Componentstart in interface Componentstart in class DefaultComponentpublic void stop(ComponentContext context) throws InterruptedException
Componentstop in interface Componentstop in class DefaultComponentInterruptedException@Deprecated public TransientStore getTransientStore()
BatchManagerTransientStore backing the batches of the default handler.getTransientStore in interface BatchManagerpublic Set<String> getSupportedHandlers()
BatchManagergetSupportedHandlers in interface BatchManagerpublic BatchHandler getHandler(String handlerName)
BatchManagergetHandler in interface BatchManagerhandlerName - the batch handler namenull if it doesn't existpublic String initBatch()
BatchManagerinitBatch in interface BatchManager@Deprecated public String initBatch(String batchId, String contextName)
BatchManagerinitBatch in interface BatchManagerprotected Batch initBatchInternal(String batchId)
public Batch initBatch(String handlerName)
BatchManagerinitBatch in interface BatchManagerhandlerName - the batch handler namepublic Batch getBatch(String batchId)
BatchManagergetBatch in interface BatchManagerbatchId - the batch idnull if it doesn't existpublic void addStream(String batchId, String index, InputStream is, String name, String mime) throws IOException
BatchManagerBatch if needed.
 Streams are persisted as temporary files.
addStream in interface BatchManagerIOExceptionpublic void addBlob(String batchId, String index, Blob blob, String name, String mime) throws IOException
BatchManagerBatch if needed.addBlob in interface BatchManagerIOExceptionpublic void addStream(String batchId, String index, InputStream is, int chunkCount, int chunkIndex, String name, String mime, long fileSize) throws IOException
BatchManagerBatch if needed.
 Streams are persisted as temporary files.
addStream in interface BatchManagerIOExceptionpublic void addBlob(String batchId, String index, Blob blob, int chunkCount, int chunkIndex, String name, String mime, long fileSize) throws IOException
BatchManagerBatch if needed.addBlob in interface BatchManagerIOExceptionpublic boolean hasBatch(String batchId)
BatchManagerbatchId, false otherwise.hasBatch in interface BatchManagerpublic List<Blob> getBlobs(String batchId)
BatchManagergetBlobs in interface BatchManagerpublic List<Blob> getBlobs(String batchId, int timeoutS)
BatchManagergetBlobs in interface BatchManagerpublic Blob getBlob(String batchId, String fileIndex)
getBlob in interface BatchManagerpublic Blob getBlob(String batchId, String fileIndex, int timeoutS)
getBlob in interface BatchManagerprotected Blob getBatchBlob(String batchId, String fileIndex)
public List<BatchFileEntry> getFileEntries(String batchId)
getFileEntries in interface BatchManagerpublic BatchFileEntry getFileEntry(String batchId, String fileIndex)
getFileEntry in interface BatchManagerpublic void clean(String batchId)
BatchManagerclean in interface BatchManagerpublic Object execute(String batchId, String chainOrOperationId, CoreSession session, Map<String,Object> contextParams, Map<String,Object> operationParams)
BatchManagerBlobs from the given batchId.
 
 This method does not clean the temporary storage associated to the batchId.
execute in interface BatchManagerpublic Object execute(String batchId, String fileIndex, String chainOrOperationId, CoreSession session, Map<String,Object> contextParams, Map<String,Object> operationParams)
BatchManagerBlob from the given batchId and fileIndex.
 
 This method does not clean the temporary storage associated to the batchId.
execute in interface BatchManagerprotected Object execute(Object blobInput, String chainOrOperationId, CoreSession session, Map<String,Object> contextParams, Map<String,Object> operationParams)
protected int getUploadWaitTimeout()
public Object executeAndClean(String batchId, String chainOrOperationId, CoreSession session, Map<String,Object> contextParams, Map<String,Object> operationParams)
BatchManagerBlobs from the given batchId.
 
 This method cleans the temporary storage associated to the batchId after the execution.
executeAndClean in interface BatchManagerpublic boolean removeFileEntry(String batchId, String filedIdx)
BatchManagerremoveFileEntry in interface BatchManagerCopyright © 2019 Nuxeo. All rights reserved.