public abstract class TplCommand extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ABORTED
The command has been aborted.
|
static String |
ABORTEDBY
The command was aborted by an other command.
|
private boolean |
acknowledged
True if command was acknowledged with a 'COMMAND state' event.
|
static String |
BUSY
The get/set value error signaling busy callback execution.
|
private Date |
commenced
The time-stamp the commands commence-method has been called.
|
static String |
COMPLETE
The command has completed the callback execution.
|
private boolean |
completed
True if command was completed with a 'COMMAND state' event.
|
static String |
DENIED
The get/set value error access not granted.
|
static String |
DIMENSION
The get/set value error dimensional error on array.
|
static String |
ERROR
General indicator for errors.
|
static String |
FAILED
The error signaling failed callback execution.
|
private int |
id
The command id.
|
static String |
IDBUSY
The error signaling id-collision.
|
private Object |
info
Unparsed additional info.
|
static String |
INVALID
The get/set value error signaling invalid struct definition.
|
static String |
LOCKED
The get/set value error signaling failed callback lock acquire.
|
static String |
NOTRUNNING
The abort can not commence, requested command not running.
|
static String |
OK
General indicator for okay.
|
static String |
OVERRUN
The error signaling too complex commands.
|
static String |
RANGE
The set value error for not-in-allowed-range.
|
private boolean |
sending
True, if command is sending.
|
private Object |
state
Any parsable status out of a TplEvent.
|
static String |
SYNTAX
The error signaling syntax errors.
|
static String |
TIMEOUT
The error signaling timeout-on-command.
|
static String |
TOOMANY
The error signaling too many commands.
|
static String |
TYPE
The set value error for non-compatible type.
|
static String |
UNKNOWN
The get/set value error signaling unknown variable name.
|
| Modifier | Constructor and Description |
|---|---|
protected |
TplCommand(int unique)
Constructs a new TPL-Command with the specific id.
|
| Modifier and Type | Method and Description |
|---|---|
String |
commenceCommand()
Commences the command.
|
abstract String |
getCommandLead()
Returns the part of the command that is the command lead.
|
Date |
getCommencedWhen()
Returns the date this command was commenced.
|
int |
getID()
Returns the command id.
|
Object |
getInfo()
Returns unparsed additional info if available.Interpretation depends
on the state the command was in.
|
Object |
getState()
Returns the status of this command.
|
int |
hashCode()
Returns the id as the hash-code.
|
boolean |
isAcknowledged()
Returns true if this command was acknowledged.
|
boolean |
isCompleted()
Returns true if this command was completed.
|
boolean |
isSending()
Returns rtue if this command is sending.
|
boolean |
parseTplEvent(TplEvent reply)
Takes a TPL-Event of command and parses errors and completeness state
out of it.
|
protected void |
setInfo(Object parsedinfo)
Subclasses may change the content of the info field.
|
protected void |
setState(Object parsedinfo)
Subclasses may change the content of the state field due to a confusing
protocol this was added rather late.
|
String |
toString()
Returns the string representation of the command.
|
public static final String OK
public static final String ERROR
public static final String COMPLETE
public static final String FAILED
public static final String ABORTED
public static final String ABORTEDBY
public static final String UNKNOWN
public static final String INVALID
public static final String DENIED
public static final String TYPE
public static final String RANGE
public static final String DIMENSION
public static final String BUSY
public static final String LOCKED
public static final String IDBUSY
public static final String SYNTAX
public static final String TIMEOUT
public static final String OVERRUN
public static final String TOOMANY
public static final String NOTRUNNING
private int id
private Date commenced
private boolean sending
private boolean acknowledged
private boolean completed
private Object state
private Object info
protected TplCommand(int unique)
public int getID()
public boolean isSending()
public boolean isAcknowledged()
public boolean isCompleted()
public Date getCommencedWhen()
public Object getState()
public Object getInfo()
protected void setInfo(Object parsedinfo)
protected void setState(Object parsedinfo)
public String commenceCommand()
public String toString()
public abstract String getCommandLead()
public boolean parseTplEvent(TplEvent reply) throws ParseException
ParseException