Class BaseCommands
- java.lang.Object
-
- edu.uiuc.ncsa.security.util.cli.ConfigurableCommandsImpl
-
- org.oa4mp.server.admin.base.oauth2.myproxy.BaseCommands
-
- All Implemented Interfaces:
edu.uiuc.ncsa.security.core.Logable
,edu.uiuc.ncsa.security.util.cli.Commands
,edu.uiuc.ncsa.security.util.cli.ComponentManager
- Direct Known Subclasses:
OA2Commands
public abstract class BaseCommands extends edu.uiuc.ncsa.security.util.cli.ConfigurableCommandsImpl implements edu.uiuc.ncsa.security.util.cli.ComponentManager
Created by Jeff Gaynor
on 3/27/15 at 1:49 PM
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLIENT_APPROVALS
static String
CLIENTS
protected List<String>
components
static String
COPY
protected String
logoName
String
PARSER_COMMAND
protected boolean
showHeader
protected boolean
showLogo
String
TRANSACTION_COMMAND
-
Fields inherited from class edu.uiuc.ncsa.security.util.cli.ConfigurableCommandsImpl
COMMENT_START, COMMENT_START_OPTION, CONFIG_FILE_LONG_OPTION, CONFIG_FILE_OPTION, CONFIG_NAME_LONG_OPTION, CONFIG_NAME_OPTION, DEBUG_LONG_OPTION, DEBUG_OPTION, DEFAULT_LOG_FILE, ENV_LONG_OPTION, ENV_OPTION, FILE_SWITCH, HELP_LONG_OPTION, HELP_OPTION, INPUT_OPTION, LOG_FILE_LONG_OPTION, LOG_FILE_OPTION, OUTPUT_OPTION, USE_COMPONENT_LONG_OPTION, USE_COMPONENT_OPTION, VERBOSE_LONG_OPTION, VERBOSE_OPTION
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BaseCommands(edu.uiuc.ncsa.security.core.util.MyLoggingFacade logger)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
about()
protected boolean
executeComponent()
String
getComponentName()
ClientApprovalStoreCommands
getNewClientApprovalStoreCommands()
abstract ClientStoreCommands
getNewClientStoreCommands()
abstract CopyCommands
getNewCopyCommands()
abstract edu.uiuc.ncsa.security.util.cli.ParserCommands
getNewParserCommands()
org.oa4mp.server.api.ServiceEnvironment
getServiceEnvironment()
protected abstract edu.uiuc.ncsa.security.util.cli.CommonCommands
getTransactionCommands()
protected boolean
hasComponent(String componentName)
protected void
init()
List<String>
listComponents()
protected void
runComponent(String componentName)
protected void
start(String[] args)
command line arguments are
-noLogo - do not show logo -noHeader - do not show splash screen with author, version -v = do not suppress startup messages.protected boolean
switchOrRun(edu.uiuc.ncsa.security.util.cli.InputLine inputLine, edu.uiuc.ncsa.security.util.cli.CommonCommands commands)
Either switch to another component or (if there are arguments) simply run the single command and return.boolean
use(edu.uiuc.ncsa.security.util.cli.InputLine inputLine)
void
useHelp()
-
Methods inherited from class edu.uiuc.ncsa.security.util.cli.ConfigurableCommandsImpl
debug, doListNames, error, figureOutLoader, getCommandLine, getConfigFile, getConfigName, getEnvironment, getGlobalEnv, getIOInterface, getLoader, getLogfileName, getMyLogger, getOptions, getOptions, hasOption, info, initialize, isDebugOn, isVerbose, listConfigs, listXMLConfigs, load, loadConfig, padLineWithBlanks, parseCommandLine, print_help, readEnv, say, sayv, setConfigFile, setConfigName, setDebugOn, setEnvironment, setIOInterface, setLoader, setLogfileName, setMyLogger, setVerbose, showHelp, showLoadHelp, trace, warn
-
-
-
-
Field Detail
-
CLIENTS
public static final String CLIENTS
- See Also:
- Constant Field Values
-
CLIENT_APPROVALS
public static final String CLIENT_APPROVALS
- See Also:
- Constant Field Values
-
COPY
public static final String COPY
- See Also:
- Constant Field Values
-
PARSER_COMMAND
public String PARSER_COMMAND
-
TRANSACTION_COMMAND
public String TRANSACTION_COMMAND
-
showHeader
protected boolean showHeader
-
showLogo
protected boolean showLogo
-
logoName
protected String logoName
-
-
Method Detail
-
init
protected void init()
-
listComponents
public List<String> listComponents()
- Specified by:
listComponents
in interfaceedu.uiuc.ncsa.security.util.cli.ComponentManager
-
about
public abstract void about()
-
getNewClientStoreCommands
public abstract ClientStoreCommands getNewClientStoreCommands() throws Throwable
- Throws:
Throwable
-
getNewCopyCommands
public abstract CopyCommands getNewCopyCommands() throws Throwable
- Throws:
Throwable
-
getTransactionCommands
protected abstract edu.uiuc.ncsa.security.util.cli.CommonCommands getTransactionCommands() throws Throwable
- Throws:
Throwable
-
getComponentName
public String getComponentName()
- Specified by:
getComponentName
in classedu.uiuc.ncsa.security.util.cli.ConfigurableCommandsImpl
-
start
protected void start(String[] args) throws Exception
command line arguments are
- -noLogo - do not show logo
- -noHeader - do not show splash screen with author, version
- -v = do not suppress startup messages. A lot of 3rd party software spits stuff out and it is normally hidden. This prints it all out.
- -silent = same as -noLogo and -noHeader
- -logo name = use the named logo. Standard are Times, Roman (like Times but bigger), OS2 - groovy font, Fraktur - Old German Font or Plain = barebones sans-serif, None = none (same as -noLogo). Times is the default.
- Parameters:
args
-- Throws:
Exception
-
getServiceEnvironment
public org.oa4mp.server.api.ServiceEnvironment getServiceEnvironment() throws Exception
- Throws:
Exception
-
getNewClientApprovalStoreCommands
public ClientApprovalStoreCommands getNewClientApprovalStoreCommands() throws Throwable
- Throws:
Throwable
-
use
public boolean use(edu.uiuc.ncsa.security.util.cli.InputLine inputLine) throws Throwable
- Specified by:
use
in interfaceedu.uiuc.ncsa.security.util.cli.ComponentManager
- Overrides:
use
in classedu.uiuc.ncsa.security.util.cli.ConfigurableCommandsImpl
- Throws:
Throwable
-
switchOrRun
protected boolean switchOrRun(edu.uiuc.ncsa.security.util.cli.InputLine inputLine, edu.uiuc.ncsa.security.util.cli.CommonCommands commands)
Either switch to another component or (if there are arguments) simply run the single command and return. Note that each component has stored state, so these will be run with whatever is in that state.- Parameters:
inputLine
-commands
-- Returns:
-
hasComponent
protected boolean hasComponent(String componentName)
-
getNewParserCommands
public abstract edu.uiuc.ncsa.security.util.cli.ParserCommands getNewParserCommands() throws Throwable
- Throws:
Throwable
-
useHelp
public void useHelp()
- Specified by:
useHelp
in classedu.uiuc.ncsa.security.util.cli.ConfigurableCommandsImpl
-
-