Package org.sensorhub.api.command
Class CommandStatus
java.lang.Object
org.sensorhub.api.command.CommandStatus
- All Implemented Interfaces:
 ICommandStatus
Immutable class used as command status report
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classCommandStatus.CommandStatusBuilder<B extends CommandStatus.CommandStatusBuilder<B,T>, T extends CommandStatus> Nested classes/interfaces inherited from interface org.sensorhub.api.command.ICommandStatus
ICommandStatus.CommandStatusCode - 
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BigIdprotected TimeExtentprotected Stringprotected intprotected Instantprotected ICommandResultprotected ICommandStatus.CommandStatusCode - 
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedCommandStatus(BigId commandID, ICommandStatus.CommandStatusCode statusCode, TimeExtent executionTime)  - 
Method Summary
Modifier and TypeMethodDescriptionstatic ICommandStatusGenerate a status report for a command that was immediately accepted but will be executed later onstatic ICommandStatusGenerate a status report for a command that was immediately executed and completed successfullystatic ICommandStatuscompleted(BigId commandID, TimeExtent execTime) Generate a status report for a command that was asynchronously executed and completed successfullystatic ICommandStatuscompleted(BigId commandID, TimeExtent execTime, ICommandResult result) Generate a status report for a command that was asynchronously executed and completed successfully with a resultstatic ICommandStatusGenerate a status report for a command that failed during executionintstatic ICommandStatusGenerate a status report for a command that is pending and will be processed later onstatic ICommandStatusprogress(BigId commandID, int progress, String message, TimeExtent execTime) Generate a status report for a command that is in-progressstatic ICommandStatusGenerate a status report for a command that was immediately rejectedstatic ICommandStatusscheduled(BigId commandID, TimeExtent execTime) Generate a status report for a command that is scheduled to be executed later ontoString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.sensorhub.api.command.ICommandStatus
isFinal 
- 
Field Details
- 
commandID
 - 
reportTime
 - 
executionTime
 - 
statusCode
 - 
progress
protected int progress - 
message
 - 
result
 
 - 
 - 
Constructor Details
- 
CommandStatus
protected CommandStatus() - 
CommandStatus
protected CommandStatus(BigId commandID, ICommandStatus.CommandStatusCode statusCode, TimeExtent executionTime)  
 - 
 - 
Method Details
- 
completed
Generate a status report for a command that was immediately executed and completed successfully- Parameters:
 commandID- The ID of the command triggering the report- Returns:
 - The status report
 
 - 
rejected
Generate a status report for a command that was immediately rejected- Parameters:
 commandID- The ID of the command triggering the reporterrorMsg- The error message- Returns:
 - The status report
 
 - 
failed
Generate a status report for a command that failed during execution- Parameters:
 commandID- The ID of the command triggering the reporterrorMsg- The error message- Returns:
 - The status report
 
 - 
pending
Generate a status report for a command that is pending and will be processed later on- Parameters:
 commandID- The ID of the command triggering the reporttaskID- ID assigned to the command/task- Returns:
 - The status report
 
 - 
accepted
Generate a status report for a command that was immediately accepted but will be executed later on- Parameters:
 commandID- The ID of the command triggering the report- Returns:
 - The status report
 
 - 
scheduled
Generate a status report for a command that is scheduled to be executed later on- Parameters:
 commandID- The ID of the command triggering the reportexecTime- The time (instant or period) at which the command is scheduled to execute- Returns:
 - The status report
 
 - 
progress
public static ICommandStatus progress(BigId commandID, int progress, String message, TimeExtent execTime) Generate a status report for a command that is in-progress- Parameters:
 commandID- The ID of the command triggering the reportprogress- The estimated progress expressed in percentmessage- A message describing the current progress (can be null)execTime- The new estimate of the execution time- Returns:
 - The status report
 
 - 
completed
Generate a status report for a command that was asynchronously executed and completed successfully- Parameters:
 commandID- The ID of the command triggering the reportexecTime- The actual time (or time period) the command was executed- Returns:
 - The status report
 
 - 
completed
Generate a status report for a command that was asynchronously executed and completed successfully with a result- Parameters:
 commandID- The ID of the command triggering the reportexecTime- The actual time (or time period) the command was executedresult- The result (observations) produced during execution of the command- Returns:
 - The status report
 
 - 
getCommandID
- Specified by:
 getCommandIDin interfaceICommandStatus- Returns:
 - The internal ID of the command that this status relates to. The initial status report must always include the command ID.
 
 - 
getReportTime
- Specified by:
 getReportTimein interfaceICommandStatus- Returns:
 - The time at which this status report was generated by the command receiver
 
 - 
getStatusCode
- Specified by:
 getStatusCodein interfaceICommandStatus- Returns:
 - The command status code
 
 - 
getExecutionTime
- Specified by:
 getExecutionTimein interfaceICommandStatus- 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
public int getProgress()- Specified by:
 getProgressin interfaceICommandStatus- Returns:
 - The percentage of progress if it can be computed, -1 otherwise.
 
 - 
getMessage
- Specified by:
 getMessagein interfaceICommandStatus- Returns:
 - A status message, which can be either an error message or an informative message, depending on the status code
 
 - 
getResult
- Specified by:
 getResultin interfaceICommandStatus- Returns:
 - The result of the command (either inline of by reference)
 
 - 
toString
 
 -