Class Console

java.lang.Object
de.rexlcloud.core.console.Console
All Implemented Interfaces:
Runnable

public class Console extends Object implements Runnable
  • Constructor Details

    • Console

      public Console(de.rexlcloud.core.command.CommandRegistry commandRegistry) throws IOException
      Throws:
      IOException
  • Method Details

    • setDebug

      public void setDebug()
    • addConsoleAnimation

      public static void addConsoleAnimation(de.rexlcloud.core.console.animation.ConsoleAnimation animation)
    • ask

      public static String ask(String question, @Nullable @Nullable String defaultAnswer, boolean hidden, de.rexlcloud.core.console.animation.AnimationCompletion... completions)
      Asks a question and waits for the answer, for questions before the console reads commands (the first-start setup). The answer is not logged.
      Parameters:
      defaultAnswer - returned for an empty answer, null for none; shown unless hidden
      hidden - whether the input is masked, e.g. for passwords
      completions - offered with Tab
      Returns:
      the answer, the default for an empty one, or null if there is no console input (e.g. stdin is closed); then the caller should use its defaults
      Throws:
      Console.AskCancelledException - when the user presses Ctrl+C
    • stopLogging

      public void stopLogging()
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • error

      public static void error(String message, Object... placeholder)
    • info

      public static void info(String message, Object... placeholder)
    • error

      public static void error(String message)
    • debug

      public static void debug(String message, Object... placeholder)
    • debug

      public static void debug(String message)
    • warn

      public static void warn(String message, Object... placeholder)
    • warn

      public static void warn(String message)
    • info

      public static void info(String message)
    • write

      public static void write(String message, Object... placeholder)
    • write

      public static void write(String message)
    • infoOnScreenOnly

      public static void infoOnScreenOnly(String message, Object... placeholder)
      Shows an info line on the screen but keeps it out of the log files, e.g. a generated password. Without an interactive console it goes to standard output.
    • clear

      public static void clear()
    • getCommandRegistry

      public de.rexlcloud.core.command.CommandRegistry getCommandRegistry()
    • getCommandCompleter

      public de.rexlcloud.core.console.CommandCompleter getCommandCompleter()
    • getTerminal

      public org.jline.terminal.Terminal getTerminal()
    • getReader

      public org.jline.reader.LineReader getReader()
    • isRunning

      public boolean isRunning()
      false once "stop" was entered. Set from the start, so code that runs before the console thread does not see a stopped cloud.
    • isDebug

      public boolean isDebug()
    • getFileWriter

      public FileWriter getFileWriter()
    • getLogList

      public de.rexlcloud.core.console.LogList getLogList()
    • getConsoleAnimations

      public Queue<de.rexlcloud.core.console.animation.ConsoleAnimation> getConsoleAnimations()
    • getAskCompletions

      public List<de.rexlcloud.core.console.animation.AnimationCompletion> getAskCompletions()
      Completions of the question ask(String, String, boolean, AnimationCompletion...) is waiting for, null otherwise.