net.i2p.router.transport

## Class OutboundMessageRegistry

- java.lang.Object
- - net.i2p.router.transport.OutboundMessageRegistry

-     public class OutboundMessageRegistry
      extends Object

  Tracks outbound messages.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `OutboundMessageRegistry(RouterContext context)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<OutNetMessage>` | `getOriginalMessages(I2NPMessage message)` Retrieve all messages that are waiting for the specified message.
    `OutNetMessage` | `registerPending(MessageSelector replySelector, ReplyJob onReply, Job onTimeout)` Registers a new, empty OutNetMessage, with the reply and timeout jobs specified.
    `void` | `registerPending(OutNetMessage msg)` Register the message.
    `void` | `restart()`
    `void` | `shutdown()` Does something @since 0.8.8
    `void` | `unregisterPending(OutNetMessage msg)`

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

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

- - ### Constructor Detail

    - #### OutboundMessageRegistry

          public OutboundMessageRegistry(RouterContext context)

  - ### Method Detail

    - #### getOriginalMessages

          public List<OutNetMessage> getOriginalMessages(I2NPMessage message)

      Retrieve all messages that are waiting for the specified message. In addition, those matches may include instructions to either continue or not continue waiting for further replies - if it should continue, the matched message remains in the registry, but if it shouldn't continue, the matched message is removed from the registry. This is called only by InNetMessagePool.
      Parameters:
        `message` - Payload received that may be a reply to something we sent
      Returns:
        non-null List of OutNetMessage describing messages that were waiting for the payload

    - #### registerPending

          public OutNetMessage registerPending(MessageSelector replySelector,
                                               ReplyJob onReply,
                                               Job onTimeout)

      Registers a new, empty OutNetMessage, with the reply and timeout jobs specified. The onTimeout job is called at replySelector.getExpiration() (if no reply is received by then)
      Parameters:
        `replySelector` - non-null; The same selector may be used for more than one message.
        `onReply` - non-null
        `onTimeout` - may be null
      Returns:
        a dummy OutNetMessage where getMessage() is null. Use it to call unregisterPending() later if desired.

    - #### registerPending

          public void registerPending(OutNetMessage msg)

      Register the message. Each message must have a non-null selector at msg.getReplySelector(). The same selector may be used for more than one message.
      Parameters:
        `msg` - msg.getMessage() and msg.getReplySelector() must be non-null

    - #### restart

          public void restart()

    - #### shutdown

          public void shutdown()

      Does something @since 0.8.8

    - #### unregisterPending

          public void unregisterPending(OutNetMessage msg)

      Parameters:
        `msg` - may be be null, if non-null should have a non-null selector