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 StringgetUploadId()Gets the upload ID associated with the multi-part upload.booleanisUploadAborted()Check to see if abort has been called on the upload.booleanisUploadComplete()Check to see whether all parts have completed (successfully or unsuccessfully).booleanisUploadSuccessful()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.voidmarkUploadAborted()IntegernextPartNumber()Gets the next part number that should be assigned to an upload part.voidregisterExisting(MultipartUploadPartSummary part)Register a upload that was previously completed (ie, to backfill previously completed parts).voidregisterFailure(int partNumber)Register a failed upload.voidregisterFailure(int partNumber, Exception failureException)Register a failed upload and the failure cause.voidregisterSuccess(int partNumber, UploadPartResponse part)Register a successful upload.voidregisterTransfer(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:MultipartManifestCheck to see whether all parts have completed (successfully or unsuccessfully).- Specified by:
isUploadCompletein interfaceMultipartManifest- Returns:
- true if complete, false otherwise
-
isUploadSuccessful
public boolean isUploadSuccessful()
Description copied from interface:MultipartManifestCheck to see whether all parts have completed successfully.- Specified by:
isUploadSuccessfulin interfaceMultipartManifest- Returns:
- true if all parts completed successfully, false otherwise
-
listCompletedParts
public List<CommitMultipartUploadPartDetails> listCompletedParts()
Description copied from interface:MultipartManifestLists all currently parts that have completed upload so far.- Specified by:
listCompletedPartsin interfaceMultipartManifest- Returns:
- The list of completed parts.
-
listFailedParts
public List<Integer> listFailedParts()
Description copied from interface:MultipartManifestLists the part numbers for all parts that have failed to upload so far.- Specified by:
listFailedPartsin interfaceMultipartManifest- Returns:
- The list of failed part numbers.
-
listInProgressParts
public List<Integer> listInProgressParts()
Description copied from interface:MultipartManifestLists 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:
listInProgressPartsin interfaceMultipartManifest- Returns:
- The list of part numbers still in progress.
-
listFailedPartsDetails
public List<MultipartUploadFailedPartDetails> listFailedPartsDetails()
Description copied from interface:MultipartManifestLists all the parts that have failed to upload and the cause of the failure- Specified by:
listFailedPartsDetailsin interfaceMultipartManifest- Returns:
- The list of failed parts details.
-
isUploadAborted
public boolean isUploadAborted()
Description copied from interface:MultipartManifestCheck to see if abort has been called on the upload.Once aborted, the upload cannot have anymore parts added to it.
- Specified by:
isUploadAbortedin 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:MultipartManifestGets the upload ID associated with the multi-part upload.- Specified by:
getUploadIdin interfaceMultipartManifest- Returns:
- The upload ID.
-
-