Record Class ChunkedUpload

java.lang.Object
java.lang.Record
org.exoplatform.documents.mcp.model.ChunkedUpload
Record Components:
id - its id
userName - the user who started it
folderId - the folder it is filed into
name - the file name it is filed under
size - the file's size, in bytes, announced at its start
conflictAction - what to do when the folder holds a file of that name
file - the temporary file holding the pieces received
received - the bytes received
nextIndex - the number of the next piece expected
lastPieceDigest - the SHA-256 of the last piece received, hex-encoded, to acknowledge it sent again and refuse another piece under its number
touched - when it was last used
filing - whether its last piece came and its file is being filed
document - the document it was filed as, once filed

public record ChunkedUpload(String id, String userName, String folderId, String name, long size, org.exoplatform.documents.constant.UploadConflictAction conflictAction, Path file, long received, int nextIndex, String lastPieceDigest, Instant touched, boolean filing, DocumentModel document) extends Record
An upload in pieces as the store of the uploads in progress holds it: who started it, where and how it is filed, the temporary file holding its pieces, and, once filed, the document it became.
  • Constructor Details

    • ChunkedUpload

      public ChunkedUpload(String id, String userName, String folderId, String name, long size, org.exoplatform.documents.constant.UploadConflictAction conflictAction, Path file, long received, int nextIndex, String lastPieceDigest, Instant touched, boolean filing, DocumentModel document)
      Creates an instance of a ChunkedUpload record class.
      Parameters:
      id - the value for the id record component
      userName - the value for the userName record component
      folderId - the value for the folderId record component
      name - the value for the name record component
      size - the value for the size record component
      conflictAction - the value for the conflictAction record component
      file - the value for the file record component
      received - the value for the received record component
      nextIndex - the value for the nextIndex record component
      lastPieceDigest - the value for the lastPieceDigest record component
      touched - the value for the touched record component
      filing - the value for the filing record component
      document - the value for the document record component
  • Method Details

    • withPiece

      public ChunkedUpload withPiece(int length, String digest, Instant now)
      The upload with a piece more.
      Parameters:
      length - the piece's length
      digest - the piece's SHA-256, hex-encoded
      now - when it came
      Returns:
      the upload, filing once all its bytes came
    • touchedAt

      public ChunkedUpload touchedAt(Instant now)
      The upload used at another time.
      Parameters:
      now - when it was used
      Returns:
      the upload, marked
    • filedAs

      public ChunkedUpload filedAs(DocumentModel filed, Instant now)
      The upload filed.
      Parameters:
      filed - the document it was filed as
      now - when it was filed
      Returns:
      the upload, filed
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • userName

      public String userName()
      Returns the value of the userName record component.
      Returns:
      the value of the userName record component
    • folderId

      public String folderId()
      Returns the value of the folderId record component.
      Returns:
      the value of the folderId record component
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • size

      public long size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component
    • conflictAction

      public org.exoplatform.documents.constant.UploadConflictAction conflictAction()
      Returns the value of the conflictAction record component.
      Returns:
      the value of the conflictAction record component
    • file

      public Path file()
      Returns the value of the file record component.
      Returns:
      the value of the file record component
    • received

      public long received()
      Returns the value of the received record component.
      Returns:
      the value of the received record component
    • nextIndex

      public int nextIndex()
      Returns the value of the nextIndex record component.
      Returns:
      the value of the nextIndex record component
    • lastPieceDigest

      public String lastPieceDigest()
      Returns the value of the lastPieceDigest record component.
      Returns:
      the value of the lastPieceDigest record component
    • touched

      public Instant touched()
      Returns the value of the touched record component.
      Returns:
      the value of the touched record component
    • filing

      public boolean filing()
      Returns the value of the filing record component.
      Returns:
      the value of the filing record component
    • document

      public DocumentModel document()
      Returns the value of the document record component.
      Returns:
      the value of the document record component