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 Details

  • Constructor Details

    • Batch

      public Batch(String key, Map<String,Serializable> fileEntries, String handlerName, TransientStore transientStore)
      Constructs a batch.
      Parameters:
      key - the batch key
      fileEntries - the batch file entries
      handlerName - the batch hrovider name
      transientStore - the transient store associated with this Batch
      Since:
      10.1
  • Method Details

    • getKey

      public String getKey()
    • getBlobs

      public List<Blob> getBlobs()
      Returns the uploaded blobs in the order the user chose to upload them.
    • getBlob

      public Blob getBlob(String index)
    • getOrderedFileIndexes

      protected List<String> getOrderedFileIndexes()
    • retrieveBlob

      protected Blob retrieveBlob(String index)
    • 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 the Blob-based signature instead
      Adds a file with the given index 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 given index 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 the Blob-based signature instead
      Adds a chunk with the given chunkIndex to the batch file with the given index.
      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 given chunkIndex to the batch file with the given index.
      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
    • getProperties

      public Map<String,Object> getProperties()
      Since:
      10.1