net.i2p.router.tunnel
Class TunnelCreatorConfig

java.lang.Object
  extended bynet.i2p.router.tunnel.TunnelCreatorConfig
All Implemented Interfaces:
TunnelInfo
Direct Known Subclasses:
PooledTunnelCreatorConfig

public class TunnelCreatorConfig
extends java.lang.Object
implements TunnelInfo

Coordinate the info that the tunnel creator keeps track of, including what peers are in the tunnel and what their configuration is


Constructor Summary
TunnelCreatorConfig(int length, boolean isInbound)
           
TunnelCreatorConfig(int length, boolean isInbound, Hash destination)
           
 
Method Summary
(package private) static java.lang.String format(long date)
           
 HopConfig getConfig(int hop)
          retrieve the config for the given hop.
 Hash getDestination()
          if this is a client tunnel, what destination is it for?
 long getExpiration()
           
 int getLength()
          how many hops are there in the tunnel?
 java.util.Properties getOptions()
           
 Hash getPeer(int hop)
          retrieve the peer at the given hop.
 long getProcessedMessagesCount()
           
 TunnelId getReceiveTunnelId(int hop)
          retrieve the tunnelId that the given hop receives messages on.
 TunnelId getSendTunnelId(int hop)
          retrieve the tunnelId that the given hop sends messages on.
 void incrementProcessedMessages()
          take note of a message being pumped through this tunnel
 boolean isInbound()
          is this an inbound tunnel?
 void setExpiration(long when)
           
 void setPeer(int hop, Hash peer)
           
 void testSuccessful(int ms)
          take note that the tunnel was able to measurably Do Good in the given time
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TunnelCreatorConfig

public TunnelCreatorConfig(int length,
                           boolean isInbound)

TunnelCreatorConfig

public TunnelCreatorConfig(int length,
                           boolean isInbound,
                           Hash destination)
Method Detail

getLength

public int getLength()
how many hops are there in the tunnel?

Specified by:
getLength in interface TunnelInfo

getOptions

public java.util.Properties getOptions()

getConfig

public HopConfig getConfig(int hop)
retrieve the config for the given hop. the gateway is hop 0.


getReceiveTunnelId

public TunnelId getReceiveTunnelId(int hop)
retrieve the tunnelId that the given hop receives messages on. the gateway is hop 0.

Specified by:
getReceiveTunnelId in interface TunnelInfo

getSendTunnelId

public TunnelId getSendTunnelId(int hop)
retrieve the tunnelId that the given hop sends messages on. the gateway is hop 0.

Specified by:
getSendTunnelId in interface TunnelInfo

getPeer

public Hash getPeer(int hop)
retrieve the peer at the given hop. the gateway is hop 0

Specified by:
getPeer in interface TunnelInfo

setPeer

public void setPeer(int hop,
                    Hash peer)

isInbound

public boolean isInbound()
is this an inbound tunnel?

Specified by:
isInbound in interface TunnelInfo

getDestination

public Hash getDestination()
if this is a client tunnel, what destination is it for?

Specified by:
getDestination in interface TunnelInfo

getExpiration

public long getExpiration()
Specified by:
getExpiration in interface TunnelInfo

setExpiration

public void setExpiration(long when)

testSuccessful

public void testSuccessful(int ms)
Description copied from interface: TunnelInfo
take note that the tunnel was able to measurably Do Good in the given time

Specified by:
testSuccessful in interface TunnelInfo

incrementProcessedMessages

public void incrementProcessedMessages()
take note of a message being pumped through this tunnel


getProcessedMessagesCount

public long getProcessedMessagesCount()
Specified by:
getProcessedMessagesCount in interface TunnelInfo

toString

public java.lang.String toString()

format

static java.lang.String format(long date)