net.i2p.i2ptunnel.web
Class IndexBean

java.lang.Object
  extended by net.i2p.i2ptunnel.web.IndexBean
Direct Known Subclasses:
EditBean

public class IndexBean
extends Object

Simple accessor for exposing tunnel info, but also an ugly form handler Warning - This class is not part of the i2ptunnel API, it has been moved from the jar to the war. Usage by classes outside of i2ptunnel.war is deprecated.


Field Summary
protected  I2PAppContext _context
           
protected  TunnelControllerGroup _group
           
protected  Log _log
           
protected static Set _nonProxyNoShowSet
           
protected static Set _noShowSet
           
(package private) static String CLIENT_NICKNAME
           
static String DEFAULT_THEME
           
static int NOT_RUNNING
           
static String PROP_CSS_DISABLED
           
protected static String PROP_ENABLE_ACCESS_LIST
           
protected static String PROP_ENABLE_BLACKLIST
           
static String PROP_JS_DISABLED
           
protected static String PROP_MAX_CONNS_DAY
           
protected static String PROP_MAX_CONNS_HOUR
           
protected static String PROP_MAX_CONNS_MIN
          all of these are @since 0.8.3
protected static String PROP_MAX_STREAMS
           
protected static String PROP_MAX_TOTAL_CONNS_DAY
           
protected static String PROP_MAX_TOTAL_CONNS_HOUR
           
protected static String PROP_MAX_TOTAL_CONNS_MIN
           
static String PROP_THEME_NAME
           
static int RUNNING
           
static int STANDBY
           
static int STARTING
           
 
Constructor Summary
IndexBean()
           
 
Method Summary
protected  String _(String key)
           
 boolean allowCSS()
           
 boolean allowJS()
           
 String getClientDestination(int tunnel)
           
 String getClientInterface(int tunnel)
           
 String getClientPort(int tunnel)
          No validation
 String getClientPort2(int tunnel)
          Returns error message if blank or invalid
protected  TunnelController getController(int tunnel)
           
 String getDestHashBase32(int tunnel)
           
 String getDestinationBase64(int tunnel)
           
 String getInternalType(int tunnel)
           
 String getMessages()
          Executes any action requested (start/stop/etc) and dump out the messages.
static String getNextNonce()
           
 String getServerTarget(int tunnel)
           
 String getSharedClient(int tunnel)
           
 String getTheme()
           
 int getTunnelCount()
           
 String getTunnelDescription(int tunnel)
           
 String getTunnelName(int tunnel)
           
 int getTunnelStatus(int tunnel)
           
 String getTunnelType(int tunnel)
           
(package private)  String getType()
           
 String getTypeName(String internalType)
           
 boolean isClient(int tunnelNum)
           
static boolean isClient(String type)
           
 boolean isInitialized()
           
 boolean isServerTargetLinkValid(int tunnel)
          Call this to see if it is ok to linkify getServerTarget()
 void setAccessList(String val)
           
 void setAccessMode(String val)
           
 void setAction(String action)
           
 void setCert(String val)
           
 void setClientHost(String host)
          I2CP host the router is on, ignored when in router context
 void setClientport(String port)
          I2CP port the router is on, ignored when in router context
 void setClose(String moo)
           
 void setCloseTime(String val)
           
 void setConnectDelay(String moo)
           
 void setCustomOptions(String customOptions)
          what I2P session overrides should be used
 void setDCC(String moo)
           
 void setDelayOpen(String moo)
           
 void setDescription(String description)
          one line description
 void setEffort(String val)
          params needed for hashcash and dest modification
 void setEncrypt(String moo)
           
 void setEncryptKey(String val)
           
 void setJumpList(String val)
           
 void setLimitDay(String s)
           
 void setLimitHour(String s)
           
 void setLimitMinute(String s)
           
 void setMaxStreams(String s)
           
 void setName(String name)
          Short name of the tunnel
 void setNewDest(String val)
           
 void setNonce(String nonce)
           
 void setOutproxyAuth(String s)
           
 void setOutproxyPassword(String s)
           
 void setOutproxyUsername(String s)
           
 void setPort(String port)
          what port should this client/httpclient/ircclient listen on
 void setPrivKeyFile(String file)
          What filename is this server tunnel's private keys stored in
 void setProfile(String profile)
           
 void setProxyAuth(String s)
          all proxy auth @since 0.8.2
 void setProxyList(String proxyList)
          what HTTP outproxies should be used (httpclient specific)
 void setProxyPassword(String s)
           
 void setProxyUsername(String s)
           
 void setReachableBy(String reachableBy)
          what interface should this client/httpclient/ircclient listen on
 void setReduce(String moo)
           
 void setReduceCount(String val)
           
 void setReduceTime(String val)
           
 void setRemoveConfirm(String moo)
          If called with any value (and the form submitted with action=Remove), we really do want to stop and remove the tunnel.
 void setShared(boolean val)
           
 void setShared(String moo)
           
 void setSigner(String val)
           
 void setSpoofedHost(String host)
          What host does this http server tunnel spoof
 void setStartOnLoad(String moo)
          If called with any value, we want this tunnel to start whenever it is loaded (aka right now and whenever the router is started up)
 void setTargetDestination(String dest)
          What peer does this client tunnel point at
 void setTargetHost(String host)
          What host does this server tunnel point at
 void setTargetPort(String port)
          What port does this server tunnel point at
 void setTotalDay(String s)
           
 void setTotalHour(String s)
           
 void setTotalMinute(String s)
           
 void setTunnel(String tunnel)
           
 void setTunnelBackupQuantity(String tunnelBackupQuantity)
          how many tunnels to hold in reserve to guard against failures
 void setTunnelDepth(String tunnelDepth)
          how many hops to use for inbound tunnels
 void setTunnelQuantity(String tunnelQuantity)
          how many parallel inbound tunnels to use
 void setTunnelVariance(String tunnelVariance)
          how much randomisation to apply to the depth of tunnels
 void setType(String type)
          What type of tunnel (httpclient, ircclient, client, or server).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_context

