org.eclipse.aether.spi.connector.transport

## 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 and Description
    --- | ---
    `protected` | `TransportListener()` Enables subclassing.

  - ### Method Summary

    Methods
    Modifier and Type | Method and 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.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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 be `null`.
      Throws:
        `TransferCancelledException` - If the transfer should be aborted.

Copyright © 2010-2014 The Eclipse Foundation. All Rights Reserved.