| Modifier and Type | Class and Description |
|---|---|
(package private) static class |
TunnelControllerGroup.CustomThreadPoolExecutor
Thread pool executor for I2P tunnel client handlers with custom configuration
|
| Modifier and Type | Field and Description |
|---|---|
(package private) static String |
DEFAULT_CONFIG_FILE |
| Constructor and Description |
|---|
TunnelControllerGroup(I2PAppContext context,
ClientAppManager mgr,
String[] args)
Instantiation only.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
acquire(TunnelController controller,
I2PSession session)
Note the fact that the controller is using the session so that
it isn't destroyed prematurely.
|
void |
addController(TunnelController controller)
Add the given tunnel to the set of known controllers (but don't add it to a config file or start it or anything)
|
void |
cancelDelayedShutdown()
Cancel a delayed server tunnel shutdown and restart any servers that were stopped.
|
List<String> |
clearAllMessages()
Fetch and clear all outstanding messages from any of the known tunnels.
|
(package private) ThreadPoolExecutor |
getClientExecutor() |
I2PAppContext |
getContext()
Helper
|
List<TunnelController> |
getControllers()
Retrieve a list of tunnels known.
|
String |
getDisplayName()
ClientApp interface
|
static TunnelControllerGroup |
getInstance()
In I2PAppContext will instantiate if necessary and always return non-null.
|
static TunnelControllerGroup |
getInstance(I2PAppContext ctx)
In I2PAppContext will instantiate if necessary and always return non-null.
|
int |
getMaxShutdownDelay()
Get the maximum configured shutdown delay among all server tunnels.
|
String |
getName()
ClientApp interface
|
static int |
getRemainingShutdownDelay()
Get the remaining time until the longest-delayed server tunnel will stop.
|
ClientAppState |
getState()
ClientApp interface
|
static boolean |
isDelayedShutdownInProgress()
Check if delayed server tunnel shutdown is currently in progress.
|
void |
loadControllers(File cfgFile)
Load up all of the tunnels configured in the given file.
|
static void |
main(String[] args) |
void |
prepareGracefulShutdown()
Prepare for graceful shutdown by stopping delayed server tunnels.
|
(package private) void |
release(TunnelController controller,
I2PSession session)
Note the fact that the controller is no longer using the session, and if
no other controllers are using it, destroy the session.
|
void |
reloadControllers()
Stop all tunnels, reload config, and restart those configured to do so.
|
void |
removeConfig(TunnelController tc)
Remove the configuration of this tunnel only
|
List<String> |
removeController(TunnelController controller)
Stop and remove the given tunnel.
|
List<String> |
restartAllControllers()
Restart all tunnels.
|
void |
saveConfig(TunnelController tc)
Save the configuration of this tunnel only, may be new.
|
void |
shutdown()
Convenience method - calls shutdown(true) to wait for.
|
void |
shutdown(boolean waitForDelayed)
Warning - destroys the singleton!
Caller must root a new context before calling instance() or main() again.
|
void |
shutdown(String[] args)
ClientApp interface
|
List<String> |
startAllControllers()
Start all tunnels.
|
void |
startup()
ClientApp interface
|
List<String> |
stopAllControllers()
Stop all tunnels.
|
void |
unloadControllers()
Stop and remove reference to all known tunnels (but don't delete any config file or do other silly things)
|
static final String DEFAULT_CONFIG_FILE
public TunnelControllerGroup(I2PAppContext context, ClientAppManager mgr, String[] args)
mgr - may be nullargs - zero or one args, which may be one config file or one config
directory. If not absolute will be relative to the context's config dir,
if empty or null, the default is i2ptunnel.config for a
config file and i2ptunnel.config.d for a config directoryIllegalArgumentException - if too many argsvoid acquire(TunnelController controller, I2PSession session)
public void addController(TunnelController controller)
public void cancelDelayedShutdown()
public List<String> clearAllMessages()
ThreadPoolExecutor getClientExecutor()
public I2PAppContext getContext()
public List<TunnelController> getControllers()
IllegalArgumentException - if unable to load config from filepublic String getDisplayName()
getDisplayName in interface ClientApppublic static TunnelControllerGroup getInstance()
IllegalArgumentException - if unable to load from i2ptunnel.configpublic static TunnelControllerGroup getInstance(I2PAppContext ctx)
IllegalArgumentException - if unable to load from i2ptunnel.configpublic int getMaxShutdownDelay()
public String getName()
public static int getRemainingShutdownDelay()
public ClientAppState getState()
public static boolean isDelayedShutdownInProgress()
public void loadControllers(File cfgFile)
IllegalArgumentException - if unable to load from filepublic static void main(String[] args)
args - one arg, the config file, if not absolute will be relative to the context's config dir,
if no args, the default is i2ptunnel.configIllegalArgumentException - if unable to load from config from filepublic void prepareGracefulShutdown()
void release(TunnelController controller, I2PSession session)
public void reloadControllers()
IllegalArgumentException - if unable to reload config filepublic void removeConfig(TunnelController tc) throws IOException
IOExceptionpublic List<String> removeController(TunnelController controller)
public List<String> restartAllControllers()
public void saveConfig(TunnelController tc) throws IOException
IOExceptionpublic void shutdown()
public void shutdown(boolean waitForDelayed)
waitForDelayed - true to wait for shutdown-delayed tunnels, false for immediatepublic void shutdown(String[] args)
public List<String> startAllControllers()
public void startup()
startup in interface ClientAppIllegalArgumentException - if unable to load config from filepublic List<String> stopAllControllers()
public void unloadControllers()