java.lang.Object
net.i2p.desktopgui.router.RouterManager
Handle communications with the router instance. See ConfigServiceHandler for best practices on stopping the router. We don't bother notifying any Wrapper instance here.
Constructor Summary
ConstructorsConstructorDescriptionThe router is reached through the global I2PAppContext rather than through a field, so an instance holds nothing andstart()is the only entry point.Method Summary
Modifier and TypeMethodDescriptionstatic voidCancel a graceful shutdown or restart.private static I2PAppContextThe running router's context, if any.static longGet time until shutdown.static StringgetStatus(RouterContext ctx) Get network status, untranslated.static booleanIs a graceful shutdown or restart in progress?static voidrestart(RouterContext ctx) Restart the running I2P instance immediately.static voidRestart the running I2P instance gracefully.static voidshutDown(RouterContext ctx) Stop the running I2P instance immediately.static voidStop the running I2P instance gracefully.static voidstart()Start an I2P router instance.
Constructor Details
RouterManager
public RouterManager()The router is reached through the global I2PAppContext rather than through a field, so an instance holds nothing andstart()is the only entry point.
Method Details
getAppContext
start
public static void start()Start an I2P router instance. This method has limited knowledge (there is no I2P instance running to collect information from). It determines the I2P location using the I2PAppContext.restart
Restart the running I2P instance immediately.- Parameters:
ctx- the router context
shutDown
Stop the running I2P instance immediately.- Parameters:
ctx- the router context
restartGracefully
Restart the running I2P instance gracefully.- Parameters:
ctx- the router context
shutDownGracefully
Stop the running I2P instance gracefully.- Parameters:
ctx- the router context
cancelShutdown
Cancel a graceful shutdown or restart.- Parameters:
ctx- the router context
isShutdownInProgress
Is a graceful shutdown or restart in progress?- Parameters:
ctx- the router context- Returns:
- true if a graceful shutdown or restart is in progress
getShutdownTimeRemaining
Get time until shutdown.- Parameters:
ctx- the router context- Returns:
- -1 if no shutdown in progress, otherwise milliseconds until shutdown
getStatus
Get network status, untranslated.- Parameters:
ctx- the router context- Returns:
- the current network status string