net.i2p.router.transport.ntcp

## Interface NTCP2Payload.PayloadCallback

- All Known Implementing Classes:
    InboundEstablishState
  Enclosing class:
    NTCP2Payload

      public static interface NTCP2Payload.PayloadCallback

  For all callbacks, recommend throwing exceptions only from the handshake. Exceptions will get thrown out of processPayload() and prevent processing of succeeding blocks.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `gotDateTime(long time)`
    `void` | `gotI2NP(I2NPMessage msg)`
    `void` | `gotOptions(byte[] options, boolean isHandshake)`
    `void` | `gotPadding(int paddingLength, int frameLength)` For stats.
    `void` | `gotRI(RouterInfo ri, boolean isHandshake, boolean flood)`
    `void` | `gotTermination(int reason, long lastReceived)`
    `void` | `gotUnknown(int type, int len)`

- - ### Method Detail

    - #### gotDateTime

          void gotDateTime(long time)
                    throws DataFormatException

      Throws:
        `DataFormatException`

    - #### gotI2NP

          void gotI2NP(I2NPMessage msg)
                throws I2NPMessageException

      Throws:
        `I2NPMessageException`

    - #### gotOptions

          void gotOptions(byte[] options,
                          boolean isHandshake)
                   throws DataFormatException

      Parameters:
        `isHandshake` - true only for message 3 part 2
      Throws:
        `DataFormatException`

    - #### gotPadding

          void gotPadding(int paddingLength,
                          int frameLength)

      For stats.
      Parameters:
        `paddingLength` - the number of padding bytes, not including the 3-byte block header
        `frameLength` - the total size of the frame, including all blocks and block headers

    - #### gotRI

          void gotRI(RouterInfo ri,
                     boolean isHandshake,
                     boolean flood)
              throws DataFormatException

      Parameters:
        `ri` - will already be validated
        `isHandshake` - true only for message 3 part 2
      Throws:
        `DataFormatException`

    - #### gotTermination

          void gotTermination(int reason,
                              long lastReceived)

      Parameters:
        `lastReceived` - in theory could wrap around to negative, but very unlikely

    - #### gotUnknown

          void gotUnknown(int type,
                          int len)