java.lang.Object
net.i2p.router.message.GarlicConfig
net.i2p.router.message.PayloadGarlicConfig
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 Summary
FieldsConstructor Summary
ConstructorsConstructorDescriptionPayloadGarlicConfig(Certificate cert, long id, long expiration, DeliveryInstructions di, I2NPMessage message) Create a garlic config wrapping the given I2NP message payload.Method Summary
Public MethodsModifier and TypeMethodDescriptionvoidaddClove(GarlicConfig config) Not supported for single-clove configs.voidNo-op for single-clove configs.getClove(int index) Not supported for single-clove configs.intReturn zero, as this is a single-clove config.Specify the I2NP message to be sent - if this is set, no other cloves can be included in this block.protected StringThe sub-data included in theGarlicConfig.toString()output.Methods inherited from class GarlicConfig
getCertificate, getDeliveryInstructions, getExpiration, getId, getRecipient, getRecipientPublicKey, setRecipient, setRecipientPublicKey, toStringModifier and TypeMethodDescriptionCertificate for theGarlicConfig.getRecipient()to pay for their processing.Specify how the I2NPMessage in the clove should be handled.longExpiration of the clove, after which it should be dropped.longgetId()Unique ID of the clove.The router that should receive and process this clove.The public key of the router that should receive and process this clove.voidsetRecipient(RouterInfo info) Router to receive and process this clove.voidsetRecipientPublicKey(PublicKey recipientPublicKey) Public key of the router to receive and process this clove.toString()
Field Details
_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 forid- the message IDexpiration- the expiration timedi- the delivery instructionsmessage- the I2NP message payload
Method Details
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
Description copied from class:GarlicConfigThe sub-data included in theGarlicConfig.toString()output.- Overrides:
getSubDatain classGarlicConfig- Returns:
- sub-data string
addClove
Not supported for single-clove configs.- Overrides:
addClovein classGarlicConfig- 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:
getCloveCountin classGarlicConfig- Returns:
- 0, as a single-clove block never nests
getClove
Not supported for single-clove configs.- Overrides:
getClovein classGarlicConfig- 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