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, whileTransferProgressUpdater
is 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 TransferProgressSnapshot
snapshot()
Takes a snapshot of the current progress, represented by an immutableTransferProgressSnapshot
.String
toString()
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.
-
-
-
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:TransferProgress
Takes a snapshot of the current progress, represented by an immutableTransferProgressSnapshot
.- Specified by:
snapshot
in interfaceTransferProgress
-
-