Class MultipartManifestImpl
- java.lang.Object
-
- com.oracle.bmc.objectstorage.transfer.internal.MultipartManifestImpl
-
- All Implemented Interfaces:
MultipartManifest
public class MultipartManifestImpl extends Object implements MultipartManifest
Manifest impl that provides thread-safe access to an ongoing manifest upload.
-
-
Constructor Summary
Constructors Constructor Description MultipartManifestImpl(String uploadId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getUploadId()
Gets the upload ID associated with the multi-part upload.boolean
isUploadAborted()
Check to see if abort has been called on the upload.boolean
isUploadComplete()
Check to see whether all parts have completed (successfully or unsuccessfully).boolean
isUploadSuccessful()
Check to see whether all parts have completed successfully.List<CommitMultipartUploadPartDetails>
listCompletedParts()
Lists all currently parts that have completed upload so far.List<Integer>
listFailedParts()
Lists the part numbers for all parts that have failed to upload so far.List<MultipartUploadFailedPartDetails>
listFailedPartsDetails()
Lists all the parts that have failed to upload and the cause of the failureList<Integer>
listInProgressParts()
Lists the part numbers for all parts that have currently not been uploaded or are in progress.void
markUploadAborted()
Integer
nextPartNumber()
Gets the next part number that should be assigned to an upload part.void
registerExisting(MultipartUploadPartSummary part)
Register a upload that was previously completed (ie, to backfill previously completed parts).void
registerFailure(int partNumber)
Register a failed upload.void
registerFailure(int partNumber, Exception failureException)
Register a failed upload and the failure cause.void
registerSuccess(int partNumber, UploadPartResponse part)
Register a successful upload.void
registerTransfer(int partNumber)
Register a part that will will be uploaded using the given part number.
-
-
-
Constructor Detail
-
MultipartManifestImpl
@ConstructorProperties("uploadId") public MultipartManifestImpl(String uploadId)
-
-
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 uploadpart
-
-
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 interfaceMultipartManifest
- 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 interfaceMultipartManifest
- Returns:
- true if all parts completed successfully, false otherwise
-
listCompletedParts
public List<CommitMultipartUploadPartDetails> listCompletedParts()
Description copied from interface:MultipartManifest
Lists all currently parts that have completed upload so far.- Specified by:
listCompletedParts
in interfaceMultipartManifest
- Returns:
- The list of completed parts.
-
listFailedParts
public List<Integer> listFailedParts()
Description copied from interface:MultipartManifest
Lists the part numbers for all parts that have failed to upload so far.- Specified by:
listFailedParts
in interfaceMultipartManifest
- Returns:
- The list of failed part numbers.
-
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 interfaceMultipartManifest
- Returns:
- The list of part numbers still in progress.
-
listFailedPartsDetails
public List<MultipartUploadFailedPartDetails> listFailedPartsDetails()
Description copied from interface:MultipartManifest
Lists all the parts that have failed to upload and the cause of the failure- Specified by:
listFailedPartsDetails
in interfaceMultipartManifest
- Returns:
- The list of failed parts details.
-
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 interfaceMultipartManifest
- 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.
-
getUploadId
public String getUploadId()
Description copied from interface:MultipartManifest
Gets the upload ID associated with the multi-part upload.- Specified by:
getUploadId
in interfaceMultipartManifest
- Returns:
- The upload ID.
-
-