net.i2p.router

## Interface TunnelInfo

- All Known Implementing Classes:
    PooledTunnelCreatorConfig, TunnelCreatorConfig

      public interface TunnelInfo

  Defines the information associated with a tunnel

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `Hash` | `getDestination()` if this is a client tunnel, what destination is it for?
    `Hash` | `getEndpoint()` For convenience
    `long` | `getExpiration()` Get the tunnel's expiration time.
    `Hash` | `getFarEnd()` For convenience
    `Hash` | `getGateway()` For convenience
    `int` | `getLength()` how many peers are there in the tunnel (including the creator)?
    `Hash` | `getPeer(int hop)` retrieve the peer at the given hop.
    `int` | `getProcessedMessagesCount()` Get the count of messages that have been processed through this tunnel.
    `TunnelId` | `getReceiveTunnelId(int hop)` retrieve the tunnelId that the given hop receives messages on.
    `TunnelId` | `getSendTunnelId(int hop)` retrieve the tunnelId that the given hop sends messages on.
    `boolean` | `getTunnelFailed()` Has the tunnel failed completely?
    `long` | `getVerifiedBytesTransferred()` we know for sure that this many bytes travelled through the tunnel in its lifetime
    `void` | `incrementVerifiedBytesTransferred(int numBytes)` Increment the verified byte count for data successfully sent through the tunnel.
    `boolean` | `isInbound()` is this an inbound tunnel?
    `void` | `setReused()` Note that we reused this tunnel
    `void` | `testSuccessful(int responseTime)` Record that the tunnel successfully processed a test with the given response time.
    `boolean` | `wasReused()` Did we reuse this tunnel?

- - ### Method Detail

    - #### getDestination

          Hash getDestination()

      if this is a client tunnel, what destination is it for?

    - #### getEndpoint

          Hash getEndpoint()

      For convenience
      Returns:
        getPeer(getLength() - 1)

    - #### getExpiration

          long getExpiration()

      Get the tunnel's expiration time.
      Returns:
        expiration time in milliseconds since epoch

    - #### getFarEnd

          Hash getFarEnd()

      For convenience
      Returns:
        isInbound() ? getGateway() : getEndpoint()

    - #### getGateway

          Hash getGateway()

      For convenience
      Returns:
        getPeer(0)

    - #### getLength

          int getLength()

      how many peers are there in the tunnel (including the creator)?

    - #### getPeer

          Hash getPeer(int hop)

      retrieve the peer at the given hop. the gateway is hop 0

    - #### getProcessedMessagesCount

          int getProcessedMessagesCount()

      Get the count of messages that have been processed through this tunnel.
      Returns:
        the number of processed messages

    - #### getReceiveTunnelId

          TunnelId getReceiveTunnelId(int hop)

      retrieve the tunnelId that the given hop receives messages on. the gateway is hop 0.

    - #### getSendTunnelId

          TunnelId getSendTunnelId(int hop)

      retrieve the tunnelId that the given hop sends messages on. the gateway is hop 0.

    - #### getTunnelFailed

          boolean getTunnelFailed()

      Has the tunnel failed completely?

    - #### getVerifiedBytesTransferred

          long getVerifiedBytesTransferred()

      we know for sure that this many bytes travelled through the tunnel in its lifetime

    - #### incrementVerifiedBytesTransferred

          void incrementVerifiedBytesTransferred(int numBytes)

      Increment the verified byte count for data successfully sent through the tunnel.
      Parameters:
        `numBytes` - the number of bytes to add to the verified total

    - #### isInbound

          boolean isInbound()

      is this an inbound tunnel?

    - #### setReused

          void setReused()

      Note that we reused this tunnel

    - #### testSuccessful

          void testSuccessful(int responseTime)

      Record that the tunnel successfully processed a test with the given response time.
      Parameters:
        `responseTime` - the response time in milliseconds

    - #### wasReused

          boolean wasReused()

      Did we reuse this tunnel?