Package com.sun.identity.cli
Class CommandManager
- java.lang.Object
-
- com.sun.identity.cli.CommandManager
-
public class CommandManager extends Object
This is the "engine" that drives the CLI. This is a singleton class.
-
-
Field Summary
Fields Modifier and Type Field Description static InitializeSysteminitSysstatic ResourceBundleresourceBundlestatic org.forgerock.services.TransactionIdTRANSACTION_ID
-
Constructor Summary
Constructors Constructor Description CommandManager(String[] argv)Constructs a command line manager.CommandManager(Map env)Constructs a command line manager.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddToRequestQueue(CLIRequest request)Adds request to request queue.StringgetCommandName()Returns commandline interface name.static DebuggetDebugger()Returns debugger.ListgetDefinitionObjects()Returns a list of definition objects.LocalegetLocale()Returns locale object.StringgetLogName()Returns log name.IOutputgetOutputWriter()Returns output writer.StringgetProductName()Returns product name.ResourceBundlegetResourceBundle()Returns resource bundle.SubCommandgetSubCommand(String name)Returns the sub command of a given name.StringgetWebEnabledURL()Returns Web enabled URL.booleanisDebugOn()Returns true of the CLI has debug turned on.booleanisLogOff()Returnstrueis log is turned off.booleanisVerbose()Returns true of the CLI has verbose set.static voidmain(String[] argv)Entry point to the engine.voidregisterSSOToken(SSOToken ssoToken)Registers Single Single On Token which will be destroyed after CLI is done.voidserviceRequestQueue()Services the request queue.voidsetContinueFlag(boolean bContinue)Sets/Resets the continue flag.voidsetStatusFileName(String statusFileName)Sets status file name.booleanwebEnabled()Returnstrueif command manager is created from JSP.
-
-
-
Field Detail
-
TRANSACTION_ID
public static final org.forgerock.services.TransactionId TRANSACTION_ID
-
resourceBundle
public static ResourceBundle resourceBundle
-
initSys
public static InitializeSystem initSys
-
-
Constructor Detail
-
CommandManager
public CommandManager(Map env) throws CLIException
Constructs a command line manager.- Parameters:
env- Map of option name to values.- Throws:
CLIException
-
CommandManager
public CommandManager(String[] argv)
Constructs a command line manager.- Parameters:
argv- Options from the command shell.
-
-
Method Detail
-
main
public static void main(String[] argv)
Entry point to the engine.
-
getResourceBundle
public ResourceBundle getResourceBundle()
Returns resource bundle.- Returns:
- resource bundle.
-
getCommandName
public String getCommandName()
Returns commandline interface name.- Returns:
- commandline interface name.
-
setStatusFileName
public void setStatusFileName(String statusFileName) throws CLIException
Sets status file name.- Parameters:
statusFileName- Status file name.- Throws:
CLIException- if status file cannot be created.
-
getDefinitionObjects
public List getDefinitionObjects()
Returns a list of definition objects. Since this class is just a engine, it requires definition objects to dictate the behavior of the CLI.- Returns:
- a list of definition objects.
-
isLogOff
public boolean isLogOff()
Returnstrueis log is turned off.- Returns:
trueis log is turned off.
-
getLogName
public String getLogName()
Returns log name.- Returns:
- log name.
-
getLocale
public Locale getLocale()
Returns locale object.- Returns:
- locale object.
-
isVerbose
public boolean isVerbose()
Returns true of the CLI has verbose set.- Returns:
- true of the CLI has verbose set.
-
isDebugOn
public boolean isDebugOn()
Returns true of the CLI has debug turned on.- Returns:
- true of the CLI has debug turned on.
-
getDebugger
public static Debug getDebugger()
Returns debugger.- Returns:
- debugger.
-
getOutputWriter
public IOutput getOutputWriter()
Returns output writer.- Returns:
- output writer.
-
getSubCommand
public SubCommand getSubCommand(String name)
Returns the sub command of a given name.- Parameters:
name- Name of Sub Command.- Returns:
- the sub command.
-
getProductName
public String getProductName()
Returns product name.- Returns:
- product name.
-
serviceRequestQueue
public void serviceRequestQueue() throws CLIExceptionServices the request queue.- Throws:
CLIException- if request cannot be processed.
-
setContinueFlag
public void setContinueFlag(boolean bContinue)
Sets/Resets the continue flag. Queue of requests shall be processed in the event that one or more requests are errornous if this flag is set. On the other hand, queue of requests shall be terminated at the first encountered errorous request if this flag is reset.- Parameters:
bContinue- Continue status flag.
-
addToRequestQueue
public void addToRequestQueue(CLIRequest request)
Adds request to request queue.- Parameters:
request- CLI Request object to be added to the queue.
-
getWebEnabledURL
public String getWebEnabledURL()
Returns Web enabled URL.- Returns:
- Web enabled URL.
-
webEnabled
public boolean webEnabled()
Returnstrueif command manager is created from JSP.- Returns:
trueif command manager is created from JSP.
-
registerSSOToken
public void registerSSOToken(SSOToken ssoToken)
Registers Single Single On Token which will be destroyed after CLI is done.- Parameters:
ssoToken- Single Sign On Token.
-
-