- All Implemented Interfaces:
Job, 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.
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LogLogger for this class.private final GarlicMessageThe garlic message being processed.private final longBloom mask for the local message id.private final longBloom mask for the router's message id.private final longBloom mask for the tunnel's message id.private static final intPriority of replies sent by the router.private static final intPriority of replies sent through the tunnel.Constructor Summary
ConstructorsConstructorDescriptionHandleGarlicMessageJob(RouterContext context, GarlicMessage msg, RouterIdentity from, Hash fromHash, long msgIDBloomXorLocal, long msgIDBloomXorRouter, long msgIDBloomXorTunnel) Job to handle an inbound garlic message received outside of a tunnel.Method Summary
All MethodsModifier and TypeMethodDescriptionvoiddropped()Called when this job has been dropped (e.g.getName()Returns a descriptive name for this job.voidhandleClove(DeliveryInstructions instructions, I2NPMessage data) Handle each garlic clove based on its delivery instructions.voidrunJob()Entry point for the job.Methods inherited from class JobImpl
getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toStringModifier and TypeMethodDescriptionfinal RouterContextThe router context that this job belongs to.longgetJobId()The unique job ID for this job.longThe timestamp when this job was last made ready for execution.The timing object for this job.voidmadeReady(long now) For JobQueue only, not for external use.protected voidrequeue(long delayMs) Requeue this job to run after the specified delay.toString()
Field Details
_log
Logger for this class._message
The garlic message being processed._msgIDBloomXorLocal
private final long _msgIDBloomXorLocalBloom mask for the local message id._msgIDBloomXorRouter
private final long _msgIDBloomXorRouterBloom mask for the router's message id._msgIDBloomXorTunnel
private final long _msgIDBloomXorTunnelBloom mask for the tunnel's message id.ROUTER_PRIORITY
private static final int ROUTER_PRIORITYPriority of replies sent by the router.- See Also:
TUNNEL_PRIORITY
private static final int TUNNEL_PRIORITYPriority of replies sent through the tunnel.- See Also:
Constructor Details
HandleGarlicMessageJob
public HandleGarlicMessageJob(RouterContext context, GarlicMessage msg, RouterIdentity from, Hash fromHash, long msgIDBloomXorLocal, long msgIDBloomXorRouter, long msgIDBloomXorTunnel) Job to handle an inbound garlic message received outside of a tunnel.- Parameters:
context- router context providing core servicesmsg- garlic message to processfrom- sending router identity (sender identity)fromHash- sending router hash (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 messages
Method Details
getName
runJob
handleClove
Handle each garlic clove based on its delivery instructions.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.
- Specified by:
handleClovein interfaceGarlicMessageReceiver.CloveReceiver- Parameters:
instructions- Delivery instructions specifying the target for this clove.data- The message contained in the clove.
dropped