Class MonitorResult
- All Implemented Interfaces:
Future<Void>
,Associator
,Eligible
- Direct Known Subclasses:
CpuAdded
,CpuDeleted
,DisplayPasswordChanged
,HotpluggableCpuStatus
,QmpConfigured
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
ModifierConstructorDescriptionprotected
MonitorResult
(QmpCommand command, com.fasterxml.jackson.databind.JsonNode response) Instantiates a new monitor result. -
Method Summary
Modifier and TypeMethodDescriptionReturns 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”.executed()
Returns the executed executed.static MonitorResult
from
(QmpCommand command, com.fasterxml.jackson.databind.JsonNode response) Create event from data.boolean
Returns true if executed has been executed successfully.toString()
com.fasterxml.jackson.databind.JsonNode
values()
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
Instantiates a new monitor result.- Parameters:
command
- the commandresponse
- the response
-
-
Method Details
-
from
public static MonitorResult from(QmpCommand command, com.fasterxml.jackson.databind.JsonNode response) Create event from data.- Parameters:
command
- the commandresponse
- the response- Returns:
- the monitor result
-
executed
Returns the executed executed.- Returns:
- the executed
-
successful
Returns true if executed has been executed successfully.- Returns:
- true, if successful
-
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
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
-