Class LoggingTransferListener
java.lang.Object
software.amazon.awssdk.transfer.s3.progress.LoggingTransferListener
- All Implemented Interfaces:
TransferListener
An example implementation of
TransferListener
that logs a progress bar at the INFO
level. This implementation
effectively rate-limits how frequently updates are logged by only logging when a new "tick" advances in the progress bar. By
default, the progress bar has 20 ticks, meaning an update is only logged, at most, once every 5%.-
Nested Class Summary
Nested classes/interfaces inherited from interface software.amazon.awssdk.transfer.s3.progress.TransferListener
TransferListener.Context
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Additional bytes have been submitted or received.static LoggingTransferListener
create()
Create an instance ofLoggingTransferListener
with the default configuration.static LoggingTransferListener
create
(int maxTicks) Create an instance ofLoggingTransferListener
with a custommaxTicks
value.void
The transfer has completed successfully.void
The transfer failed.void
A new transfer has been initiated.
-
Method Details
-
create
Create an instance ofLoggingTransferListener
with a custommaxTicks
value.- Parameters:
maxTicks
- the number of ticks in the logged progress bar
-
create
Create an instance ofLoggingTransferListener
with the default configuration. -
transferInitiated
Description copied from interface:TransferListener
A new transfer has been initiated. This method is called exactly once per transfer.Available context attributes:
- Specified by:
transferInitiated
in interfaceTransferListener
-
bytesTransferred
Description copied from interface:TransferListener
Additional bytes have been submitted or received. This method may be called many times per transfer, depending on the transfer size and I/O buffer sizes.Available context attributes:
- Specified by:
bytesTransferred
in interfaceTransferListener
-
transferComplete
Description copied from interface:TransferListener
The transfer has completed successfully. This method is called exactly once for a successful transfer.Available context attributes:
- Specified by:
transferComplete
in interfaceTransferListener
-
transferFailed
Description copied from interface:TransferListener
The transfer failed. This method is called exactly once for a failed transfer.Available context attributes:
- Specified by:
transferFailed
in interfaceTransferListener
-