org.marketcetera.ors.security
Class ORSAdminCLI

java.lang.Object
  extended by org.marketcetera.core.ApplicationBase
      extended by org.marketcetera.ors.security.ORSAdminCLI
All Implemented Interfaces:
Clock

public class ORSAdminCLI
extends ApplicationBase

The CLI to manage users and password on ORS. Invoke parseAndRun(String[]) to run a CLI command. This method can be invoked multiple times to invoke several commands. The CLI instance can eventually be destroyed by invoking close()

Author:
anshul@marketcetera.com

Field Summary
 
Fields inherited from class org.marketcetera.core.ApplicationBase
APP_DIR, APP_DIR_PROP, CONF_DIR, fixDD, fixVersion, LOGGER_CONF_FILE, LOGGER_WATCH_DELAY, msgFactory, PASSWORD_BEAN_NAME, USERNAME_BEAN_NAME
 
Constructor Summary
ORSAdminCLI(PrintStream out, PrintStream err)
          Creates an instance
 
Method Summary
 void close()
          Closes the application.
protected  String[] getConfigurations()
          Returns a list of spring configurations that should be used to configure the CLI
static void main(String[] args)
           
 void parseAndRun(String... args)
          Parses and runs the supplied command.
protected  char[] readPasswordFromConsole(String message)
          Reads the password from the console if one is available.
 
Methods inherited from class org.marketcetera.core.ApplicationBase
createApplicationContext, createApplicationContext, getAppCtx, getApproximateTime, getFIXVersion, getTime, isWaitingForever, startWaitingForever
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ORSAdminCLI

public ORSAdminCLI(PrintStream out,
                   PrintStream err)
Creates an instance

Parameters:
out - The output stream to write output to
err - The error stream to write error output to
Method Detail

main

public static void main(String[] args)

close

public void close()
Closes the application. Destroys all the resources that were used by the application.


parseAndRun

public void parseAndRun(String... args)
                 throws Exception
Parses and runs the supplied command. This method can be invoked multiple times.

Parameters:
args - the arguments per the usage of the CLI
Throws:
Exception - if there were errors running the command

getConfigurations

protected String[] getConfigurations()
Returns a list of spring configurations that should be used to configure the CLI

Returns:
the list of spring configurations

readPasswordFromConsole

protected char[] readPasswordFromConsole(String message)
Reads the password from the console if one is available.

Parameters:
message - the password prompt to display to the user
Returns:
the password, null, if no console is available or if end of stream is reached.


Copyright © 2012. All Rights Reserved.