Package org.yamcs.client
Class Command
- java.lang.Object
-
- org.yamcs.client.Command
-
- All Implemented Interfaces:
Comparable<Command>
public class Command extends Object implements Comparable<Command>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Command other)
boolean
equals(Object obj)
Acknowledgment
getAcknowledgment(String name)
LinkedHashMap<String,Acknowledgment>
getAcknowledgments()
All acknowledgments by name<T> T
getAttribute(String key)
Map<String,Object>
getAttributes()
Returns all attributes of this commands.byte[]
getBinary()
Binary representation of the commandString
getComment()
String
getError()
Error message in case this command failedLinkedHashMap<String,Object>
getExtraAttributes()
Returns non-standard attributesInstant
getGenerationTime()
String
getId()
String
getName()
String
getOrigin()
String
getQueue()
The assigned command queueAcknowledgment
getQueuedAcknowledgment()
Acknowledgment
getReleasedAcknowledgment()
Acknowledgment
getSentAcknowledgment()
int
getSequenceNumber()
String
getSource()
String representation of the commandString
getUsername()
Username of the issuerint
hashCode()
boolean
isComplete()
Returns whether this command is complete.boolean
isFailure()
Returns true if this command failedboolean
isSuccess()
Returns true if this command has completed successfullyvoid
merge(Command other)
void
merge(Commanding.CommandHistoryEntry entry)
String
toString()
-
-
-
Constructor Detail
-
Command
public Command(String id, String name, String origin, int sequenceNumber, Instant generationTime)
-
Command
public Command(IssueCommandResponse response)
-
-
Method Detail
-
getId
public String getId()
-
getGenerationTime
public Instant getGenerationTime()
-
getName
public String getName()
-
getOrigin
public String getOrigin()
-
getSequenceNumber
public int getSequenceNumber()
-
getUsername
public String getUsername()
Username of the issuer
-
getQueue
public String getQueue()
The assigned command queue
-
getSource
public String getSource()
String representation of the command
-
getBinary
public byte[] getBinary()
Binary representation of the command
-
getAttribute
public <T> T getAttribute(String key)
-
isComplete
public boolean isComplete()
Returns whether this command is complete. A command can be complete, yet still failed.
-
isSuccess
public boolean isSuccess()
Returns true if this command has completed successfully
-
isFailure
public boolean isFailure()
Returns true if this command failed
-
getError
public String getError()
Error message in case this command failed
-
getComment
public String getComment()
-
merge
public void merge(Commanding.CommandHistoryEntry entry)
-
merge
public void merge(Command other)
-
getExtraAttributes
public LinkedHashMap<String,Object> getExtraAttributes()
Returns non-standard attributes
-
getAcknowledgments
public LinkedHashMap<String,Acknowledgment> getAcknowledgments()
All acknowledgments by name
-
getQueuedAcknowledgment
public Acknowledgment getQueuedAcknowledgment()
-
getReleasedAcknowledgment
public Acknowledgment getReleasedAcknowledgment()
-
getSentAcknowledgment
public Acknowledgment getSentAcknowledgment()
-
getAcknowledgment
public Acknowledgment getAcknowledgment(String name)
-
compareTo
public int compareTo(Command other)
- Specified by:
compareTo
in interfaceComparable<Command>
-
-