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>
-
-
Constructor Summary
Constructors Constructor Description Command(String id, String name, List<Commanding.CommandAssignment> assignments, String origin, int sequenceNumber, Instant generationTime)Command(IssueCommandResponse response)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Command other)booleanequals(Object obj)AcknowledgmentgetAcknowledgment(String name)LinkedHashMap<String,Acknowledgment>getAcknowledgments()All acknowledgments by name<T> TgetAttribute(String key)Map<String,Object>getAttributes()Returns all attributes of this commands.byte[]getBinary()Binary representation of the commandStringgetComment()StringgetError()Error message in case this command failedLinkedHashMap<String,Object>getExtraAttributes()Returns non-standard attributesInstantgetGenerationTime()StringgetId()StringgetName()StringgetOrigin()StringgetQueue()The assigned command queueAcknowledgmentgetQueuedAcknowledgment()AcknowledgmentgetReleasedAcknowledgment()AcknowledgmentgetSentAcknowledgment()intgetSequenceNumber()StringgetSource()String representation of the commandStringgetUsername()Username of the issuerinthashCode()booleanisComplete()Returns whether this command is complete.booleanisFailure()Returns true if this command failedbooleanisSuccess()Returns true if this command has completed successfullyvoidmerge(Command other)voidmerge(Commanding.CommandHistoryEntry entry)StringtoString()
-
-
-
Constructor Detail
-
Command
public Command(String id, String name, List<Commanding.CommandAssignment> assignments, 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:
compareToin interfaceComparable<Command>
-
-