Package org.eclipse.aether.transfer
Interface TransferListener
- All Known Implementing Classes:
AbstractTransferListener
,ChainedTransferListener
,ConsoleTransferListener
public interface TransferListener
A listener being notified of artifact/metadata transfers from/to remote repositories. The listener may be called from
an arbitrary thread. Reusing common regular expression syntax, the sequence of events is roughly as follows:
INITIATED ( STARTED PROGRESSED* CORRUPTED? )* ( SUCCEEDED | FAILED )Note: Implementors are strongly advised to inherit from
AbstractTransferListener
instead of directly
implementing this interface.- See Also:
- Restriction:
- This interface is not intended to be extended by clients.
- Restriction:
- This interface is not intended to be implemented by clients.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
transferCorrupted
(TransferEvent event) Notifies the listener that a checksum validation failed.void
transferFailed
(TransferEvent event) Notifies the listener about the unsuccessful termination of a transfer.void
transferInitiated
(TransferEvent event) Notifies the listener about the initiation of a transfer.void
transferProgressed
(TransferEvent event) Notifies the listener about some progress in the data transfer.void
transferStarted
(TransferEvent event) Notifies the listener about the start of a data transfer.void
transferSucceeded
(TransferEvent event) Notifies the listener about the successful completion of a transfer.
-
Method Details
-
transferInitiated
Notifies the listener about the initiation of a transfer. This event gets fired before any actual network access to the remote repository and usually indicates some thread is now about to perform the transfer. For a given transfer request, this event is the first one being fired and it must be emitted exactly once.- Parameters:
event
- The event details, must not benull
.- Throws:
TransferCancelledException
- If the transfer should be aborted.
-
transferStarted
Notifies the listener about the start of a data transfer. This event indicates a successful connection to the remote repository. In case of a download, the requested remote resource exists and its size is given byTransferResource.getContentLength()
if possible. This event may be fired multiple times for given transfer request if said transfer needs to be repeated (e.g. in response to an authentication challenge).- Parameters:
event
- The event details, must not benull
.- Throws:
TransferCancelledException
- If the transfer should be aborted.
-
transferProgressed
Notifies the listener about some progress in the data transfer. This event may even be fired if actually zero bytes have been transferred since the last event, for instance to enable cancellation.- Parameters:
event
- The event details, must not benull
.- Throws:
TransferCancelledException
- If the transfer should be aborted.
-
transferCorrupted
Notifies the listener that a checksum validation failed.TransferEvent.getException()
will be of typeChecksumFailureException
and can be used to query further details about the expected/actual checksums.- Parameters:
event
- The event details, must not benull
.- Throws:
TransferCancelledException
- If the transfer should be aborted.
-
transferSucceeded
Notifies the listener about the successful completion of a transfer. This event must be fired exactly once for a given transfer request unless said request failed.- Parameters:
event
- The event details, must not benull
.
-
transferFailed
Notifies the listener about the unsuccessful termination of a transfer.TransferEvent.getException()
will provide further information about the failure.- Parameters:
event
- The event details, must not benull
.
-