Class MonitorResult

java.lang.Object
org.jgrapes.core.internal.EventBase<Void>
org.jgrapes.core.Event<Void>
org.jdrupes.vmoperator.runner.qemu.events.MonitorResult
All Implemented Interfaces:
Future<Void>, Associator, Eligible
Direct Known Subclasses:
CpuAdded, CpuDeleted, DisplayPasswordChanged, HotpluggableCpuStatus, QmpConfigured

public class MonitorResult extends Event<Void>
Signals the reception of a result from executing a QMP command.
  • Constructor Details

    • MonitorResult

      protected MonitorResult(QmpCommand command, com.fasterxml.jackson.databind.JsonNode response)
      Instantiates a new monitor result.
      Parameters:
      command - the command
      response - the response
  • Method Details

    • from

      public static MonitorResult from(QmpCommand command, com.fasterxml.jackson.databind.JsonNode response)
      Create event from data.
      Parameters:
      command - the command
      response - the response
      Returns:
      the monitor result
    • executed

      public QmpCommand executed()
      Returns the executed executed.
      Returns:
      the executed
    • successful

      public boolean successful()
      Returns true if executed has been executed successfully.
      Returns:
      true, if successful
    • values

      public com.fasterxml.jackson.databind.JsonNode values()
      Returns the values that come with the response.
      Returns:
      the json node
    • errorClass

      Returns the error class if this result is an error.
      Returns:
      the optional
    • errorDescription

      Returns the error description if this result is an error.
      Returns:
      the optional
    • errorMessage

      public String errorMessage()
      Combines error class and error description to a string “class: desc”.

      Returns an empty string is this result is not an error.

      Returns:
      the string
    • toString

      public String toString()
      Overrides:
      toString in class Event<Void>