Class MultipartManifestImpl

  • All Implemented Interfaces:
    MultipartManifest

    public class MultipartManifestImpl
    extends Object
    implements MultipartManifest
    Manifest impl that provides thread-safe access to an ongoing manifest upload.
    • Method Detail

      • registerTransfer

        public void registerTransfer​(int partNumber)
        Register a part that will will be uploaded using the given part number.
        Parameters:
        partNumber - The part number that will be uploaded.
      • registerSuccess

        public void registerSuccess​(int partNumber,
                                    UploadPartResponse part)
        Register a successful upload.

        Must have called registerTransfer(int) first.

        Parameters:
        partNumber - The part number of the successful upload
        part -
      • registerExisting

        public void registerExisting​(MultipartUploadPartSummary part)
        Register a upload that was previously completed (ie, to backfill previously completed parts).

        Do not have to call registerTransfer(int) first.

        Parameters:
        part -
      • registerFailure

        public void registerFailure​(int partNumber)
        Register a failed upload.

        Must have called registerTransfer(int) first.

        Parameters:
        partNumber - The failed part number
      • registerFailure

        public void registerFailure​(int partNumber,
                                    Exception failureException)
        Register a failed upload and the failure cause.

        Must have called registerTransfer(int) first.

        Parameters:
        partNumber - The failed part number
      • isUploadComplete

        public boolean isUploadComplete()
        Description copied from interface: MultipartManifest
        Check to see whether all parts have completed (successfully or unsuccessfully).
        Specified by:
        isUploadComplete in interface MultipartManifest
        Returns:
        true if complete, false otherwise
      • isUploadSuccessful

        public boolean isUploadSuccessful()
        Description copied from interface: MultipartManifest
        Check to see whether all parts have completed successfully.
        Specified by:
        isUploadSuccessful in interface MultipartManifest
        Returns:
        true if all parts completed successfully, false otherwise
      • listInProgressParts

        public List<Integer> listInProgressParts()
        Description copied from interface: MultipartManifest
        Lists the part numbers for all parts that have currently not been uploaded or are in progress.

        In the event that an upload is aborted, parts that have not been started yet will show up as in-progress in the manifest.

        Specified by:
        listInProgressParts in interface MultipartManifest
        Returns:
        The list of part numbers still in progress.
      • isUploadAborted

        public boolean isUploadAborted()
        Description copied from interface: MultipartManifest
        Check to see if abort has been called on the upload.

        Once aborted, the upload cannot have anymore parts added to it.

        Specified by:
        isUploadAborted in interface MultipartManifest
        Returns:
        true if the upload was aborted, false if not.
      • markUploadAborted

        public void markUploadAborted()
      • nextPartNumber

        public Integer nextPartNumber()
        Gets the next part number that should be assigned to an upload part.

        The returned part number will not be assigned again by this manifest.

        Returns:
        The next part number to assign.