net.i2p.i2pcontrol

## Class I2PControlController

- java.lang.Object
- - net.i2p.i2pcontrol.I2PControlController

- All Implemented Interfaces:
    ClientApp, RouterApp

      public class I2PControlController
      extends Object
      implements RouterApp

  This handles the starting and stopping of Jetty from a single static class so it can be called via clients.config. This makes installation of a new eepsite a turnkey operation. Usage: I2PControlController -d $PLUGIN [start|stop] This class is NOT used for the webapp or the bare ServerSocket implementation.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) static String` | `PROP_ALLOWED_HOSTS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `I2PControlController(File pluginDir)` From main() (old way)
    `I2PControlController(RouterContext ctx, ClientAppManager mgr, String[] args)` RouterApp (new way)

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Server` | `buildServer()` Builds a new server.
    `String` | `getDisplayName()` The display name of the ClientApp, used in user interfaces.
    `String` | `getName()` The generic name of the ClientApp, used for registration, e.g.
    `String` | `getPluginDir()`
    `ClientAppState` | `getState()` The current state of the ClientApp.
    `static void` | `main(String[] args)` Deprecated, use constructor
    `void` | `shutdown(String[] args)` Do not take a long time.
    `void` | `startup()` Do not take a long time.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### PROP_ALLOWED_HOSTS

          static final String PROP_ALLOWED_HOSTS

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### I2PControlController

          public I2PControlController(File pluginDir)

      From main() (old way)

    - #### I2PControlController

          public I2PControlController(RouterContext ctx,
                                      ClientAppManager mgr,
                                      String[] args)

      RouterApp (new way)

  - ### Method Detail

    - #### buildServer

          public Server buildServer()

      Builds a new server. Used for changing ports during operation and such. Does NOT start the server. Must call start() on the returned server.
      Returns:
        Server - A new server built from current configuration.

    - #### getDisplayName

          public String getDisplayName()

      Description copied from interface: `ClientApp`
      The display name of the ClientApp, used in user interfaces. The app must translate.
      Specified by:
        `getDisplayName` in interface `ClientApp`
      Returns:
        non-null

    - #### getName

          public String getName()

      Description copied from interface: `ClientApp`
      The generic name of the ClientApp, used for registration, e.g. "console". Do not translate.
      Specified by:
        `getName` in interface `ClientApp`
      Returns:
        non-null

    - #### getPluginDir

          public String getPluginDir()

    - #### getState

          public ClientAppState getState()

      Description copied from interface: `ClientApp`
      The current state of the ClientApp.
      Specified by:
        `getState` in interface `ClientApp`
      Returns:
        non-null

    - #### main

          public static void main(String[] args)

      Deprecated, use constructor

    - #### shutdown

          public void shutdown(String[] args)

      Description copied from interface: `ClientApp`
      Do not take a long time. Do not block. Use a thread if necessary. If previously running, client must call ClientAppManager.notify() at least once within this method to change the state to STOPPING or STOPPED. May be called multiple times on the same object, in any state.
      Specified by:
        `shutdown` in interface `ClientApp`
      Parameters:
        `args` - generally null but could be stopArgs from clients.config

    - #### startup

          public void startup()

      Description copied from interface: `ClientApp`
      Do not take a long time. Do not block. Start threads here if necessary. Client must call ClientAppManager.notify() at least once within this method to change the state from INITIALIZED to something else. Will not be called multiple times on the same object.
      Specified by:
        `startup` in interface `ClientApp`