java.lang.Object
net.i2p.router.message.GarlicConfig
net.i2p.router.message.PayloadGarlicConfig

public class PayloadGarlicConfigextends GarlicConfig
A GarlicConfig that holds a single I2NPMessage payload with no sub-cloves.

This is the leaf node in the garlic clove tree. Every clove in an outbound GarlicMessage is a PayloadGarlicConfig wrapping one I2NPMessage (DataMessage, DeliveryStatusMessage, DatabaseStoreMessage, etc.) along with its delivery instructions.

Also used directly by netdb MessageWrapper and tunnel TestJob for single-clove garlic wrapping.

  • Field Details

    • _payload

      private final I2NPMessage _payload
      The message carried inside the clove.
  • Constructor Details

    • PayloadGarlicConfig

      public PayloadGarlicConfig(Certificate cert, long id, long expiration, DeliveryInstructions di, I2NPMessage message)
      Create a garlic config wrapping the given I2NP message payload.
      Parameters:
      cert - signing certificate identifying the destination this block is for
      id - the message ID
      expiration - the expiration time
      di - the delivery instructions
      message - the I2NP message payload
  • Method Details

    • getPayload

      public I2NPMessage getPayload()
      Specify the I2NP message to be sent - if this is set, no other cloves can be included in this block.
      Returns:
      the I2NP message payload
    • getSubData

      protected String getSubData()
      Description copied from class: GarlicConfig
      The sub-data included in the GarlicConfig.toString() output.
      Overrides:
      getSubData in class GarlicConfig
      Returns:
      sub-data string
    • addClove

      public void addClove(GarlicConfig config)
      Not supported for single-clove configs.
      Overrides:
      addClove in class GarlicConfig
      Parameters:
      config - the clove config to add
      Throws:
      UnsupportedOperationException - always, as a single-clove block holds no nested cloves
    • getCloveCount

      public int getCloveCount()
      Return zero, as this is a single-clove config.
      Overrides:
      getCloveCount in class GarlicConfig
      Returns:
      0, as a single-clove block never nests
    • getClove

      public GarlicConfig getClove(int index)
      Not supported for single-clove configs.
      Overrides:
      getClove in class GarlicConfig
      Parameters:
      index - the 0-based position in the clove list
      Returns:
      never returns, as a single-clove block holds no nested cloves
      Throws:
      UnsupportedOperationException - always, as a single-clove block holds no nested cloves
    • clearCloves

      public void clearCloves()
      No-op for single-clove configs.
      Overrides:
      clearCloves in class GarlicConfig