public class SequenceTask extends Object implements DTDConstants
DTDConstants.SENDING while active, waiting for its complete
clause.SequenceSteps.| Modifier and Type | Field and Description |
|---|---|
private String[] |
broadcast
All broadcasts in this task, filled in at run-time.
|
private Map<String,String> |
broadcastwith
Lookup table of broadcast templates to their single activator.
|
private Map<String,String> |
commandid
Lookup table of command templates (keys) to their unique id.
|
private Map<String,String> |
commandinit
Lookup table of command templates to their single initializer.
|
private Map<String,String> |
commandparameter
Lookup table of command templates to their single parameter name.
|
private Map<String,String> |
commandref
Lookup table of command templates (keys) to their unique reference.
|
private String[] |
commands
All command templates in this task, filled in at run-time.
|
private String |
complete
The complete condition.
|
private String |
condition
The condition that must evaluate to true, for this task to commence.
|
private String |
done
The current status of the task, finished, sending, or new.
|
private String |
id
The unique id of the task, from the XML file.
|
private String[] |
setfalse
All variables that should be set to false on task start.
|
private String[] |
settrue
All variables that should be set to true on task start.
|
ABORT, ABOVE, ABSTRACT, ABSTRACTPROPOSAL, ADDRESS, BELOW, BLOCK, BROADCAST, BROADCASTWITH, BV, CHAINING, CHANGE, CLASS, COMMAND, COMMANDID, COMMANDINIT, COMMANDLAST, COMMANDPARAMETER, COMMANDREF, COMMENT, COMPLETE, CONDITION, CONSTANT, CONSTANTNAME, CONSTANTVALUE, CONSTRAINT, CONSTRAINTOVERDUE, CONSTRAINTRELAX, DATA, DAUGHTER, DEC, DELAY, DELAYMAX, DELAYTIME, DISABLED, DOCPATH, DURATION, ELAPSED, EMAIL, ENABLED, EPOCH, EQUINOX, EXCEPTION, EXCEPTIONDAUGHTER, EXCEPTIONFOR, EXCEPTIONSUCCESSOR, EXCEPTIONTHIS, FALSE, FIELDOFVIEW, FILE, FITSHEADER, FITSHEADERID, FORMATCLASS, FORMATPATTERN, FROM, GAIN, HISTORY, HISTORYCOMPLETE, HISTORYDB, HISTORYMAX, HISTORYREAD, IGNORE, IMAGETYPE, INIT, INSTITUTION, INSTRUMENT, INTERN, KEY, MAX, MERIT, MIN, NOTIFY, OBJECT, OBJECTID, OBJECTNAME, OBSERVSTART, PICK, PICKMERIT, PICKSUCCESS, PMDEC, PMRA, POSITION, RA, RATE, REC, REQUIRES, RETRY, RETRYMAX, SELECT, SENDING, SEQUENCE, SEQUENCETYPE, SET, SETNAME, SETUP, SETUPID, STEP, STEPCOUNTER, STEPWHILE, SUCCESSOR, TARGET, TARGETACCESS, TARGETDB, TARGETNAME, TARGETNAMEPROPOSAL, TARGETREAD, TARGETSUBMITTED, TARGETTYPE, TASK, TASKDONE, TASKID, TEAM, TIMESLOT, TITLE, TO, TRUE, USER, V, VARIABLE| Constructor and Description |
|---|
SequenceTask(Element src)
Constructs a new task element from an element and immediately parses
it.
|
| Modifier and Type | Method and Description |
|---|---|
private static String[] |
extractAll(Element src,
String tag)
Returns a string array of all first child nodes of the nodes found
in the list.
|
String[] |
getBroadcasts()
Returns all command templates tied to this task.
|
String |
getBroadcastWith(String template)
Returns the broadcast with-attribute linked to the broadcast with
argumental template.
|
String |
getCommandID(String template)
Returns the command id-attribute linked to the command with
argumental command template.
|
String |
getCommandInit(String template)
Returns the command initialization string.
|
String |
getCommandParameter(String template)
Returns all parameter names linked to the command element whose
template name is equal to the argument.
|
String |
getCommandRef(String template)
Returns the command ref-attribute linked to the command with
argumental command template.
|
String[] |
getCommands()
Returns all broadcast templates.
|
String |
getComplete()
Returns the complete condition tied to this task.
|
String |
getCondition()
Returns the condition of this task element.
|
String[] |
getFalse()
Returns all triggers by name that get false as tied to this task.
|
String |
getID()
Returns the value of the id attribute of this task element.
|
String[] |
getTrue()
Returns all triggers by name that get true as tied to this task.
|
boolean |
isDone()
Returns true if the value of the done attribute of this
task element is true.
|
boolean |
isSending()
Returns true if the value of the done attribute of this
task element is sending.
|
private void |
parseTask(Element anchor)
Parses a DOM elements into all parts of a valid sequence task.
|
void |
setDone(boolean to)
Sets the value of the done attribute.
|
void |
setSending()
Sets the value of the done attribute to
DTDConstants.SENDING. |
String |
toString()
String version of a task element is its ID plus info on done/sending
status if applicable.
|
private String id
private String done
private String condition
private String[] broadcast
private String[] commands
private String[] settrue
private String[] setfalse
private String complete
private Map<String,String> commandid
private Map<String,String> commandref
private Map<String,String> commandparameter
private Map<String,String> commandinit
public SequenceTask(Element src) throws ParseException
ParseExceptionpublic String getID()
public boolean isDone()
public boolean isSending()
public void setDone(boolean to)
public void setSending()
DTDConstants.SENDING.
This method should be called after a condition is met, all the
command templates have been extracted and sent to the devices.
After this method has been called, further calls to
#getCommand return null to indicate that no more
commands have to be sent for this task.public String getCondition()
public String getComplete()
public String[] getCommands()
public String[] getBroadcasts()
DTDConstants.SENDING (via the
done attribute of the task), null is returned.public String getBroadcastWith(String template)
public String getCommandInit(String template)
public String getCommandParameter(String template)
public String getCommandID(String template)
public String getCommandRef(String template)
public String[] getTrue()
public String[] getFalse()
public String toString()
private void parseTask(Element anchor) throws ParseException
ParseException