protected final I2PAppContext _context

_log

protected final Log _log

_group

protected final TunnelControllerGroup _group

RUNNING

public static final int RUNNING
See Also:
Constant Field Values

STARTING

public static final int STARTING
See Also:
Constant Field Values

NOT_RUNNING

public static final int NOT_RUNNING
See Also:
Constant Field Values

STANDBY

public static final int STANDBY
See Also:
Constant Field Values

CLIENT_NICKNAME

static final String CLIENT_NICKNAME
See Also:
Constant Field Values

PROP_THEME_NAME

public static final String PROP_THEME_NAME
See Also:
Constant Field Values

DEFAULT_THEME

public static final String DEFAULT_THEME
See Also:
Constant Field Values

PROP_CSS_DISABLED

public static final String PROP_CSS_DISABLED
See Also:
Constant Field Values

PROP_JS_DISABLED

public static final String PROP_JS_DISABLED
See Also:
Constant Field Values

PROP_ENABLE_ACCESS_LIST

protected static final String PROP_ENABLE_ACCESS_LIST
See Also:
Constant Field Values

PROP_ENABLE_BLACKLIST

protected static final String PROP_ENABLE_BLACKLIST
See Also:
Constant Field Values

PROP_MAX_CONNS_MIN

protected static final String PROP_MAX_CONNS_MIN
all of these are @since 0.8.3

See Also:
Constant Field Values

PROP_MAX_CONNS_HOUR

protected static final String PROP_MAX_CONNS_HOUR
See Also:
Constant Field Values

PROP_MAX_CONNS_DAY

protected static final String PROP_MAX_CONNS_DAY
See Also:
Constant Field Values

PROP_MAX_TOTAL_CONNS_MIN

protected static final String PROP_MAX_TOTAL_CONNS_MIN
See Also:
Constant Field Values

PROP_MAX_TOTAL_CONNS_HOUR

protected static final String PROP_MAX_TOTAL_CONNS_HOUR
See Also:
Constant Field Values

PROP_MAX_TOTAL_CONNS_DAY

protected static final String PROP_MAX_TOTAL_CONNS_DAY
See Also:
Constant Field Values

PROP_MAX_STREAMS

protected static final String PROP_MAX_STREAMS
See Also:
Constant Field Values

_noShowSet

protected static final Set _noShowSet

_nonProxyNoShowSet

protected static final Set _nonProxyNoShowSet
Constructor Detail

IndexBean

public IndexBean()
Method Detail

isInitialized

public boolean isInitialized()
Since:
0.9.4

getNextNonce

public static String getNextNonce()

setNonce

public void setNonce(String nonce)

setAction

public void setAction(String action)

setTunnel

public void setTunnel(String tunnel)

getMessages

public String getMessages()
Executes any action requested (start/stop/etc) and dump out the messages.


getTheme

public String getTheme()

allowCSS

public boolean allowCSS()

allowJS

public boolean allowJS()

getTunnelCount

public int getTunnelCount()

isClient

public boolean isClient(int tunnelNum)

isClient

public static boolean isClient(String type)

getTunnelName

public String getTunnelName(int tunnel)

getClientPort

public String getClientPort(int tunnel)
No validation


getClientPort2

public String getClientPort2(int tunnel)
Returns error message if blank or invalid

Since:
0.9.3

getTunnelType

public String getTunnelType(int tunnel)

getTypeName

public String getTypeName(String internalType)

