Package com.amazonaws.event
Class ProgressListenerChain
java.lang.Object
com.amazonaws.event.ProgressListenerChain
- All Implemented Interfaces:
DeliveryMode
,ProgressListener
An implementation of ProgressListener interface that delegates
progressChanged callback to multiple listeners. It also takes
an optional ProgressEventFilter to filter incoming events before
passing them to the listeners.
This class could be used for both Amazon S3 and Amazon Glacier clients. The legacy Amazon S3 progress listener chain com.amazonaws.services.s3.transfer.internal.ProgressListenerChain has been deprecated in favor of this new class.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.amazonaws.event.DeliveryMode
DeliveryMode.Check
Nested classes/interfaces inherited from interface com.amazonaws.event.ProgressListener
ProgressListener.ExceptionReporter, ProgressListener.NoOpProgressListener
-
Field Summary
Fields inherited from interface com.amazonaws.event.ProgressListener
NOOP
-
Constructor Summary
ConstructorsConstructorDescriptionProgressListenerChain
(ProgressEventFilter progressEventFilter, ProgressListener... listeners) Create a listener chain with a ProgressEventFilter.ProgressListenerChain
(ProgressListener... listeners) Create a listener chain that directly passes all the progress events to the specified listeners. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addProgressListener
(ProgressListener listener) protected List
<ProgressListener> Returns the listeners associated with this listener chain.boolean
Returns true if it is safe to make a synchronous callback to the implementing listener without the risk of incurring undue latency; false otherwise.void
progressChanged
(ProgressEvent progressEvent) Called when progress has changed, such as additional bytes transferred, transfer failed, etc.void
removeProgressListener
(ProgressListener listener)
-
Constructor Details
-
ProgressListenerChain
Create a listener chain that directly passes all the progress events to the specified listeners. -
ProgressListenerChain
public ProgressListenerChain(ProgressEventFilter progressEventFilter, ProgressListener... listeners) Create a listener chain with a ProgressEventFilter.
-
-
Method Details
-
addProgressListener
-
removeProgressListener
-
getListeners
Returns the listeners associated with this listener chain. -
progressChanged
Description copied from interface:ProgressListener
Called when progress has changed, such as additional bytes transferred, transfer failed, etc. The execution of the callback of this listener is managed bySDKProgressPublisher
. Implementation of this interface should never block.If the implementation follows the best practice and doesn't block, it should then extends from
SyncProgressListener
.Note any exception thrown by the listener will get ignored. Should there be need to capture any such exception, you may consider wrapping the listener with
ProgressListener.ExceptionReporter.wrap(ProgressListener)
.- Specified by:
progressChanged
in interfaceProgressListener
- Parameters:
progressEvent
- The event describing the progress change.- See Also:
-
isSyncCallSafe
public boolean isSyncCallSafe()Description copied from interface:DeliveryMode
Returns true if it is safe to make a synchronous callback to the implementing listener without the risk of incurring undue latency; false otherwise.- Specified by:
isSyncCallSafe
in interfaceDeliveryMode
-