net.i2p.router.message
Class OutboundClientMessageJobHelper

java.lang.Object
  extended by net.i2p.router.message.OutboundClientMessageJobHelper

 class OutboundClientMessageJobHelper
extends java.lang.Object

Handle a particular client message that is destined for a remote destination.


Constructor Summary
OutboundClientMessageJobHelper()
           
 
Method Summary
(package private) static PayloadGarlicConfig buildDataClove(RouterContext ctx, Payload data, Destination dest, long expiration)
          Build a clove that sends the payload to the destination
(package private) static PayloadGarlicConfig buildLeaseSetClove(RouterContext ctx, long expiration, LeaseSet replyLeaseSet)
          Build a clove that stores the leaseSet locally
(package private) static GarlicMessage createGarlicMessage(RouterContext ctx, long replyToken, long expiration, PublicKey recipientPK, PayloadGarlicConfig dataClove, Hash from, Destination dest, TunnelInfo replyTunnel, SessionKey wrappedKey, java.util.Set<SessionTag> wrappedTags, boolean requireAck, LeaseSet bundledReplyLeaseSet)
          Allow the app to specify the data clove directly, which enables OutboundClientMessage to resend the same payload (including expiration and unique id) in different garlics (down different tunnels) This is called from OCMOSJ
(package private) static GarlicMessage createGarlicMessage(RouterContext ctx, long replyToken, long expiration, PublicKey recipientPK, Payload data, Hash from, Destination dest, TunnelInfo replyTunnel, SessionKey wrappedKey, java.util.Set<SessionTag> wrappedTags, boolean requireAck, LeaseSet bundledReplyLeaseSet)
          Build a garlic message that will be delivered to the router on which the target is located.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutboundClientMessageJobHelper

OutboundClientMessageJobHelper()
Method Detail

createGarlicMessage

static GarlicMessage createGarlicMessage(RouterContext ctx,
                                         long replyToken,
                                         long expiration,
                                         PublicKey recipientPK,
                                         Payload data,
                                         Hash from,
                                         Destination dest,
                                         TunnelInfo replyTunnel,
                                         SessionKey wrappedKey,
                                         java.util.Set<SessionTag> wrappedTags,
                                         boolean requireAck,
                                         LeaseSet bundledReplyLeaseSet)
Build a garlic message that will be delivered to the router on which the target is located. Inside the message are two cloves: one containing the payload with instructions for delivery to the (now local) destination, and the other containing a DeliveryStatusMessage with instructions for delivery to an inbound tunnel of this router. How the DeliveryStatusMessage is wrapped can vary - it can be simply sent to a tunnel (as above), wrapped in a GarlicMessage and source routed a few hops before being tunneled, source routed the entire way back, or not wrapped at all - in which case the payload clove contains a SourceRouteBlock and a request for a reply. For now, its just a tunneled DeliveryStatusMessage Unused?

Parameters:
bundledReplyLeaseSet - if specified, the given LeaseSet will be packaged with the message (allowing much faster replies, since their netDb search will return almost instantly)
Returns:
garlic, or null if no tunnels were found (or other errors)

createGarlicMessage

static GarlicMessage createGarlicMessage(RouterContext ctx,
                                         long replyToken,
                                         long expiration,
                                         PublicKey recipientPK,
                                         PayloadGarlicConfig dataClove,
                                         Hash from,
                                         Destination dest,
                                         TunnelInfo replyTunnel,
                                         SessionKey wrappedKey,
                                         java.util.Set<SessionTag> wrappedTags,
                                         boolean requireAck,
                                         LeaseSet bundledReplyLeaseSet)
Allow the app to specify the data clove directly, which enables OutboundClientMessage to resend the same payload (including expiration and unique id) in different garlics (down different tunnels) This is called from OCMOSJ

Returns:
garlic, or null if no tunnels were found (or other errors)

buildDataClove

static PayloadGarlicConfig buildDataClove(RouterContext ctx,
                                          Payload data,
                                          Destination dest,
                                          long expiration)
Build a clove that sends the payload to the destination


buildLeaseSetClove

static PayloadGarlicConfig buildLeaseSetClove(RouterContext ctx,
                                              long expiration,
                                              LeaseSet replyLeaseSet)
Build a clove that stores the leaseSet locally