Class DefaultTransferProgress
- java.lang.Object
-
- software.amazon.awssdk.transfer.s3.internal.progress.DefaultTransferProgress
-
- All Implemented Interfaces:
TransferProgress
@Mutable @ThreadSafe public final class DefaultTransferProgress extends Object implements TransferProgress
An SDK-internal implementation ofTransferProgress. This implementation acts as a thin wrapper aroundAtomicReference, where calls to get the latestsnapshot()simply return the latest reference, whileTransferProgressUpdateris responsible for continuously updating the latest reference.- See Also:
TransferProgress
-
-
Constructor Summary
Constructors Constructor Description DefaultTransferProgress(TransferProgressSnapshot snapshot)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TransferProgressSnapshotsnapshot()Takes a snapshot of the current progress, represented by an immutableTransferProgressSnapshot.StringtoString()TransferProgressSnapshotupdateAndGet(Consumer<DefaultTransferProgressSnapshot.Builder> updater)Atomically convert the current snapshot reference to itsDefaultTransferProgressSnapshot.Builder, perform updates using the providedConsumer, and save the result as the latest snapshot.
-
-
-
Constructor Detail
-
DefaultTransferProgress
public DefaultTransferProgress(TransferProgressSnapshot snapshot)
-
-
Method Detail
-
updateAndGet
public TransferProgressSnapshot updateAndGet(Consumer<DefaultTransferProgressSnapshot.Builder> updater)
Atomically convert the current snapshot reference to itsDefaultTransferProgressSnapshot.Builder, perform updates using the providedConsumer, and save the result as the latest snapshot.
-
snapshot
public TransferProgressSnapshot snapshot()
Description copied from interface:TransferProgressTakes a snapshot of the current progress, represented by an immutableTransferProgressSnapshot.- Specified by:
snapshotin interfaceTransferProgress
-
-