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 of
TransferProgress
. This implementation acts as a thin wrapper around AtomicReference
, where calls to get the latest snapshot()
simply return the latest reference, while TransferProgressUpdater
is responsible for continuously updating the latest reference.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionsnapshot()
Takes a snapshot of the current progress, represented by an immutableTransferProgressSnapshot
.toString()
Atomically convert the current snapshot reference to itsDefaultTransferProgressSnapshot.Builder
, perform updates using the providedConsumer
, and save the result as the latest snapshot.
-
Constructor Details
-
DefaultTransferProgress
-
-
Method Details
-
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
Description copied from interface:TransferProgress
Takes a snapshot of the current progress, represented by an immutableTransferProgressSnapshot
.- Specified by:
snapshot
in interfaceTransferProgress
-
toString
-