net.i2p.i2ptunnel
Class TunnelController

java.lang.Object
  extended by net.i2p.i2ptunnel.TunnelController
All Implemented Interfaces:
Logging

public class TunnelController
extends java.lang.Object
implements Logging

Coordinate the runtime operation and configuration of a tunnel. These objects are bundled together under a TunnelControllerGroup where the entire group is stored / loaded from a single config file.


Constructor Summary
TunnelController(java.util.Properties config, java.lang.String prefix)
          Create a new controller for a tunnel out of the specific config options.
TunnelController(java.util.Properties config, java.lang.String prefix, boolean createKey)
           
 
Method Summary
 java.util.List<java.lang.String> clearMessages()
          Pull off any messages that the I2PTunnel has produced
 java.lang.String getClientOptions()
           
 java.util.Properties getConfig(java.lang.String prefix)
           
 java.lang.String getDescription()
           
 java.lang.String getI2CPHost()
           
 java.lang.String getI2CPPort()
           
 boolean getIsRunning()
           
 boolean getIsStandby()
          if running but no open sessions, we are in standby
 boolean getIsStarting()
           
 java.lang.String getListenOnInterface()
           
 java.lang.String getListenPort()
           
 java.lang.String getMyDestHashBase32()
           
 java.lang.String getMyDestination()
           
 java.lang.String getName()
           
 boolean getPersistentClientKey()
           
 java.lang.String getPrivKeyFile()
           
 java.lang.String getProxyList()
           
 java.lang.String getSharedClient()
          default true
 java.lang.String getSpoofedHost()
           
 boolean getStartOnLoad()
          default true
 void getSummary(java.lang.StringBuilder buf)
           
 java.lang.String getTargetDestination()
           
 java.lang.String getTargetHost()
           
 java.lang.String getTargetPort()
           
 java.lang.String getType()
           
 void log(java.lang.String s)
           
 void restartTunnel()
           
 void setConfig(java.util.Properties config, java.lang.String prefix)
           
 void startTunnel()
          Start up the tunnel (if it isn't already running)
 void startTunnelBackground()
           
 void stopTunnel()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TunnelController

public TunnelController(java.util.Properties config,
                        java.lang.String prefix)
Create a new controller for a tunnel out of the specific config options. The config may contain a large number of options - only ones that begin in the prefix should be used (and, in turn, that prefix should be stripped off before being interpreted by this controller)

Parameters:
config - original key=value mapping
prefix - beginning of key values that are relevent to this tunnel

TunnelController

public TunnelController(java.util.Properties config,
                        java.lang.String prefix,
                        boolean createKey)
Parameters:
createKey - for servers, whether we want to create a brand new destination with private keys at the location specified or not (does not overwrite existing ones)
Method Detail

startTunnelBackground

public void startTunnelBackground()

startTunnel

public void startTunnel()
Start up the tunnel (if it isn't already running)


stopTunnel

public void stopTunnel()

restartTunnel

public void restartTunnel()

setConfig

public void setConfig(java.util.Properties config,
                      java.lang.String prefix)

getConfig

public java.util.Properties getConfig(java.lang.String prefix)

getType

public java.lang.String getType()

getName

public java.lang.String getName()

getDescription

public java.lang.String getDescription()

getI2CPHost

public java.lang.String getI2CPHost()

getI2CPPort

public java.lang.String getI2CPPort()

getClientOptions

public java.lang.String getClientOptions()

getListenOnInterface

public java.lang.String getListenOnInterface()

getTargetHost

public java.lang.String getTargetHost()

getTargetPort

public java.lang.String getTargetPort()

getSpoofedHost

public java.lang.String getSpoofedHost()

getPrivKeyFile

public java.lang.String getPrivKeyFile()

getListenPort

public java.lang.String getListenPort()

getTargetDestination

public java.lang.String getTargetDestination()

getProxyList

public java.lang.String getProxyList()

getSharedClient

public java.lang.String getSharedClient()
default true


getStartOnLoad

public boolean getStartOnLoad()
default true


getPersistentClientKey

public boolean getPersistentClientKey()

getMyDestination

public java.lang.String getMyDestination()

getMyDestHashBase32

public java.lang.String getMyDestHashBase32()

getIsRunning

public boolean getIsRunning()

getIsStarting

public boolean getIsStarting()

getIsStandby

public boolean getIsStandby()
if running but no open sessions, we are in standby


getSummary

public void getSummary(java.lang.StringBuilder buf)

log

public void log(java.lang.String s)
Specified by:
log in interface Logging

clearMessages

public java.util.List<java.lang.String> clearMessages()
Pull off any messages that the I2PTunnel has produced

Returns:
list of messages pulled off (each is a String, earliest first)