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 TypeMethodDescriptionvoidAdditional bytes have been submitted or received.static LoggingTransferListenercreate()Create an instance ofLoggingTransferListenerwith the default configuration.static LoggingTransferListenercreate(int maxTicks) Create an instance ofLoggingTransferListenerwith a custommaxTicksvalue.voidThe transfer has completed successfully.voidThe transfer failed.voidA new transfer has been initiated.
-
Method Details
-
create
Create an instance ofLoggingTransferListenerwith a custommaxTicksvalue.- Parameters:
maxTicks- the number of ticks in the logged progress bar
-
create
Create an instance ofLoggingTransferListenerwith the default configuration. -
transferInitiated
Description copied from interface:TransferListenerA new transfer has been initiated. This method is called exactly once per transfer.Available context attributes:
- Specified by:
transferInitiatedin interfaceTransferListener
-
bytesTransferred
Description copied from interface:TransferListenerAdditional 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:
bytesTransferredin interfaceTransferListener
-
transferComplete
Description copied from interface:TransferListenerThe transfer has completed successfully. This method is called exactly once for a successful transfer.Available context attributes:
- Specified by:
transferCompletein interfaceTransferListener
-
transferFailed
Description copied from interface:TransferListenerThe transfer failed. This method is called exactly once for a failed transfer.Available context attributes:
- Specified by:
transferFailedin interfaceTransferListener
-