Package org.sensorhub.api.command
Interface ICommandStatus
- All Known Implementing Classes:
CommandStatus
public interface ICommandStatus
Represents command status messages sent asynchronously by control interfaces.
The status report contains a status code identifying the current state of
the task/command in the state machine (see diagram in the documentation).
Depending of this status code, getExecutionTime()
can return the
estimated, scheduled or actual execution time of the command.
If a command is executed immediately, the instance of this class returned
after submitting the command will have a final status code such as
ICommandStatus.CommandStatusCode.COMPLETED
, ICommandStatus.CommandStatusCode.REJECTED
.
For long running tasks or commands that are scheduled for later execution, the initial status report will carry a non-final status code.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Status of the command provided by the receiver. -
Method Summary
-
Method Details
-
getCommandID
BigId getCommandID()- Returns:
- The internal ID of the command that this status relates to. The initial status report must always include the command ID.
-
getReportTime
Instant getReportTime()- Returns:
- The time at which this status report was generated by the command receiver
-
getStatusCode
ICommandStatus.CommandStatusCode getStatusCode()- Returns:
- The command status code
-
getExecutionTime
TimeExtent getExecutionTime()- Returns:
- The execution time of the command. This can be an estimated,
scheduled or actual execution time depending on the command status.
See
ICommandStatus.CommandStatusCode
-
getProgress
int getProgress()- Returns:
- The percentage of progress if it can be computed, -1 otherwise.
-
getMessage
String getMessage()- Returns:
- A status message, which can be either an error message or an informative message, depending on the status code
-
getResult
ICommandResult getResult()- Returns:
- The result of the command (either inline of by reference)
-
isFinal
default boolean isFinal()
-