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 String
CHUNKED_PARAM_NAME
protected Map<String,Serializable>
fileEntries
protected String
handlerName
protected String
key
protected static Log
log
protected Map<String,Object>
properties
protected TransientStore
transientStore
-
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 String
addChunk(String index, InputStream is, int chunkCount, int chunkIndex, String fileName, String mimeType, long fileSize)
Deprecated.since 10.1, use theBlob
-based signature insteadString
addChunk(String index, Blob blob, int chunkCount, int chunkIndex, String fileName, String mimeType, long fileSize)
Adds a chunk with the givenchunkIndex
to the batch file with the givenindex
.String
addFile(String index, InputStream is, String name, String mime)
Deprecated.since 10.1, use theBlob
-based signature insteadString
addFile(String index, Blob blob, String name, String mime)
Adds a file with the givenindex
to the batch.void
clean()
Blob
getBlob(String index)
List<Blob>
getBlobs()
Returns the uploaded blobs in the order the user chose to upload them.List<BatchFileEntry>
getFileEntries()
BatchFileEntry
getFileEntry(String index)
BatchFileEntry
getFileEntry(String index, boolean fetchBlobs)
String
getHandlerName()
String
getKey()
protected List<String>
getOrderedFileIndexes()
Map<String,Object>
getProperties()
boolean
removeFileEntry(String index)
boolean
removeFileEntry(String index, TransientStore ts)
protected Blob
retrieveBlob(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 givenindex
to 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 givenindex
to 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 givenchunkIndex
to 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 givenchunkIndex
to 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
-
-