Class TransportListener
- java.lang.Object
-
- org.eclipse.aether.spi.connector.transport.TransportListener
-
public abstract class TransportListener extends Object
A skeleton class for listeners used to monitor transport operations. Reusing common regular expression syntax, the sequence of events is generally as follows:( STARTED PROGRESSED* )*
The methods in this class do nothing.
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TransportListener()
Enables subclassing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
transportProgressed(ByteBuffer data)
Notifies the listener about some progress in the data transfer.void
transportStarted(long dataOffset, long dataLength)
Notifies the listener about the start of the data transfer.
-
-
-
Constructor Detail
-
TransportListener
protected TransportListener()
Enables subclassing.
-
-
Method Detail
-
transportStarted
public void transportStarted(long dataOffset, long dataLength) throws TransferCancelledException
Notifies the listener about the start of the data transfer. This event may arise more than once if the transfer needs to be restarted (e.g. after an authentication failure).- Parameters:
dataOffset
- The byte offset in the resource at which the transfer starts, must not be negative.dataLength
- The total number of bytes in the resource or-1
if the length is unknown.- Throws:
TransferCancelledException
- If the transfer should be aborted.
-
transportProgressed
public void transportProgressed(ByteBuffer data) 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:
data
- The (read-only) buffer holding the bytes that have just been tranferred, must not benull
.- Throws:
TransferCancelledException
- If the transfer should be aborted.
-
-