Modifier and Type | Class | Description |
---|---|---|
(package private) static class |
TunnelControllerGroup.CustomThreadPoolExecutor |
Not really needed for now but in case we want to add some hooks like afterExecute().
|
Modifier and Type | Field | Description |
---|---|---|
(package private) static String |
DEFAULT_CONFIG_FILE |
Constructor | Description |
---|---|
TunnelControllerGroup(I2PAppContext context,
ClientAppManager mgr,
String[] args) |
Instantiation only.
|
Modifier and Type | Method | 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 dont add it to
a config file or start it or anything)
|
List<String> |
clearAllMessages() |
Fetch and clear all outstanding messages from any of the known tunnels.
|
(package private) ThreadPoolExecutor |
getClientExecutor() |
|
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.
|
String |
getName() |
ClientApp interface
|
ClientAppState |
getState() |
ClientApp interface
|
void |
loadControllers(String configFile) |
Load up all of the tunnels configured in the given file.
|
static void |
main(String[] args) |
|
(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.
|
List<String> |
removeController(TunnelController controller) |
Stop and remove the given tunnel.
|
List<String> |
restartAllControllers() |
Restart all tunnels.
|
void |
saveConfig() |
Save the configuration of all known tunnels to the default config
file
|
void |
saveConfig(String configFile) |
Save the configuration of all known tunnels to the given file
|
void |
shutdown() |
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 dont 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
- one arg, the config file, if not absolute will be relative to the context's config dir,
if empty or null, the default is i2ptunnel.configIllegalArgumentException
- if too many argspublic static TunnelControllerGroup getInstance()
IllegalArgumentException
- if unable to load from i2ptunnel.configpublic 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 startup()
startup
in interface ClientApp
IllegalArgumentException
- if unable to load config from filepublic ClientAppState getState()
public String getName()
public String getDisplayName()
getDisplayName
in interface ClientApp
public void shutdown(String[] args)
public void shutdown()
public void loadControllers(String configFile)
IllegalArgumentException
- if unable to load from filepublic void reloadControllers()
IllegalArgumentException
- if unable to reload config filepublic void unloadControllers()
public void addController(TunnelController controller)
public List<String> removeController(TunnelController controller)
public List<String> stopAllControllers()
public List<String> startAllControllers()
public List<String> restartAllControllers()
public List<String> clearAllMessages()
public void saveConfig() throws IOException
IOException
public void saveConfig(String configFile) throws IOException
IOException
public List<TunnelController> getControllers()
IllegalArgumentException
- if unable to load config from filevoid acquire(TunnelController controller, I2PSession session)
void release(TunnelController controller, I2PSession session)
ThreadPoolExecutor getClientExecutor()