java.lang.Object
net.i2p.router.JobImpl
net.i2p.router.message.SendMessageDirectJob
All Implemented Interfaces:
Job

public class SendMessageDirectJobextends JobImpl
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.

  • 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 context
      message - the message to send
      toPeer - may be ourselves
      timeoutMs - milliseconds to wait for delivery; under 5000 is raised to 10000
      priority - 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 context
      message - the message to send
      toPeer - may be ourselves
      timeoutMs - milliseconds to wait for delivery; under 5000 is raised to 10000
      priority - the OutNetMessage priority, one of the MessageContext constants
      msgIDBloomXor - 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 context
      message - the message to send
      toPeer - may be ourselves
      onSuccess - may be null
      onFail - may be null
      selector - selects which reply triggers onSuccess, or null to accept any reply
      timeoutMs - milliseconds to wait for delivery; under 5000 is raised to 10000
      priority - 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 context
      message - the message to send
      toPeer - may be ourselves
      onSuccess - may be null
      onFail - may be null
      selector - selects which reply triggers onSuccess, or null to accept any reply
      timeoutMs - milliseconds to wait for delivery; under 5000 is raised to 10000
      priority - the OutNetMessage priority, one of the MessageContext constants
      msgIDBloomXor - 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 context
      message - the message to send
      toPeer - may be ourselves
      onSend - may be null
      onSuccess - may be null
      onFail - may be null
      selector - selects which reply triggers onSuccess, or null to accept any reply
      timeoutMs - milliseconds to wait for delivery; under 5000 is raised to 10000
      priority - the OutNetMessage priority, one of the MessageContext constants
      msgIDBloomXor - value to xor the messageID with before passing to the InNetMessagePool, may be 0
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Job
      Descriptive name of the task.
      Returns:
      the descriptive name of the task
    • runJob

      public void runJob()
      Description copied from interface: Job
      Actually perform the task. This call blocks until the Job is complete.