net.i2p.router.tunnel

## Class PendingGatewayMessage

- java.lang.Object
- - net.i2p.router.tunnel.PendingGatewayMessage

- All Implemented Interfaces:
    CDQEntry
  Direct Known Subclasses:
    OutboundGatewayMessage

      class PendingGatewayMessage
      extends Object
      implements CDQEntry

  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
    `PendingGatewayMessage(I2NPMessage message, Hash toRouter, TunnelId toTunnel)`

  - ### Method Summary

    All Methods Instance Methods Concrete 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.
    `void` | `drop()` For CDQ
    `byte[]` | `getData()` raw unfragmented message to send
    `long` | `getEnqueueTime()` For CDQ
    `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` | `setEnqueueTime(long now)` For CDQ
    `void` | `setOffset(int offset)` move the offset
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### _created

          protected final long _created

    - #### _expiration

          protected final long _expiration

    - #### _fragmentNumber

          protected int _fragmentNumber

    - #### _messageId

          protected final long _messageId

    - #### _offset

          protected volatile int _offset

    - #### _remaining

          protected final byte[] _remaining

    - #### _toRouter

          protected final Hash _toRouter

    - #### _toTunnel

          protected final TunnelId _toTunnel

  - ### Constructor Detail

    - #### PendingGatewayMessage

          public PendingGatewayMessage(I2NPMessage message,
                                       Hash toRouter,
                                       TunnelId toTunnel)

  - ### Method Detail

    - #### 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

    - #### drop

          public void drop()

      For CDQ
      Specified by:
        `drop` in interface `CDQEntry`

    - #### getData

          public byte[] getData()

      raw unfragmented message to send

    - #### getEnqueueTime

          public long getEnqueueTime()

      For CDQ
      Specified by:
        `getEnqueueTime` in interface `CDQEntry`

    - #### getExpiration

          public long getExpiration()

    - #### getFragmentNumber

          public int getFragmentNumber()

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

    - #### getLifetime

          public long getLifetime()

    - #### getMessageId

          public long getMessageId()

    - #### getMessageIds

          public List<Long> getMessageIds()

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

    - #### getOffset

          public int getOffset()

      index into the data to be sent

    - #### getToRouter

          public Hash getToRouter()

      may be null

    - #### getToTunnel

          public TunnelId getToTunnel()

      may be null

    - #### incrementFragmentNumber

          public void incrementFragmentNumber()

      ok, fragment sent, increment what the next will be

    - #### setEnqueueTime

          public void setEnqueueTime(long now)

      For CDQ
      Specified by:
        `setEnqueueTime` in interface `CDQEntry`

    - #### setOffset

          public void setOffset(int offset)

      move the offset

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`