Class CommandManager


  • public class CommandManager
    extends Object
    This is the "engine" that drives the CLI. This is a singleton class.
    • Field Detail

      • TRANSACTION_ID

        public static final org.forgerock.services.TransactionId TRANSACTION_ID
    • 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()
        Returns true is log is turned off.
        Returns:
        true is 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 CLIException
        Services 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()
        Returns true if command manager is created from JSP.
        Returns:
        true if 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.