Class SolConsole

java.lang.Object
org.metricshub.ipmi.client.SolConsole
All Implemented Interfaces:
AutoCloseable

public final class SolConsole extends Object implements AutoCloseable
A Serial over LAN console, as streams: what the system writes on its serial port is read from input(), what is written to output() reaches its serial port. Closing the console deactivates the SOL payload; the session of the client stays open.
  • Method Details

    • input

      public InputStream input()
      Returns the characters the system writes on its serial port. A read blocks until characters arrive, and returns -1 once the console is closed or the BMC deactivated it.
      Returns:
      the input stream of the console
    • output

      public OutputStream output()
      Returns the stream whose bytes reach the serial port of the system. A write returns once the BMC acknowledged the characters, and fails with an IOException when it does not.
      Returns:
      the output stream of the console
    • deactivated

      public boolean deactivated()
      Tells whether the BMC deactivated the console: the session ended, another console took the payload, or the system reset the serial port.
      Returns:
      true once the BMC reported the SOL payload deactivated
    • invokeOperations

      public boolean invokeOperations(SolOperation... operations)
      Sends the given operations to the serial port of the system: a break, a flush, the state of the control lines (IPMI 2.0 table 15-3).
      Parameters:
      operations - the operations
      Returns:
      whether the packet was sent
    • registerEventListener

      public void registerEventListener(SolEventListener listener)
      Registers a listener for the status events of the console (break, deactivation, overrun, control lines).
      Parameters:
      listener - the listener
    • unregisterEventListener

      public void unregisterEventListener(SolEventListener listener)
      Unregisters a listener.
      Parameters:
      listener - the listener
    • close

      public void close()
      Deactivates the SOL payload and releases the console. Closing a closed console does nothing.
      Specified by:
      close in interface AutoCloseable