net.i2p.router.tunnel

## Class TunnelGateway.Pending

- java.lang.Object
- - net.i2p.router.tunnel.TunnelGateway.Pending

- Direct Known Subclasses:
    TunnelGateway.PendingImpl
  Enclosing class:
    TunnelGateway

      public static class TunnelGateway.Pending
      extends Object

  Stores all the state for an unsent or partially-sent message

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected long` | `_created`
    `protected long` | `_expiration`
    `protected int` | `_fragmentNumber`
    `protected long` | `_messageId`
    `protected int` | `_offset`
    `protected byte[]` | `_remaining`
    `protected Hash` | `_toRouter`
    `protected TunnelId` | `_toTunnel`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TunnelGateway.Pending(I2NPMessage message, Hash toRouter, TunnelId toTunnel)`
    `TunnelGateway.Pending(I2NPMessage message, Hash toRouter, TunnelId toTunnel, long now)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addMessageId(long id)` Add an ID to the list of the TunnelDataMssages this message was fragmented into.
    `byte[]` | `getData()` raw unfragmented message to send
    `long` | `getExpiration()`
    `int` | `getFragmentNumber()` which fragment are we working on (0 for the first fragment)
    `long` | `getLifetime()`
    `long` | `getMessageId()`
    `List<Long>` | `getMessageIds()` The IDs of the TunnelDataMssages this message was fragmented into.
    `int` | `getOffset()` index into the data to be sent
    `Hash` | `getToRouter()` may be null
    `TunnelId` | `getToTunnel()` may be null
    `void` | `incrementFragmentNumber()` ok, fragment sent, increment what the next will be
    `void` | `setOffset(int offset)` move the offset

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

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

- - ### Field Detail

    - #### _toRouter

          protected Hash _toRouter

    - #### _toTunnel

          protected TunnelId _toTunnel

    - #### _messageId

          protected long _messageId

    - #### _expiration

          protected long _expiration

    - #### _remaining

          protected byte[] _remaining

    - #### _offset

          protected int _offset

    - #### _fragmentNumber

          protected int _fragmentNumber

    - #### _created

          protected long _created

  - ### Constructor Detail

    - #### TunnelGateway.Pending

          public TunnelGateway.Pending(I2NPMessage message,
                               Hash toRouter,
                               TunnelId toTunnel)

    - #### TunnelGateway.Pending

          public TunnelGateway.Pending(I2NPMessage message,
                               Hash toRouter,
                               TunnelId toTunnel,
                               long now)

  - ### Method Detail

    - #### getToRouter

          public Hash getToRouter()

      may be null

    - #### getToTunnel

          public TunnelId getToTunnel()

      may be null

    - #### getMessageId

          public long getMessageId()

    - #### getExpiration

          public long getExpiration()

    - #### getData

          public byte[] getData()

      raw unfragmented message to send

    - #### getOffset

          public int getOffset()

      index into the data to be sent

    - #### setOffset

          public void setOffset(int offset)

      move the offset

    - #### getLifetime

          public long getLifetime()

    - #### getFragmentNumber

          public int getFragmentNumber()

      which fragment are we working on (0 for the first fragment)

    - #### incrementFragmentNumber

          public void incrementFragmentNumber()

      ok, fragment sent, increment what the next will be

    - #### addMessageId

          public void addMessageId(long id)

      Add an ID to the list of the TunnelDataMssages this message was fragmented into. Unused except in notePreprocessing() calls for debugging

    - #### getMessageIds

          public List<Long> getMessageIds()

      The IDs of the TunnelDataMssages this message was fragmented into. Unused except in notePreprocessing() calls for debugging