public class HandleGarlicMessageJob extends JobImpl implements GarlicMessageReceiver.CloveReceiver
Decrypts the garlic message and processes each contained clove. Local-message cloves are added directly to the inbound message pool, while cloves destined for other routers or tunnels are forwarded accordingly.
This class handles garlic messages received directly (not down a tunnel), e.g., in floodfill routers receiving network database messages.
Implements GarlicMessageReceiver.CloveReceiver to receive and process individual cloves.
Public visibility is necessary for integration with the job queue system.
| Constructor and Description |
|---|
HandleGarlicMessageJob(RouterContext context,
GarlicMessage msg,
RouterIdentity from,
Hash fromHash,
long msgIDBloomXorLocal,
long msgIDBloomXorRouter,
long msgIDBloomXorTunnel)
Constructs a job to handle an inbound garlic message.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dropped()
Called when this job has been dropped (e.g.
|
String |
getName()
Returns a descriptive name for this job.
|
void |
handleClove(DeliveryInstructions instructions,
I2NPMessage data)
Handle each garlic clove based on its delivery instructions.
|
void |
runJob()
Entry point for the job.
|
getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toStringpublic HandleGarlicMessageJob(RouterContext context, GarlicMessage msg, RouterIdentity from, Hash fromHash, long msgIDBloomXorLocal, long msgIDBloomXorRouter, long msgIDBloomXorTunnel)
context - router context providing core servicesmsg - garlic message to processfrom - ignored (sender identity)fromHash - ignored (sender hash)msgIDBloomXorLocal - long unique to router/session for XOR with message ID in local inbound messagesmsgIDBloomXorRouter - long unique to router/session for XOR with message ID in router-targeted messagesmsgIDBloomXorTunnel - long unique to router/session for XOR with message ID in tunnel-targeted messagespublic void dropped()
public String getName()
public void handleClove(DeliveryInstructions instructions, I2NPMessage data)
Local delivery cloves are added to the inbound message pool with a XOR mask for the message ID. Router delivery cloves are either queued locally or forwarded directly. Tunnel delivery cloves are wrapped in a TunnelGatewayMessage and forwarded.
handleClove in interface GarlicMessageReceiver.CloveReceiverinstructions - Delivery instructions specifying the target for this clove.data - The message contained in the clove.