Console

In Java, the term "console" is often used to refer to standard output (System.out) or standard error (System.err). These are usually connected to the console (or terminal) of the operating system in which the Java application is running. This allows for printing messages or reporting errors, which is especially useful for debugging purposes.

nyssr.net nodes use a simple console consisting of two components.

One component is a console service that allows for the installation of console handlers. These are targets that register various commands and corresponding help texts within the console service. When the console service receives an input (something typed into a console), it forwards this input to the appropriate target. The target processes the input (e.g., performs an action) and returns a response text that should be displayed on the console.

The other component is the visible console responsible for text input and output. It is simply a target (CCliDisplayTarget) that accepts input from the terminal and sends it to the console service. In return, it outputs texts received via a nanoservice to standard output.

The advantage of this separation between text interpretation and text output is that the output does not need to occur on the same node where it was generated. By using the command connect [NodeId], the local node's CCliDisplayTarget connects to the console service of a remote node on the other side of the world. Now, commands can be issued to that remote node as if it were the local node. It doesn't matter whether the remote console is accessible or not (e.g., the node is running in a container).