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>, org.jgrapes.core.Associator, org.jgrapes.core.Eligible
Direct Known Subclasses:
CpuAdded, CpuDeleted, DisplayPasswordChanged, HotpluggableCpuStatus, QmpConfigured

public class MonitorResult extends org.jgrapes.core.Event<Void>
Signals the reception of a result from executing a QMP command.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface java.util.concurrent.Future

    Future.State
  • Field Summary

    Fields inherited from class org.jgrapes.core.internal.EventBase

    completed, completionEvents, invokedFor
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    MonitorResult(QmpCommand command, com.fasterxml.jackson.databind.JsonNode response)
    Instantiates a new monitor result.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the error class if this result is an error.
    Returns the error description if this result is an error.
    Combines error class and error description to a string “class: desc”.
    Returns the executed executed.
    from(QmpCommand command, com.fasterxml.jackson.databind.JsonNode response)
    Create event from data.
    boolean
    Returns true if executed has been executed successfully.
     
    com.fasterxml.jackson.databind.JsonNode
    Returns the values that come with the response.

    Methods inherited from class org.jgrapes.core.Event

    addCompletionEvent, associated, cancel, channels, channels, completionEvents, currentResults, defaultCriterion, forChannels, get, get, handled, handlingError, isCancelled, isDone, isEligibleFor, isStopped, processedBy, results, results, resumeHandling, setAssociated, setChannels, setRequiresResult, setResult, stop, suspendHandling, suspendHandling, tieTo

    Methods inherited from class org.jgrapes.core.internal.EventBase

    disableTracking, enqueued, firstResultAssigned, isTracked, onCompletion

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.jgrapes.core.Associator

    associated, associated, associated, associatedGet

    Methods inherited from interface java.util.concurrent.Future

    exceptionNow, resultNow, state
  • 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 org.jgrapes.core.Event<Void>