java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.message.SendMessageDirectJob
- All Implemented Interfaces:
Job
Send a message directly to another router (not through a tunnel).
Used by HandleGarlicMessageJob to forward decrypted cloves to their target router or tunnel gateway. Also used by netdb for database store/lookup replies.
Safe to run inline via runJob(). If the RouterInfo for the Hash is not found locally, it will queue a lookup and register itself to be run again when the lookup succeeds or times out.
Field Summary
Constructor Summary
ConstructorsConstructorDescriptionSendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, int timeoutMs, int priority) Send a message directly to a peer.SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, int timeoutMs, int priority, long msgIDBloomXor) Send a message directly to a peer with an XOR mask.SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, Job onSend, ReplyJob onSuccess, Job onFail, MessageSelector selector, int timeoutMs, int priority, long msgIDBloomXor) Send a message directly to a peer with full options.SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, ReplyJob onSuccess, Job onFail, MessageSelector selector, int timeoutMs, int priority) Send a message directly to a peer with reply handling.SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, ReplyJob onSuccess, Job onFail, MessageSelector selector, int timeoutMs, int priority, long msgIDBloomXor) Send a message directly to a peer with reply handling and XOR mask.Method Summary
All MethodsMethods inherited from class JobImpl
dropped, getContext, getJobId, getMadeReadyOn, getTiming, madeReady, requeue, toStringModifier and TypeMethodDescriptionvoiddropped()Default implementation does nothing.final 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()
Constructor Details
SendMessageDirectJob
public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, int timeoutMs, int priority) Send a message directly to a peer.- Parameters:
ctx- the router contextmessage- the message to sendtoPeer- may be ourselvestimeoutMs- milliseconds to wait for delivery; under 5000 is raised to 10000priority- the OutNetMessage priority, one of the MessageContext constants
SendMessageDirectJob
public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, int timeoutMs, int priority, long msgIDBloomXor) Send a message directly to a peer with an XOR mask.- Parameters:
ctx- the router contextmessage- the message to sendtoPeer- may be ourselvestimeoutMs- milliseconds to wait for delivery; under 5000 is raised to 10000priority- the OutNetMessage priority, one of the MessageContext constantsmsgIDBloomXor- value to xor the messageID with before passing to the InNetMessagePool, may be 0
SendMessageDirectJob
public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, ReplyJob onSuccess, Job onFail, MessageSelector selector, int timeoutMs, int priority) Send a message directly to a peer with reply handling.- Parameters:
ctx- the router contextmessage- the message to sendtoPeer- may be ourselvesonSuccess- may be nullonFail- may be nullselector- selects which reply triggers onSuccess, or null to accept any replytimeoutMs- milliseconds to wait for delivery; under 5000 is raised to 10000priority- the OutNetMessage priority, one of the MessageContext constants
SendMessageDirectJob
public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, ReplyJob onSuccess, Job onFail, MessageSelector selector, int timeoutMs, int priority, long msgIDBloomXor) Send a message directly to a peer with reply handling and XOR mask.- Parameters:
ctx- the router contextmessage- the message to sendtoPeer- may be ourselvesonSuccess- may be nullonFail- may be nullselector- selects which reply triggers onSuccess, or null to accept any replytimeoutMs- milliseconds to wait for delivery; under 5000 is raised to 10000priority- the OutNetMessage priority, one of the MessageContext constantsmsgIDBloomXor- value to xor the messageID with before passing to the InNetMessagePool, may be 0
SendMessageDirectJob
public SendMessageDirectJob(RouterContext ctx, I2NPMessage message, Hash toPeer, Job onSend, ReplyJob onSuccess, Job onFail, MessageSelector selector, int timeoutMs, int priority, long msgIDBloomXor) Send a message directly to a peer with full options.- Parameters:
ctx- the router contextmessage- the message to sendtoPeer- may be ourselvesonSend- may be nullonSuccess- may be nullonFail- may be nullselector- selects which reply triggers onSuccess, or null to accept any replytimeoutMs- milliseconds to wait for delivery; under 5000 is raised to 10000priority- the OutNetMessage priority, one of the MessageContext constantsmsgIDBloomXor- value to xor the messageID with before passing to the InNetMessagePool, may be 0
Method Details
getName
runJob
public void runJob()Description copied from interface:JobActually perform the task. This call blocks until the Job is complete.