# Class TransportAdapter

java.lang.Object
com.codename1.nearby.transport.TransportAdapter

All Implemented Interfaces:
  `TransportListener`

public class TransportAdapter extends Object implements TransportListener
A `TransportListener` whose methods all do nothing, so a caller interested in two events overrides two methods.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TransportAdapter()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `connected(Endpoint endpoint)`
  A connection is open in both directions and payloads may be sent.
  `void`
  `connectionFailed(Endpoint endpoint, NearbyException error)`
  A connection attempt failed, or was rejected by the far side.
  `void`
  `connectionRequested(IncomingConnection request)`
  A peer wants to connect.
  `void`
  `disconnected(Endpoint endpoint)`
  An open connection closed, whether deliberately or because the peer went out of range.
  `void`
  `endpointFound(Endpoint endpoint)`
  A peer advertising the same service id came into view.
  `void`
  `endpointLost(Endpoint endpoint)`
  A discovered peer went away before any connection was made.
  `void`
  `payloadProgress(Endpoint endpoint, PayloadTransferUpdate update)`
  Progress on a payload being sent or received.
  `void`
  `payloadReceived(Endpoint endpoint, Payload payload)`
  A complete payload arrived.

  ### Methods inherited from class Object

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

- ## Constructor Details

  - ### TransportAdapter

    public TransportAdapter()

- ## Method Details

  - ### endpointFound

    public void endpointFound(Endpoint endpoint)
    Description copied from interface: `TransportListener`

    A peer advertising the same service id came into view. Expect this repeatedly for the same endpoint across discovery sessions.

    ###### Parameters

    - `endpoint`: the peer that appeared
    Specified by:
      `endpointFound` in interface `TransportListener`

  - ### endpointLost

    public void endpointLost(Endpoint endpoint)
    Description copied from interface: `TransportListener`

    A discovered peer went away before any connection was made.

    ###### Parameters

    - `endpoint`: the peer that disappeared
    Specified by:
      `endpointLost` in interface `TransportListener`

  - ### connectionRequested

    public void connectionRequested(IncomingConnection request)
    Description copied from interface: `TransportListener`

    A peer wants to connect. Call `IncomingConnection.accept()` or `IncomingConnection.reject()`; a request that is never answered times out on the far side.

    ###### Parameters

    - `request`: the request to answer
    Specified by:
      `connectionRequested` in interface `TransportListener`

  - ### connected

    public void connected(Endpoint endpoint)
    Description copied from interface: `TransportListener`

    A connection is open in both directions and payloads may be sent.

    ###### Parameters

    - `endpoint`: the connected peer
    Specified by:
      `connected` in interface `TransportListener`

  - ### connectionFailed

    public void connectionFailed(Endpoint endpoint, NearbyException error)
    Description copied from interface: `TransportListener`

    A connection attempt failed, or was rejected by the far side.

    ###### Parameters

    - `endpoint`: the peer that did not connect
    - `error`: why
    Specified by:
      `connectionFailed` in interface `TransportListener`

  - ### disconnected

    public void disconnected(Endpoint endpoint)
    Description copied from interface: `TransportListener`

    An open connection closed, whether deliberately or because the peer went out of range.

    ###### Parameters

    - `endpoint`: the peer that disconnected
    Specified by:
      `disconnected` in interface `TransportListener`

  - ### payloadReceived

    public void payloadReceived(Endpoint endpoint, Payload payload)
    Description copied from interface: `TransportListener`

    A complete payload arrived.

    ###### Parameters

    - `endpoint`: who sent it
    - `payload`: what they sent
    Specified by:
      `payloadReceived` in interface `TransportListener`

  - ### payloadProgress

    public void payloadProgress(Endpoint endpoint, PayloadTransferUpdate update)
    Description copied from interface: `TransportListener`

    Progress on a payload being sent or received.

    ###### Parameters

    - `endpoint`: the other end of the transfer
    - `update`: how far it has got
    Specified by:
      `payloadProgress` in interface `TransportListener`