getInternalType

public String getInternalType(int tunnel)

getClientInterface

public String getClientInterface(int tunnel)

getTunnelStatus

public int getTunnelStatus(int tunnel)

getTunnelDescription

public String getTunnelDescription(int tunnel)

getSharedClient

public String getSharedClient(int tunnel)

getClientDestination

public String getClientDestination(int tunnel)

isServerTargetLinkValid

public boolean isServerTargetLinkValid(int tunnel)
Call this to see if it is ok to linkify getServerTarget()

Since:
0.8.3

getServerTarget

public String getServerTarget(int tunnel)
Returns:
valid host:port only if isServerTargetLinkValid() is true

getDestinationBase64

public String getDestinationBase64(int tunnel)

getDestHashBase32

public String getDestHashBase32(int tunnel)

setType

public void setType(String type)
What type of tunnel (httpclient, ircclient, client, or server). This is required when adding a new tunnel.


getType

String getType()

setName

public void setName(String name)
Short name of the tunnel


setDescription

public void setDescription(String description)
one line description


setClientHost

public void setClientHost(String host)
I2CP host the router is on, ignored when in router context


setClientport

public void setClientport(String port)
I2CP port the router is on, ignored when in router context


setTunnelDepth

public void setTunnelDepth(String tunnelDepth)
how many hops to use for inbound tunnels


setTunnelQuantity

public void setTunnelQuantity(String tunnelQuantity)
how many parallel inbound tunnels to use


setTunnelVariance

public void setTunnelVariance(String tunnelVariance)
how much randomisation to apply to the depth of tunnels


setTunnelBackupQuantity

public void setTunnelBackupQuantity(String tunnelBackupQuantity)
how many tunnels to hold in reserve to guard against failures


setCustomOptions

public void setCustomOptions(String customOptions)
what I2P session overrides should be used


setProxyList

public void setProxyList(String proxyList)
what HTTP outproxies should be used (httpclient specific)


setPort

public void setPort(String port)
what port should this client/httpclient/ircclient listen on


setReachableBy

public void setReachableBy(String reachableBy)
what interface should this client/httpclient/ircclient listen on


setTargetDestination

public void setTargetDestination(String dest)
What peer does this client tunnel point at


setTargetHost

public void setTargetHost(String host)
What host does this server tunnel point at


setTargetPort

public void setTargetPort(String port)
What port does this server tunnel point at


setSpoofedHost

public void setSpoofedHost(String host)
What host does this http server tunnel spoof


setPrivKeyFile

public void setPrivKeyFile(String file)
What filename is this server tunnel's private keys stored in


setRemoveConfirm

public void setRemoveConfirm(String moo)
If called with any value (and the form submitted with action=Remove), we really do want to stop and remove the tunnel.


setStartOnLoad

public void setStartOnLoad(String moo)
If called with any value, we want this tunnel to start whenever it is loaded (aka right now and whenever the router is started up)


setShared

public void setShared(String moo)

setShared

public void setShared(boolean val)

setConnectDelay

public void setConnectDelay(String moo)

setProfile

public void setProfile(String profile)

setReduce

public void setReduce(String moo)

setClose

public void setClose(String moo)

setEncrypt

public void setEncrypt(String moo)

setDCC

public void setDCC(String moo)
Since:
0.8.9

setAccessMode

public void setAccessMode(String val)

setDelayOpen

public void setDelayOpen(String moo)

setNewDest

public void setNewDest(String val)

setReduceTime

public void setReduceTime(String val)

setReduceCount

public void setReduceCount(String val)

setEncryptKey

public void setEncryptKey(String val)

setAccessList

public void setAccessList(String val)

setJumpList

public void setJumpList(String val)

setCloseTime

public void setCloseTime(String val)

setProxyAuth

public void setProxyAuth(String s)
all proxy auth @since 0.8.2


setProxyUsername

public void setProxyUsername(String s)

setProxyPassword

public void setProxyPassword(String s)

setOutproxyAuth

public void setOutproxyAuth(String s)

setOutproxyUsername

public void setOutproxyUsername(String s)

setOutproxyPassword

public void setOutproxyPassword(String s)

setLimitMinute

public void setLimitMinute(String s)

setLimitHour

public void setLimitHour(String s)

setLimitDay

public void setLimitDay(String s)

setTotalMinute

public void setTotalMinute(String s)

setTotalHour

public void setTotalHour(String s)

setTotalDay

public void setTotalDay(String s)

setMaxStreams

public void setMaxStreams(String s)

setEffort

public void setEffort(String val)
params needed for hashcash and dest modification


setCert

public void setCert(String val)

setSigner

public void setSigner(String val)

getController

protected TunnelController getController(int tunnel)

_

protected String _(String key)