org.sonatype.aether.transfer
Interface TransferListener

All Known Implementing Classes:
AbstractTransferListener, AbstractTransferListener, ChainedTransferListener, RecordingTransferListener

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.

Author:
Benjamin Bentmann

Method Summary
 void 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, i.e.
 void transferSucceeded(TransferEvent event)
          Notifies the listener about the successful completion of a transfer.
 

Method Detail

transferInitiated

void transferInitiated(TransferEvent event)
                       throws TransferCancelledException
Notifies the listener about the initiation of a transfer. This event gets fired before any actual network access to the remote repository.

Parameters:
event - The event details, must not be null.
Throws:
TransferCancelledException - If the transfer should be aborted.

transferStarted

void transferStarted(TransferEvent event)
                     throws TransferCancelledException
Notifies the listener about the start of a data transfer, i.e. the successful connection to the remote repository.

Parameters:
event - The event details, must not be null.
Throws:
TransferCancelledException - If the transfer should be aborted.

transferProgressed

void transferProgressed(TransferEvent event)
                        throws TransferCancelledException
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 be null.
Throws:
TransferCancelledException - If the transfer should be aborted.

transferCorrupted

void transferCorrupted(TransferEvent event)
                       throws TransferCancelledException
Notifies the listener that a checksum validation failed. TransferEvent.getException() will be of type ChecksumFailureException and can be used to query further details about the expected/actual checksums.

Parameters:
event - The event details, must not be null.
Throws:
TransferCancelledException - If the transfer should be aborted.

transferSucceeded

void transferSucceeded(TransferEvent event)
Notifies the listener about the successful completion of a transfer.

Parameters:
event - The event details, must not be null.

transferFailed

void transferFailed(TransferEvent event)
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 be null.


Copyright © 2010-2013. All Rights Reserved.