net.i2p.i2ptunnel

## Class TunnelController

- java.lang.Object
- - net.i2p.i2ptunnel.TunnelController

- All Implemented Interfaces:
    Logging

      public class TunnelController
      extends Object
      implements Logging

  Coordinate the runtime operation and configuration of a single I2PTunnel. An I2PTunnel tracks one or more I2PTunnelTasks and one or more I2PSessions. Usually one of each. These objects are bundled together under a TunnelControllerGroup where the entire group is stored / loaded from a single config file. This is the class used by several plugins to create tunnels, so take care to maintain the public methods as a stable API.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `TunnelController.TunnelState`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_MAX_CONNS_DAY`
    `static int` | `DEFAULT_MAX_CONNS_HOUR`
    `static int` | `DEFAULT_MAX_CONNS_MIN`
    `static int` | `DEFAULT_MAX_STREAMS`
    `static int` | `DEFAULT_MAX_TOTAL_CONNS_DAY`
    `static int` | `DEFAULT_MAX_TOTAL_CONNS_HOUR`
    `static int` | `DEFAULT_MAX_TOTAL_CONNS_MIN`
    `static int` | `DEFAULT_SHUTDOWN_DELAY_MAX` Default maximum shutdown delay in seconds
    `static int` | `DEFAULT_SHUTDOWN_DELAY_MIN` Default minimum shutdown delay in seconds
    `static int` | `DEFAULT_STARTUP_DELAY_MAX` Default maximum startup delay in seconds
    `static int` | `DEFAULT_STARTUP_DELAY_MIN` Default minimum startup delay in seconds
    `static String` | `KEY_BACKUP_DIR`
    `static String` | `OPT_BUNDLE_REPLY`
    `static String` | `OPT_POST_MAX`
    `static String` | `OPT_POST_TOTAL_MAX`
    `static String` | `PFX_OPTION`
    `static SigType` | `PREFERRED_SIGTYPE` This is guaranteed to be available.
    `static String` | `PROP_CONFIG_FILE`
    `static String` | `PROP_DESCR` all of these @since 0.9.14
    `static String` | `PROP_DEST`
    `static String` | `PROP_FILE`
    `static String` | `PROP_FILTER`
    `static String` | `PROP_I2CP_HOST`
    `static String` | `PROP_I2CP_PORT`
    `static String` | `PROP_INTFC`
    `static String` | `PROP_LIMIT_ACTION`
    `static String` | `PROP_LIMITS_SET`
    `static String` | `PROP_LISTEN_PORT`
    `static String` | `PROP_MAX_CONNS_DAY`
    `static String` | `PROP_MAX_CONNS_HOUR`
    `static String` | `PROP_MAX_CONNS_MIN` all of these are @since 0.9.33 (moved from TunnelConfig)
    `static String` | `PROP_MAX_STREAMS`
    `static String` | `PROP_MAX_TOTAL_CONNS_DAY`
    `static String` | `PROP_MAX_TOTAL_CONNS_HOUR`
    `static String` | `PROP_MAX_TOTAL_CONNS_MIN`
    `static String` | `PROP_NAME`
    `static String` | `PROP_PROXIES`
    `static String` | `PROP_SHARED`
    `static String` | `PROP_SHUTDOWN_DELAY_MAX` Configuration property for the maximum shutdown delay in seconds.
    `static String` | `PROP_SHUTDOWN_DELAY_MIN` Configuration property for the minimum shutdown delay in seconds.
    `static String` | `PROP_SPOOFED_HOST`
    `static String` | `PROP_START`
    `static String` | `PROP_STARTUP_DELAY_MAX` Configuration property for the maximum startup delay in seconds.
    `static String` | `PROP_STARTUP_DELAY_MIN` Configuration property for the minimum startup delay in seconds.
    `static String` | `PROP_TARGET_HOST`
    `static String` | `PROP_TARGET_PORT`
    `static String` | `PROP_TUN_GZIP`
    `static String` | `PROP_TYPE`
    `static String` | `TYPE_CONNECT` all of these @since 0.9.14
    `static String` | `TYPE_HTTP_BIDIR_SERVER`
    `static String` | `TYPE_HTTP_CLIENT`
    `static String` | `TYPE_HTTP_SERVER`
    `static String` | `TYPE_IRC_CLIENT`
    `static String` | `TYPE_IRC_SERVER`
    `static String` | `TYPE_SOCKS`
    `static String` | `TYPE_SOCKS_IRC`
    `static String` | `TYPE_STD_CLIENT`
    `static String` | `TYPE_STD_SERVER`
    `static String` | `TYPE_STREAMR_CLIENT` Client in the UI and I2P side but a server on the localhost side
    `static String` | `TYPE_STREAMR_SERVER` Server in the UI and I2P side but a client on the localhost side

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TunnelController(Properties config, String prefix)` Create a new controller for a tunnel out of the specific config options.
    `TunnelController(Properties config, String prefix, boolean createKey)` Create a new controller for a tunnel out of the specific config options.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `changeState(TunnelController.TunnelState state)`
    `List<String>` | `clearMessages()` Pull off any messages that the I2PTunnel has produced
    `void` | `destroyTunnel()` May NOT be restarted with restartTunnel() or startTunnel() later.
    `(package private) static File` | `filenameToFile(String f)` Does not necessarily exist.
    `File` | `getAlternatePrivateKeyFile()` Does not necessarily exist.
    `Properties` | `getClientOptionProps()` These are the ones stored with a prefix of "option." Defaults in config properties are not honored.
    `Properties` | `getConfig(String prefix)`
    `File` | `getConfigFile()`
    `String` | `getDescription()`
    `Destination` | `getDestination()` Returns null if not running.
    `String` | `getFilter()` Absolute path to filter definition file
    `String` | `getI2CPHost()`
    `String` | `getI2CPPort()`
    `boolean` | `getIsOfflineKeys()` Returns false if not running.
    `boolean` | `getIsRunning()` Checks if the tunnel is currently running.
    `boolean` | `getIsStandby()` Checks if the tunnel is in standby mode.
    `boolean` | `getIsStarting()` Checks if the tunnel is starting or starting on load.
    `String` | `getListenOnInterface()`
    `String` | `getListenPort()`
    `String` | `getMyDestHashBase32()` Returns null if not running.
    `String` | `getMyDestination()` Returns null if not running.
    `String` | `getName()`
    `boolean` | `getPersistentClientKey()`
    `File` | `getPrivateKeyFile()` Does not necessarily exist.
    `String` | `getPrivKeyFile()` Probably not absolute.
    `String` | `getProxyList()`
    `int` | `getRemainingStartupDelay()` Get the remaining startup delay time for tunnels with delayed startup.
    `String` | `getSharedClient()` default true for clients, always false for servers
    `int` | `getShutdownDelayMax()` When combined with a positive shutdownDelayMin less than this value, the tunnel will stop with a random delay between min and max seconds during router shutdown.
    `int` | `getShutdownDelayMin()` When combined with a greater shutdownDelayMax, the tunnel will stop with a random delay between min and max seconds during router shutdown.
    `String` | `getSpoofedHost()`
    `boolean` | `getStartOnLoad()`
    `int` | `getStartupDelayMax()` When combined with a positive startupDelayMin less than this value, the tunnel will start with a random delay between min and max seconds.
    `int` | `getStartupDelayMin()` When combined with a greater startupDelayMax, the tunnel will start with a random delay between min and max seconds.
    `TunnelController.TunnelState` | `getState()` Gets the current tunnel state.
    `String` | `getTargetDestination()`
    `String` | `getTargetHost()`
    `String` | `getTargetPort()`
    `I2PTunnel` | `getTunnel()` The I2PTunnel
    `String` | `getType()`
    `boolean` | `isClient()` Is it a client or server in the UI and I2P side? Note that a streamr client is a UI and I2P client but a server on the localhost side.
    `static boolean` | `isClient(String type)` Is it a client or server in the UI and I2P side? Note that a streamr client is a UI and I2P client but a server on the localhost side.
    `void` | `log(String s)`
    `void` | `restartTunnel()` Stops and restarts the tunnel.
    `void` | `setConfig(Properties config, String prefix)` As of 0.9.1, updates the options on an existing session
    `void` | `setConfigFile(File file)` Set the config file.
    `(package private) void` | `setStartupDelayEndTime(long delayMs)` Set the startup delay end time.
    `void` | `startTunnel()` Start up the tunnel (if it isn't already running)
    `void` | `startTunnelBackground()` Starts the tunnel in a background thread.
    `void` | `stopTunnel()` May be restarted with restartTunnel() or startTunnel() later.
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### DEFAULT_MAX_CONNS_DAY

          public static final int DEFAULT_MAX_CONNS_DAY

      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_CONNS_HOUR

          public static final int DEFAULT_MAX_CONNS_HOUR

      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_CONNS_MIN

          public static final int DEFAULT_MAX_CONNS_MIN

      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_STREAMS

          public static final int DEFAULT_MAX_STREAMS

      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_TOTAL_CONNS_DAY

          public static final int DEFAULT_MAX_TOTAL_CONNS_DAY

      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_TOTAL_CONNS_HOUR

          public static final int DEFAULT_MAX_TOTAL_CONNS_HOUR

      See Also:
        Constant Field Values

    - #### DEFAULT_MAX_TOTAL_CONNS_MIN

          public static final int DEFAULT_MAX_TOTAL_CONNS_MIN

      See Also:
        Constant Field Values

    - #### DEFAULT_SHUTDOWN_DELAY_MAX

          public static final int DEFAULT_SHUTDOWN_DELAY_MAX

      Default maximum shutdown delay in seconds
      See Also:
        Constant Field Values

    - #### DEFAULT_SHUTDOWN_DELAY_MIN

          public static final int DEFAULT_SHUTDOWN_DELAY_MIN

      Default minimum shutdown delay in seconds
      See Also:
        Constant Field Values

    - #### DEFAULT_STARTUP_DELAY_MAX

          public static final int DEFAULT_STARTUP_DELAY_MAX

      Default maximum startup delay in seconds
      See Also:
        Constant Field Values

    - #### DEFAULT_STARTUP_DELAY_MIN

          public static final int DEFAULT_STARTUP_DELAY_MIN

      Default minimum startup delay in seconds
      See Also:
        Constant Field Values

    - #### KEY_BACKUP_DIR

          public static final String KEY_BACKUP_DIR

      See Also:
        Constant Field Values

    - #### OPT_BUNDLE_REPLY

          public static final String OPT_BUNDLE_REPLY

      See Also:
        Constant Field Values

    - #### OPT_POST_MAX

          public static final String OPT_POST_MAX

      See Also:
        Constant Field Values

    - #### OPT_POST_TOTAL_MAX

          public static final String OPT_POST_TOTAL_MAX

      See Also:
        Constant Field Values

    - #### PFX_OPTION

          public static final String PFX_OPTION

      See Also:
        Constant Field Values

    - #### PREFERRED_SIGTYPE

          public static final SigType PREFERRED_SIGTYPE

      This is guaranteed to be available.

    - #### PROP_CONFIG_FILE

          public static final String PROP_CONFIG_FILE

      See Also:
        Constant Field Values

    - #### PROP_DESCR

          public static final String PROP_DESCR

      all of these @since 0.9.14
      See Also:
        Constant Field Values

    - #### PROP_DEST

          public static final String PROP_DEST

      See Also:
        Constant Field Values

    - #### PROP_FILE

          public static final String PROP_FILE

      See Also:
        Constant Field Values

    - #### PROP_FILTER

          public static final String PROP_FILTER

      See Also:
        Constant Field Values

    - #### PROP_I2CP_HOST

          public static final String PROP_I2CP_HOST

      See Also:
        Constant Field Values

    - #### PROP_I2CP_PORT

          public static final String PROP_I2CP_PORT

      See Also:
        Constant Field Values

    - #### PROP_INTFC

          public static final String PROP_INTFC

      See Also:
        Constant Field Values

    - #### PROP_LIMIT_ACTION

          public static final String PROP_LIMIT_ACTION

      See Also:
        Constant Field Values

    - #### PROP_LIMITS_SET

          public static final String PROP_LIMITS_SET

      See Also:
        Constant Field Values

    - #### PROP_LISTEN_PORT

          public static final String PROP_LISTEN_PORT

      See Also:
        Constant Field Values

    - #### PROP_MAX_CONNS_DAY

          public static final String PROP_MAX_CONNS_DAY

      See Also:
        Constant Field Values

    - #### PROP_MAX_CONNS_HOUR

          public static final String PROP_MAX_CONNS_HOUR

      See Also:
        Constant Field Values

    - #### PROP_MAX_CONNS_MIN

          public static final String PROP_MAX_CONNS_MIN

      all of these are @since 0.9.33 (moved from TunnelConfig)
      See Also:
        Constant Field Values

    - #### PROP_MAX_STREAMS

          public static final String PROP_MAX_STREAMS

      See Also:
        Constant Field Values

    - #### PROP_MAX_TOTAL_CONNS_DAY

          public static final String PROP_MAX_TOTAL_CONNS_DAY

      See Also:
        Constant Field Values

    - #### PROP_MAX_TOTAL_CONNS_HOUR

          public static final String PROP_MAX_TOTAL_CONNS_HOUR

      See Also:
        Constant Field Values

    - #### PROP_MAX_TOTAL_CONNS_MIN

          public static final String PROP_MAX_TOTAL_CONNS_MIN

      See Also:
        Constant Field Values

    - #### PROP_NAME

          public static final String PROP_NAME

      See Also:
        Constant Field Values

    - #### PROP_PROXIES

          public static final String PROP_PROXIES

      See Also:
        Constant Field Values

    - #### PROP_SHARED

          public static final String PROP_SHARED

      See Also:
        Constant Field Values

    - #### PROP_SHUTDOWN_DELAY_MAX

          public static final String PROP_SHUTDOWN_DELAY_MAX

      Configuration property for the maximum shutdown delay in seconds. Only applies to server tunnels.
      See Also:
        Constant Field Values

    - #### PROP_SHUTDOWN_DELAY_MIN

          public static final String PROP_SHUTDOWN_DELAY_MIN

      Configuration property for the minimum shutdown delay in seconds. Only applies to server tunnels.
      See Also:
        Constant Field Values

    - #### PROP_SPOOFED_HOST

          public static final String PROP_SPOOFED_HOST

      See Also:
        Constant Field Values

    - #### PROP_START

          public static final String PROP_START

      See Also:
        Constant Field Values

    - #### PROP_STARTUP_DELAY_MAX

          public static final String PROP_STARTUP_DELAY_MAX

      Configuration property for the maximum startup delay in seconds. Only applies to server tunnels.
      See Also:
        Constant Field Values

    - #### PROP_STARTUP_DELAY_MIN

          public static final String PROP_STARTUP_DELAY_MIN

      Configuration property for the minimum startup delay in seconds. Only applies to server tunnels.
      See Also:
        Constant Field Values

    - #### PROP_TARGET_HOST

          public static final String PROP_TARGET_HOST

      See Also:
        Constant Field Values

    - #### PROP_TARGET_PORT

          public static final String PROP_TARGET_PORT

      See Also:
        Constant Field Values

    - #### PROP_TUN_GZIP

          public static final String PROP_TUN_GZIP

      See Also:
        Constant Field Values

    - #### PROP_TYPE

          public static final String PROP_TYPE

      See Also:
        Constant Field Values

    - #### TYPE_CONNECT

          public static final String TYPE_CONNECT

      all of these @since 0.9.14
      See Also:
        Constant Field Values

    - #### TYPE_HTTP_BIDIR_SERVER

          public static final String TYPE_HTTP_BIDIR_SERVER

      See Also:
        Constant Field Values

    - #### TYPE_HTTP_CLIENT

          public static final String TYPE_HTTP_CLIENT

      See Also:
        Constant Field Values

    - #### TYPE_HTTP_SERVER

          public static final String TYPE_HTTP_SERVER

      See Also:
        Constant Field Values

    - #### TYPE_IRC_CLIENT

          public static final String TYPE_IRC_CLIENT

      See Also:
        Constant Field Values

    - #### TYPE_IRC_SERVER

          public static final String TYPE_IRC_SERVER

      See Also:
        Constant Field Values

    - #### TYPE_SOCKS

          public static final String TYPE_SOCKS

      See Also:
        Constant Field Values

    - #### TYPE_SOCKS_IRC

          public static final String TYPE_SOCKS_IRC

      See Also:
        Constant Field Values

    - #### TYPE_STD_CLIENT

          public static final String TYPE_STD_CLIENT

      See Also:
        Constant Field Values

    - #### TYPE_STD_SERVER

          public static final String TYPE_STD_SERVER

      See Also:
        Constant Field Values

    - #### TYPE_STREAMR_CLIENT

          public static final String TYPE_STREAMR_CLIENT

      Client in the UI and I2P side but a server on the localhost side
      See Also:
        Constant Field Values

    - #### TYPE_STREAMR_SERVER

          public static final String TYPE_STREAMR_SERVER

      Server in the UI and I2P side but a client on the localhost side
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TunnelController

          public TunnelController(Properties config,
                                  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) If config contains the "configFile" property, it will be set as the config path and may be retrieved with getConfigFile(). Defaults in config properties are not recommended, they may or may not be honored.
      Parameters:
        `config` - original key=value mapping non-null
        `prefix` - beginning of key values that are relevant to this tunnel

    - #### TunnelController

          public TunnelController(Properties config,
                                  String prefix,
                                  boolean createKey)

      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) If config contains the "configFile" property, it will be set as the config path and may be retrieved with getConfigFile(). Defaults in config properties are not recommended, they may or may not be honored.
      Parameters:
        `config` - original key=value mapping non-null
        `prefix` - beginning of key values that are relevant to this tunnel
        `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

    - #### changeState

          public void changeState(TunnelController.TunnelState state)

    - #### clearMessages

          public List<String> clearMessages()

      Pull off any messages that the I2PTunnel has produced
      Returns:
        list of messages pulled off (each is a String, earliest first)

    - #### destroyTunnel

          public void destroyTunnel()

      May NOT be restarted with restartTunnel() or startTunnel() later. This should release all resources.

    - #### filenameToFile

          static File filenameToFile(String f)

      Does not necessarily exist.
      Parameters:
        `f` - relative or absolute path, may be null
      Returns:
        absolute path or null

    - #### getAlternatePrivateKeyFile

          public File getAlternatePrivateKeyFile()

      Does not necessarily exist.
      Returns:
        absolute path or null if unset

    - #### getClientOptionProps

          public Properties getClientOptionProps()

      These are the ones stored with a prefix of "option." Defaults in config properties are not honored.
      Returns:
        keys with the "option." prefix stripped, non-null

    - #### getConfig

          public Properties getConfig(String prefix)

      Returns:
        a copy

    - #### getConfigFile

          public File getConfigFile()

      Returns:
        the config file as passed into constructor via "configFile" property, or as set later, or null

    - #### getDescription

          public String getDescription()

    - #### getDestination

          public Destination getDestination()

      Returns null if not running.
      Returns:
        Destination or null

    - #### getFilter

          public String getFilter()

      Absolute path to filter definition file

    - #### getI2CPHost

          public String getI2CPHost()

    - #### getI2CPPort

          public String getI2CPPort()

    - #### getIsOfflineKeys

          public boolean getIsOfflineKeys()

      Returns false if not running.
      Returns:
        true if the primary session has offline keys

    - #### getIsRunning

          public boolean getIsRunning()

      Checks if the tunnel is currently running.
      Returns:
        true if the tunnel state is RUNNING

    - #### getIsStandby

          public boolean getIsStandby()

      Checks if the tunnel is in standby mode.

      A tunnel is in standby when it is running but has no open sessions.

      Returns:
        true if the tunnel is running but has no active sessions

    - #### getIsStarting

          public boolean getIsStarting()

      Checks if the tunnel is starting or starting on load.
      Returns:
        true if the tunnel is in the process of starting

    - #### getListenOnInterface

          public String getListenOnInterface()

    - #### getListenPort

          public String getListenPort()

    - #### getMyDestHashBase32

          public String getMyDestHashBase32()

      Returns null if not running.
      Returns:
        "{52 chars}.b32.i2p" or null

    - #### getMyDestination

          public String getMyDestination()

      Returns null if not running.
      Returns:
        Base64 or null

    - #### getName

          public String getName()

    - #### getPersistentClientKey

          public boolean getPersistentClientKey()

    - #### getPrivateKeyFile

          public File getPrivateKeyFile()

      Does not necessarily exist.
      Returns:
        absolute path or null if unset

    - #### getPrivKeyFile

          public String getPrivKeyFile()

      Probably not absolute. May be null. getPrivateKeyFile() recommended.

    - #### getProxyList

          public String getProxyList()

    - #### getRemainingStartupDelay

          public int getRemainingStartupDelay()

      Get the remaining startup delay time for tunnels with delayed startup.
      Returns:
        remaining delay in seconds, or 0 if not in delayed startup state or delay has passed

    - #### getSharedClient

          public String getSharedClient()

      default true for clients, always false for servers

    - #### getShutdownDelayMax

          public int getShutdownDelayMax()

      When combined with a positive shutdownDelayMin less than this value, the tunnel will stop with a random delay between min and max seconds during router shutdown.
      Returns:
        the maximum shutdown delay in seconds for server tunnels.

    - #### getShutdownDelayMin

          public int getShutdownDelayMin()

      When combined with a greater shutdownDelayMax, the tunnel will stop with a random delay between min and max seconds during router shutdown.
      Returns:
        the minimum shutdown delay in seconds for server tunnels.

    - #### getSpoofedHost

          public String getSpoofedHost()

    - #### getStartOnLoad

          public boolean getStartOnLoad()

      Returns:
        true if this tunnel is configured to start when the router starts Default is true for clients, false for servers.

    - #### getStartupDelayMax

          public int getStartupDelayMax()

      When combined with a positive startupDelayMin less than this value, the tunnel will start with a random delay between min and max seconds.
      Returns:
        the maximum startup delay in seconds for server tunnels.

    - #### getStartupDelayMin

          public int getStartupDelayMin()

      When combined with a greater startupDelayMax, the tunnel will start with a random delay between min and max seconds.
      Returns:
        the minimum startup delay in seconds for server tunnels.

    - #### getState

          public TunnelController.TunnelState getState()

      Gets the current tunnel state.
      Returns:
        the current TunnelState

    - #### getTargetDestination

          public String getTargetDestination()

    - #### getTargetHost

          public String getTargetHost()

    - #### getTargetPort

          public String getTargetPort()

    - #### getTunnel

          public I2PTunnel getTunnel()

      The I2PTunnel

    - #### getType

          public String getType()

    - #### isClient

          public boolean isClient()

      Is it a client or server in the UI and I2P side? Note that a streamr client is a UI and I2P client but a server on the localhost side. Note that a streamr server is a UI and I2P server but a client on the localhost side.

    - #### isClient

          public static boolean isClient(String type)

      Is it a client or server in the UI and I2P side? Note that a streamr client is a UI and I2P client but a server on the localhost side. Note that a streamr server is a UI and I2P server but a client on the localhost side.
      Returns:
        false if type == null

    - #### log

          public void log(String s)

      Specified by:
        `log` in interface `Logging`

    - #### restartTunnel

          public void restartTunnel()

      Stops and restarts the tunnel.

      This method stops the tunnel if running, waits briefly, then starts the tunnel again. The restart is performed synchronously, blocking until complete.

      See Also:
        `startTunnel()`, `stopTunnel()`

    - #### setConfig

          public void setConfig(Properties config,
                                String prefix)

      As of 0.9.1, updates the options on an existing session

    - #### setConfigFile

          public void setConfigFile(File file)

      Set the config file. Only do this if previously null.

    - #### setStartupDelayEndTime

          void setStartupDelayEndTime(long delayMs)

      Set the startup delay end time. Called by TunnelControllerGroup when setting up delayed startup.
      Parameters:
        `delayMs` - the delay in milliseconds

    - #### startTunnel

          public void startTunnel()

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

    - #### startTunnelBackground

          public void startTunnelBackground()

      Starts the tunnel in a background thread.

      This method spawns a new thread to start the tunnel, allowing the calling thread to return immediately. The tunnel state transitions to STARTING, and the actual startup is performed in the background thread.

      See Also:
        `startTunnel()`

    - #### stopTunnel

          public void stopTunnel()

      May be restarted with restartTunnel() or startTunnel() later. This may not release all resources. In particular, the I2PSocketManager remains and it may have timer threads that continue running.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`