Class CliShell


  • public class CliShell
    extends ACliShell
    The cli shell contains the commands and allows for executing a command. Use addAllCommandsFromClassPath() to add all commands from the current classpath or addCommand() to add them manually.
    • Field Detail

      • commands

        protected java.util.Map<java.lang.String,​ICliCommand> commands
        The commands.
      • context

        protected CliContext context
        The context.
      • subshell

        protected ACliShell subshell
        The subshells.
      • prompt

        protected java.lang.String prompt
        The prompt.
      • cl

        protected java.lang.ClassLoader cl
        The class loader.
    • Constructor Detail

      • CliShell

        public CliShell​(java.lang.Object context,
                        java.lang.String prompt,
                        Tuple2<java.lang.String,​java.lang.Integer> sessionid,
                        java.lang.ClassLoader cl)
        Create a new cli.
    • Method Detail

      • addAllCommandsFromClassPath

        public IFuture<java.lang.Void> addAllCommandsFromClassPath()
        Add all commands from classpath.
        Specified by:
        addAllCommandsFromClassPath in class ACliShell
        Parameters:
        cl - The classloader to use.
      • getCommands

        public java.util.Map<java.lang.String,​ICliCommand> getCommands()
        Get the commands.
        Specified by:
        getCommands in class ACliShell
        Returns:
        The commands.
      • executeCommand

        public IFuture<java.lang.String> executeCommand​(java.lang.String line)
        Execute a command line command and get back the results.
        Specified by:
        executeCommand in class ACliShell
        Parameters:
        command - The command.
        Returns:
        The result of the command.
      • doExecuteCommand

        public IFuture<java.lang.String> doExecuteCommand​(java.lang.String line)
        Do execute a command line command and get back the results.
        Parameters:
        command - The command.
        Returns:
        The result of the command.
      • internalGetShellPrompt

        public IFuture<java.lang.String> internalGetShellPrompt()
        Get the complete prompt (internal method). Calls subshells getPrompt().
        Specified by:
        internalGetShellPrompt in class ACliShell
        Returns:
        the complete prompt;
      • getPrompt

        public java.lang.String getPrompt()
        Get the promt only for this shell part.
        Returns:
        The local promt part.