net.i2p.router.web
Class RouterConsoleRunner

java.lang.Object
  extended by net.i2p.router.web.RouterConsoleRunner
All Implemented Interfaces:
ClientApp, RouterApp

public class RouterConsoleRunner
extends Object
implements RouterApp

Start the router console.


Nested Class Summary
(package private) static class RouterConsoleRunner.WarFilenameFilter
           
 
Field Summary
static int DEFAULT_LISTEN_PORT
           
static String ENABLED
           
static String JETTY_REALM
           
static String PREFIX
           
static String PROP_CONSOLE_PW
           
static String PROP_PW_ENABLE
           
static String ROUTERCONSOLE
           
 
Constructor Summary
RouterConsoleRunner(RouterContext ctx, ClientAppManager mgr, String[] args)
           non-SSL: RouterConsoleRunner RouterConsoleRunner 7657 RouterConsoleRunner 7657 127.0.0.1 RouterConsoleRunner 7657 127.0.0.1,::1 RouterConsoleRunner 7657 127.0.0.1,::1 ./webapps/ SSL: RouterConsoleRunner -s 7657 RouterConsoleRunner -s 7657 127.0.0.1 RouterConsoleRunner -s 7657 127.0.0.1,::1 RouterConsoleRunner -s 7657 127.0.0.1,::1 ./webapps/ If using both, non-SSL must be first: RouterConsoleRunner 7657 127.0.0.1 -s 7667 RouterConsoleRunner 7657 127.0.0.1 -s 7667 127.0.0.1 RouterConsoleRunner 7657 127.0.0.1,::1 -s 7667 127.0.0.1,::1 RouterConsoleRunner 7657 127.0.0.1,::1 -s 7667 127.0.0.1,::1 ./webapps/
 
Method Summary
(package private) static Server getConsoleServer()
          SInce _server is now static
 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.
 ClientAppState getState()
          The current state of the ClientApp.
(package private) static void initialize(RouterContext ctx, WebAppContext context)
          Set up basic security constraints for the webapp.
static void main(String[] args)
           
 void shutdown(String[] args)
          Do not take a long time.
 void startConsole()
          http://irc.codehaus.org/display/JETTY/Porting+to+jetty6
 void startup()
          Do not take a long time.
static void storeWebAppProperties(RouterContext ctx, Properties props)
           
static Properties webAppProperties(I2PAppContext ctx)
           
static Properties webAppProperties(String dir)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JETTY_REALM

public static final String JETTY_REALM
See Also:
Constant Field Values

PROP_CONSOLE_PW

public static final String PROP_CONSOLE_PW
See Also:
Constant Field Values

PROP_PW_ENABLE

public static final String PROP_PW_ENABLE
See Also:
Constant Field Values

ROUTERCONSOLE

public static final String ROUTERCONSOLE
See Also:
Constant Field Values

PREFIX

public static final String PREFIX
See Also:
Constant Field Values

ENABLED

public static final String ENABLED
See Also:
Constant Field Values

DEFAULT_LISTEN_PORT

public static final int DEFAULT_LISTEN_PORT
See Also:
Constant Field Values
Constructor Detail

RouterConsoleRunner

public RouterConsoleRunner(RouterContext ctx,
                           ClientAppManager mgr,
                           String[] args)
  non-SSL:
  RouterConsoleRunner
  RouterConsoleRunner 7657
  RouterConsoleRunner 7657 127.0.0.1
  RouterConsoleRunner 7657 127.0.0.1,::1
  RouterConsoleRunner 7657 127.0.0.1,::1 ./webapps/

  SSL:
  RouterConsoleRunner -s 7657
  RouterConsoleRunner -s 7657 127.0.0.1
  RouterConsoleRunner -s 7657 127.0.0.1,::1
  RouterConsoleRunner -s 7657 127.0.0.1,::1 ./webapps/

  If using both, non-SSL must be first:
  RouterConsoleRunner 7657 127.0.0.1 -s 7667
  RouterConsoleRunner 7657 127.0.0.1 -s 7667 127.0.0.1
  RouterConsoleRunner 7657 127.0.0.1,::1 -s 7667 127.0.0.1,::1
  RouterConsoleRunner 7657 127.0.0.1,::1 -s 7667 127.0.0.1,::1 ./webapps/
  

Parameters:
args - second arg may be a comma-separated list of bind addresses, for example ::1,127.0.0.1 On XP, the other order (127.0.0.1,::1) fails the IPV6 bind, because 127.0.0.1 will bind ::1 also. But even though it's bound to both, we can't connect to [::1]:7657 for some reason. So the wise choice is ::1,127.0.0.1
Method Detail

main

public static void main(String[] args)

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
Since:
0.9.4

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
Since:
0.9.4

getState

public ClientAppState getState()
Description copied from interface: ClientApp
The current state of the ClientApp.

Specified by:
getState in interface ClientApp
Returns:
non-null
Since:
0.9.4

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
Since:
0.9.4

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
Since:
0.9.4

getConsoleServer

static Server getConsoleServer()
SInce _server is now static

Returns:
may be null or stopped perhaps
Since:
Jetty 6 since it doesn't have Server.getServers()

startConsole

public void startConsole()
http://irc.codehaus.org/display/JETTY/Porting+to+jetty6
        Server
                HandlerCollection
                        ContextHandlerCollection
                                WebAppContext (i.e. ContextHandler)
                                        SessionHandler
                                        SecurityHandler
                                        ServletHandler
                                                servlets...
                                WebAppContext
                                ...
                        DefaultHandler
                        RequestLogHandler (opt)


initialize

static void initialize(RouterContext ctx,
                       WebAppContext context)
Set up basic security constraints for the webapp. Add all users and passwords.


webAppProperties

public static Properties webAppProperties(I2PAppContext ctx)
Since:
0.9.4

webAppProperties

public static Properties webAppProperties(String dir)

storeWebAppProperties

public static void storeWebAppProperties(RouterContext ctx,
                                         Properties props)