net.i2p.router.tunnel

## Class TunnelGatewayZeroHop

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

-     public class TunnelGatewayZeroHop
      extends TunnelGateway

  Serve as the gatekeeper for a tunnel with no hops.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class net.i2p.router.tunnel.TunnelGateway

      `TunnelGateway.Pending, TunnelGateway.PendingImpl, TunnelGateway.QueuePreprocessor, TunnelGateway.Receiver, TunnelGateway.Sender`

  - ### Field Summary

    - ### Fields inherited from class net.i2p.router.tunnel.TunnelGateway

      `_context, _delayedFlush, _flushFrequency, _lastFlush, _log, _messagesSent, _preprocessor, _queue, _receiver, _sender`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TunnelGatewayZeroHop(RouterContext context, TunnelCreatorConfig config)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(I2NPMessage msg, Hash toRouter, TunnelId toTunnel)` Add a message to be sent down the tunnel (immediately forwarding it to the `InboundMessageDistributor` or `OutboundMessageDistributor`, as necessary).
    `void` | `add(TunnelGatewayMessage msg)` Add a message to be sent down the tunnel, where we are the inbound gateway.

    - ### Methods inherited from class net.i2p.router.tunnel.TunnelGateway

      `getMessagesSent`

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

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

- - ### Constructor Detail

    - #### TunnelGatewayZeroHop

          public TunnelGatewayZeroHop(RouterContext context,
                              TunnelCreatorConfig config)

  - ### Method Detail

    - #### add

          public void add(TunnelGatewayMessage msg)

      Add a message to be sent down the tunnel, where we are the inbound gateway.
      Overrides:
        `add` in class `TunnelGateway`
      Parameters:
        `msg` - message received to be sent through the tunnel

    - #### add

          public void add(I2NPMessage msg,
                 Hash toRouter,
                 TunnelId toTunnel)

      Add a message to be sent down the tunnel (immediately forwarding it to the `InboundMessageDistributor` or `OutboundMessageDistributor`, as necessary).
      Overrides:
        `add` in class `TunnelGateway`
      Parameters:
        `msg` - message to be sent through the tunnel
        `toRouter` - router to send to after the endpoint (or null for endpoint processing)
        `toTunnel` - tunnel to send to after the endpoint (or null for endpoint or router processing)