|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.Router
public class Router
Main driver for the router.
Field Summary | |
---|---|
static char |
CAPABILITY_BW12
|
static char |
CAPABILITY_BW128
|
static char |
CAPABILITY_BW256
|
static char |
CAPABILITY_BW32
|
static char |
CAPABILITY_BW64
|
static char |
CAPABILITY_NEW_TUNNEL
|
static char |
CAPABILITY_REACHABLE
|
static char |
CAPABILITY_UNREACHABLE
|
static long |
CLOCK_FUDGE_FACTOR
let clocks be off by 1 minute |
static int |
EXIT_GRACEFUL
|
static int |
EXIT_GRACEFUL_RESTART
|
static int |
EXIT_HARD
|
static int |
EXIT_HARD_RESTART
|
static int |
EXIT_OOM
|
(package private) static java.lang.String |
IDENTLOG
|
(package private) static long |
LIVELINESS_DELAY
|
static int |
NETWORK_ID
used to differentiate routerInfo files on different networks |
static java.lang.String |
PROP_CONFIG_FILE
|
static java.lang.String |
PROP_DYNAMIC_KEYS
|
static java.lang.String |
PROP_FORCE_UNREACHABLE
|
static java.lang.String |
PROP_HIDDEN
|
static java.lang.String |
PROP_INFO_FILENAME
|
static java.lang.String |
PROP_INFO_FILENAME_DEFAULT
|
static java.lang.String |
PROP_KEYS_FILENAME
|
static java.lang.String |
PROP_KEYS_FILENAME_DEFAULT
|
static java.lang.String |
PROP_SHUTDOWN_IN_PROGRESS
|
Constructor Summary | |
---|---|
Router()
|
|
Router(java.util.Properties envProps)
|
|
Router(java.lang.String configFilename)
|
|
Router(java.lang.String configFilename,
java.util.Properties envProps)
|
Method Summary | |
---|---|
void |
addCapabilities(RouterInfo ri)
|
void |
addShutdownTask(java.lang.Runnable task)
|
void |
cancelGracefulShutdown()
Cancel any prior request to shut the router down gracefully. |
Certificate |
createCertificate()
|
void |
finalShutdown(int exitCode)
|
int |
get15sRate()
|
int |
get15sRate(boolean outboundOnly)
|
int |
get1mRate()
|
int |
get1mRate(boolean outboundOnly)
|
int |
get1sRate()
|
int |
get1sRate(boolean outboundOnly)
|
int |
get5mRate()
|
int |
get5mRate(boolean outboundOnly)
|
java.lang.String |
getConfigFilename()
|
java.util.Properties |
getConfigMap()
|
java.lang.String |
getConfigSetting(java.lang.String name)
|
java.util.Set |
getConfigSettings()
|
RouterContext |
getContext()
|
boolean |
getHigherVersionSeen()
True if the router has tried to communicate with another router who is running a higher incompatible protocol version. |
boolean |
getKillVMOnEnd()
|
RouterInfo |
getRouterInfo()
|
double |
getSharePercentage()
What fraction of the bandwidth specified in our bandwidth limits should we allow to be consumed by participating tunnels? |
long |
getShutdownTimeRemaining()
How long until the graceful shutdown will kill us? |
long |
getUptime()
wall clock uptime |
long |
getWhenStarted()
|
boolean |
gracefulShutdownInProgress()
|
boolean |
isAlive()
|
boolean |
isHidden()
|
static void |
killKeys()
|
static void |
main(java.lang.String[] args)
|
void |
readConfig()
|
void |
rebuildNewIdentity()
Rebuild a new identity the hard way - delete all of our old identity files, then reboot the router. |
void |
rebuildRouterInfo()
Rebuild and republish our routerInfo since something significant has changed. |
void |
rebuildRouterInfo(boolean blockingRebuild)
|
void |
removeConfigSetting(java.lang.String name)
|
void |
renderStatusHTML(java.io.Writer out)
|
void |
restart()
|
(package private) void |
runRouter()
|
boolean |
saveConfig()
Save the current config options (returning true if save was successful, false otherwise) |
int |
scheduledGracefulExitCode()
What exit code do we plan on using when we shut down (or -1, if there isn't a graceful shutdown planned) |
void |
setConfigFilename(java.lang.String filename)
|
void |
setConfigSetting(java.lang.String name,
java.lang.String value)
|
void |
setHigherVersionSeen(boolean seen)
|
void |
setKillVMOnEnd(boolean shouldDie)
Configure the router to kill the JVM when the router shuts down, as well as whether to explicitly halt the JVM during the hard fail process. |
void |
setRouterInfo(RouterInfo info)
|
void |
shutdown(int exitCode)
|
void |
shutdownGracefully()
Call this if we want the router to kill itself as soon as we aren't participating in any more tunnels (etc). |
void |
shutdownGracefully(int exitCode)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PROP_CONFIG_FILE
public static final long CLOCK_FUDGE_FACTOR
public static final int NETWORK_ID
public static final java.lang.String PROP_HIDDEN
public static final java.lang.String PROP_DYNAMIC_KEYS
public static final java.lang.String PROP_INFO_FILENAME
public static final java.lang.String PROP_INFO_FILENAME_DEFAULT
public static final java.lang.String PROP_KEYS_FILENAME
public static final java.lang.String PROP_KEYS_FILENAME_DEFAULT
public static final java.lang.String PROP_SHUTDOWN_IN_PROGRESS
public static final char CAPABILITY_BW12
public static final char CAPABILITY_BW32
public static final char CAPABILITY_BW64
public static final char CAPABILITY_BW128
public static final char CAPABILITY_BW256
public static final char CAPABILITY_REACHABLE
public static final char CAPABILITY_UNREACHABLE
public static final java.lang.String PROP_FORCE_UNREACHABLE
public static final char CAPABILITY_NEW_TUNNEL
static final java.lang.String IDENTLOG
public static final int EXIT_GRACEFUL
public static final int EXIT_HARD
public static final int EXIT_OOM
public static final int EXIT_HARD_RESTART
public static final int EXIT_GRACEFUL_RESTART
static final long LIVELINESS_DELAY
Constructor Detail |
---|
public Router()
public Router(java.util.Properties envProps)
public Router(java.lang.String configFilename)
public Router(java.lang.String configFilename, java.util.Properties envProps)
Method Detail |
---|
public void setKillVMOnEnd(boolean shouldDie)
public boolean getKillVMOnEnd()
public java.lang.String getConfigFilename()
public void setConfigFilename(java.lang.String filename)
public java.lang.String getConfigSetting(java.lang.String name)
public void setConfigSetting(java.lang.String name, java.lang.String value)
public void removeConfigSetting(java.lang.String name)
public java.util.Set getConfigSettings()
public java.util.Properties getConfigMap()
public RouterInfo getRouterInfo()
public void setRouterInfo(RouterInfo info)
public boolean getHigherVersionSeen()
public void setHigherVersionSeen(boolean seen)
public long getWhenStarted()
public long getUptime()
public RouterContext getContext()
void runRouter()
public void readConfig()
public boolean isAlive()
public void rebuildRouterInfo()
public void rebuildRouterInfo(boolean blockingRebuild)
public void addCapabilities(RouterInfo ri)
public boolean isHidden()
public Certificate createCertificate()
public static void killKeys()
public void rebuildNewIdentity()
public void renderStatusHTML(java.io.Writer out) throws java.io.IOException
java.io.IOException
public void addShutdownTask(java.lang.Runnable task)
public void shutdown(int exitCode)
public void finalShutdown(int exitCode)
public void shutdownGracefully()
shutdown(int)
. If you want to cancel
the graceful shutdown (prior to actual shutdown ;), call
cancelGracefulShutdown()
.
public void shutdownGracefully(int exitCode)
public void cancelGracefulShutdown()
public int scheduledGracefulExitCode()
public boolean gracefulShutdownInProgress()
public long getShutdownTimeRemaining()
public boolean saveConfig()
public void restart()
public static void main(java.lang.String[] args)
public double getSharePercentage()
public int get1sRate()
public int get1sRate(boolean outboundOnly)
public int get15sRate()
public int get15sRate(boolean outboundOnly)
public int get1mRate()
public int get1mRate(boolean outboundOnly)
public int get5mRate()
public int get5mRate(boolean outboundOnly)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |