Package org.metricshub.ipmi.client
Class SolConsole
java.lang.Object
org.metricshub.ipmi.client.SolConsole
- All Implemented Interfaces:
AutoCloseable
-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Deactivates the SOL payload and releases the console.booleanTells whether the BMC deactivated the console: the session ended, another console took the payload, or the system reset the serial port.input()Returns the characters the system writes on its serial port.booleaninvokeOperations(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).output()Returns the stream whose bytes reach the serial port of the system.voidregisterEventListener(SolEventListener listener) Registers a listener for the status events of the console (break, deactivation, overrun, control lines).voidunregisterEventListener(SolEventListener listener) Unregisters a listener.
-
Method Details
-
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
Returns the stream whose bytes reach the serial port of the system. A write returns once the BMC acknowledged the characters, and fails with anIOExceptionwhen 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
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
Registers a listener for the status events of the console (break, deactivation, overrun, control lines).- Parameters:
listener- the listener
-
unregisterEventListener
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:
closein interfaceAutoCloseable
-