Class CliFrontend


  • public class CliFrontend
    extends Object
    Implementation of a simple command line frontend for executing programs.
    • Method Detail

      • getConfiguration

        public Configuration getConfiguration()
        Getter which returns a copy of the associated configuration.
        Returns:
        Copy of the associated configuration
      • getCustomCommandLineOptions

        public org.apache.commons.cli.Options getCustomCommandLineOptions()
      • run

        protected void run​(String[] args)
                    throws Exception
        Executions the run action.
        Parameters:
        args - Command line arguments for the run action.
        Throws:
        Exception
      • info

        protected void info​(String[] args)
                     throws Exception
        Executes the info action.
        Parameters:
        args - Command line arguments for the info action.
        Throws:
        Exception
      • list

        protected void list​(String[] args)
                     throws Exception
        Executes the list action.
        Parameters:
        args - Command line arguments for the list action.
        Throws:
        Exception
      • stop

        protected void stop​(String[] args)
                     throws Exception
        Executes the STOP action.
        Parameters:
        args - Command line arguments for the stop action.
        Throws:
        Exception
      • cancel

        protected void cancel​(String[] args)
                       throws Exception
        Executes the CANCEL action.
        Parameters:
        args - Command line arguments for the cancel action.
        Throws:
        Exception
      • getCommandLine

        public org.apache.commons.cli.CommandLine getCommandLine​(org.apache.commons.cli.Options commandOptions,
                                                                 String[] args,
                                                                 boolean stopAtNonOptions)
                                                          throws CliArgsException
        Throws:
        CliArgsException
      • savepoint

        protected void savepoint​(String[] args)
                          throws Exception
        Executes the SAVEPOINT action.
        Parameters:
        args - Command line arguments for the savepoint action.
        Throws:
        Exception
      • checkpoint

        protected void checkpoint​(String[] args)
                           throws Exception
        Executes the CHECKPOINT action.
        Parameters:
        args - Command line arguments for the checkpoint action.
        Throws:
        Exception
      • parseAndRun

        public int parseAndRun​(String[] args)
        Parses the command line arguments and starts the requested action.
        Parameters:
        args - command line arguments of the client.
        Returns:
        The return code of the program
      • main

        public static void main​(String[] args)
        Submits the job based on the arguments.
      • getConfigurationDirectoryFromEnv

        public static String getConfigurationDirectoryFromEnv()
      • validateAndGetActiveCommandLine

        public CustomCommandLine validateAndGetActiveCommandLine​(org.apache.commons.cli.CommandLine commandLine)
        Gets the custom command-line for the arguments.
        Parameters:
        commandLine - The input to the command-line.
        Returns:
        custom command-line which is active (may only be one at a time)