Class Batch
- java.lang.Object
-
- org.nuxeo.ecm.automation.server.jaxrs.batch.Batch
-
public class Batch extends Object
Batch Object to encapsulate all data related to a batch, especially the temporary files used for Blobs.Since 7.4 a batch is backed by the
TransientStore.- Since:
- 5.4.2
-
-
Field Summary
Fields Modifier and Type Field Description static StringCHUNKED_PARAM_NAMEprotected Map<String,Serializable>fileEntriesprotected StringhandlerNameprotected Stringkeyprotected static Loglogprotected Map<String,Object>propertiesprotected TransientStoretransientStore
-
Constructor Summary
Constructors Constructor Description Batch(String key, Map<String,Serializable> fileEntries, String handlerName, TransientStore transientStore)Constructs a batch.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StringaddChunk(String index, InputStream is, int chunkCount, int chunkIndex, String fileName, String mimeType, long fileSize)Deprecated.since 10.1, use theBlob-based signature insteadStringaddChunk(String index, Blob blob, int chunkCount, int chunkIndex, String fileName, String mimeType, long fileSize)Adds a chunk with the givenchunkIndexto the batch file with the givenindex.StringaddFile(String index, InputStream is, String name, String mime)Deprecated.since 10.1, use theBlob-based signature insteadStringaddFile(String index, Blob blob, String name, String mime)Adds a file with the givenindexto the batch.voidclean()BlobgetBlob(String index)List<Blob>getBlobs()Returns the uploaded blobs in the order the user chose to upload them.List<BatchFileEntry>getFileEntries()BatchFileEntrygetFileEntry(String index)BatchFileEntrygetFileEntry(String index, boolean fetchBlobs)StringgetHandlerName()StringgetKey()protected List<String>getOrderedFileIndexes()Map<String,Object>getProperties()booleanremoveFileEntry(String index)booleanremoveFileEntry(String index, TransientStore ts)protected BlobretrieveBlob(String index)
-
-
-
Field Detail
-
log
protected static final Log log
-
CHUNKED_PARAM_NAME
public static final String CHUNKED_PARAM_NAME
- See Also:
- Constant Field Values
-
key
protected String key
-
fileEntries
protected Map<String,Serializable> fileEntries
-
handlerName
protected String handlerName
-
transientStore
protected TransientStore transientStore
-
-
Constructor Detail
-
Batch
public Batch(String key, Map<String,Serializable> fileEntries, String handlerName, TransientStore transientStore)
Constructs a batch.- Parameters:
key- the batch keyfileEntries- the batch file entrieshandlerName- the batch hrovider nametransientStore- the transient store associated with this Batch- Since:
- 10.1
-
-
Method Detail
-
getKey
public String getKey()
-
getBlobs
public List<Blob> getBlobs()
Returns the uploaded blobs in the order the user chose to upload them.
-
getFileEntries
public List<BatchFileEntry> getFileEntries()
-
getFileEntry
public BatchFileEntry getFileEntry(String index)
-
getFileEntry
public BatchFileEntry getFileEntry(String index, boolean fetchBlobs)
-
addFile
@Deprecated public String addFile(String index, InputStream is, String name, String mime) throws IOException
Deprecated.since 10.1, use theBlob-based signature insteadAdds a file with the givenindexto the batch.- Returns:
- The key of the new
BatchFileEntry. - Throws:
IOException
-
addFile
public String addFile(String index, Blob blob, String name, String mime)
Adds a file with the givenindexto the batch.- Returns:
- The key of the new
BatchFileEntry. - Since:
- 10.1
-
addChunk
@Deprecated public String addChunk(String index, InputStream is, int chunkCount, int chunkIndex, String fileName, String mimeType, long fileSize) throws IOException
Deprecated.since 10.1, use theBlob-based signature insteadAdds a chunk with the givenchunkIndexto the batch file with the givenindex.- Returns:
- The key of the
BatchFileEntry. - Throws:
IOException- Since:
- 7.4
-
addChunk
public String addChunk(String index, Blob blob, int chunkCount, int chunkIndex, String fileName, String mimeType, long fileSize)
Adds a chunk with the givenchunkIndexto the batch file with the givenindex.- Returns:
- The key of the
BatchFileEntry. - Since:
- 10.1
-
clean
public void clean()
- Since:
- 7.4
-
removeFileEntry
public boolean removeFileEntry(String index, TransientStore ts)
- Since:
- 8.4
-
removeFileEntry
public boolean removeFileEntry(String index)
- Since:
- 8.4
-
getHandlerName
public String getHandlerName()
- Since:
- 10.1
-
-