|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.object.PersistentObject
com.waveset.object.TaskInstance
A class used to represent instances of background tasks.
Nested Class Summary |
Nested classes inherited from class com.waveset.object.PersistentObject |
PersistentObject.Comparator, PersistentObject.InitialInstance |
Field Summary | |
static java.lang.String |
code_id
|
static java.lang.String |
DATE_FORMAT
Deprecated. Use Util.getCanonicalDateString and Util.stringToDate instead. |
static java.lang.String |
OWNER_PREFIX_TEMP
|
static java.lang.String |
OWNER_PREFIX_USER
Originally only Administrators could launch tasks, but eventually end-users also could launch tasks. |
static java.lang.String |
VAR_RESULT_LIMIT
Deprecated. - use setResultLimit(int) instead. |
static java.lang.String |
VAR_TASK_STATUS
Deprecated. This will be removed when VAR_RESULT_LIMIT is refactored. |
Fields inherited from class com.waveset.object.PersistentObject |
_trace, trace |
Constructor Summary | |
TaskInstance()
Create an empty task instance. |
|
TaskInstance(org.w3c.dom.Element e)
Create the task instance by parsing its DOM representation. |
Method Summary | |
protected void |
addSubclassAttributes(java.lang.StringBuffer b)
Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist). |
protected void |
addSubclassElements(java.lang.StringBuffer b)
Each concrete subclass may append to the buffer an XML representation of any fields it adds to PersistentObject (if those field values must persist). |
protected WSAttribute |
getAttributeValues(java.lang.String attrName)
|
TaskDefinition |
getDefinition()
Get the task definition object. |
ObjectRef |
getDefinitionRef()
Get the reference to the task definition. |
java.lang.String |
getDescription()
Get the optional task description. |
int |
getExecutionTime()
Get the cumulative execution time in seconds. |
java.util.Date |
getExpirationDate()
Get the task expiration date. |
java.lang.String |
getExtendedStatus()
|
XmlObject |
getExtension()
Get the optional extension object. |
java.lang.String |
getHost()
Get the execution host name. |
java.util.List |
getHosts()
|
java.lang.String |
getOutputDir()
|
java.lang.String |
getOwner()
Get the task owner. |
boolean |
getProcessed()
|
java.lang.String |
getProgress()
|
java.util.ArrayList |
getReferences()
Return the list of references within this object. |
TaskState |
getRequestedState()
Get the requested task state. |
WavesetResult |
getResult()
Get the result object. |
int |
getResultLimit()
|
java.util.Date |
getResumeDate()
Get the task resume date. |
TaskSchedule |
getSchedule()
Get the task schedule object. |
ObjectRef |
getScheduleRef()
Get the reference to the task schedule. |
java.util.Date |
getStartDate()
Get the task start date. |
TaskState |
getState()
Get the task state. |
java.lang.String |
getSubject()
Get the authorization subject (serialized as XML). |
Subject |
getSubjectObject()
Rebuild the Subject object. |
WSAttributes |
getSummaryAttributes()
|
java.lang.String |
getTrackingId()
Get the optional tracking id. |
Type |
getType()
Returns the associated Type object. |
java.lang.Object |
getVariable(java.lang.String name)
Get the value of one runtime variable. |
GenericObject |
getVariables()
Get the runtime variables. |
boolean |
hasExtendedResult()
|
void |
hasExtendedResult(boolean b)
|
boolean |
isFinished()
Test task completion. |
boolean |
isTerminated()
Get the termation flag. |
java.util.List |
listQueryableAttributes()
|
java.util.List |
listSummaryAttributes()
Returns the complete list of defined attributes
that this type of persistent object exposes as summary attributes
(regardless of whether this particular object has a value for each). |
protected void |
parseSubclassAttributes(org.w3c.dom.Element e)
Each concrete subclass should parse from the XML buffer any persisted subclass-specific fields (generally, the same ones that it writes into the buffer). |
protected void |
parseSubclassElements(org.w3c.dom.Element e)
Each concrete subclass should parse from the XML buffer any persisted subclass-specific elements (generally, the same ones that it writes into the buffer). |
void |
setDefinition(TaskDefinition def)
Set the task definition. |
void |
setDefinitionRef(ObjectRef ref)
Set the reference to the definition. |
void |
setDescription(java.lang.String d)
Set the optional task description. |
void |
setExecutionTime(int t)
Set the cumulative execution time in seconds. |
void |
setExpirationDate(java.util.Date d)
Set the task expiration date. |
void |
setExtendedStatus(java.lang.String status)
|
void |
setExtension(XmlObject obj)
Set the optional extension object. |
void |
setHost(java.lang.String h)
Set the execution host. |
void |
setHosts(java.util.List l)
|
void |
setOutputDir(java.lang.String outputDir)
|
void |
setOwner(java.lang.String o)
Set the task owner. |
void |
setProcessed(boolean processed)
|
void |
setProgress(java.lang.String msg)
|
void |
setRequestedState(TaskState s)
Set the requsted task state. |
void |
setResult(WavesetResult res)
Set the result object. |
void |
setResultLimit(int l)
Set the limit in seconds that a task instance is allowed to live after the task has completed. |
void |
setResumeDate(java.util.Date d)
Get the task wakup date. |
void |
setSchedule(TaskSchedule sched)
Set the task schedule. |
void |
setScheduleRef(ObjectRef ref)
Set the reference to the schedule. |
void |
setStartDate(java.util.Date d)
Set the task start date. |
void |
setState(TaskState s)
Set the task state. |
void |
setSubject(java.lang.String s)
Set the authorization subject (serialized as XML). |
void |
setTerminated(boolean b)
Set the termation flag. |
void |
setTrackingId(java.lang.String id)
Set an optional tracking ID. |
void |
setVariable(java.lang.String name,
java.lang.Object value)
Set the value of one runtime variable. |
void |
setVariables(GenericObject vars)
Set the entire collection of runtime variables. |
void |
visit(Visitor v)
Visitor interface. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String code_id
public static final java.lang.String OWNER_PREFIX_USER
We do however continue to use a special prefix for tasks launched by the anonymous user GUI.
public static final java.lang.String OWNER_PREFIX_TEMP
public static final java.lang.String VAR_RESULT_LIMIT
setResultLimit(int)
instead.
public static final java.lang.String VAR_TASK_STATUS
public static final java.lang.String DATE_FORMAT
Constructor Detail |
public TaskInstance()
public TaskInstance(org.w3c.dom.Element e) throws WavesetException
Method Detail |
public Type getType()
getType
in class PersistentObject
public java.util.ArrayList getReferences()
getReferences
in class PersistentObject
public void visit(Visitor v) throws WavesetException
visit
in class PersistentObject
WavesetException
public ObjectRef getDefinitionRef()
public void setDefinitionRef(ObjectRef ref)
public TaskDefinition getDefinition() throws WavesetException
WavesetException
public void setDefinition(TaskDefinition def)
public ObjectRef getScheduleRef()
public void setScheduleRef(ObjectRef ref)
public TaskSchedule getSchedule() throws WavesetException
WavesetException
public void setSchedule(TaskSchedule sched)
public java.lang.String getDescription()
public void setDescription(java.lang.String d)
public java.lang.String getOwner()
public void setOwner(java.lang.String o)
public TaskState getState()
public void setState(TaskState s)
public boolean isFinished()
public boolean isTerminated()
public void setTerminated(boolean b)
public java.util.Date getStartDate()
public void setStartDate(java.util.Date d)
public java.util.Date getExpirationDate()
public void setExpirationDate(java.util.Date d)
This should only be set by the scheduler when the task reaches the FINISHED state, it is used by the scheduler in queries to check for task expiry. We could use this to terminate long running EXECUTING tasks as well.
getExpirationDate()
public int getExecutionTime()
public void setExecutionTime(int t)
public void setResumeDate(java.util.Date d)
public java.util.Date getResumeDate()
public java.lang.String getSubject()
public void setSubject(java.lang.String s)
public Subject getSubjectObject() throws WavesetException
WavesetException
public void setTrackingId(java.lang.String id)
public java.lang.String getTrackingId()
public GenericObject getVariables()
public void setVariables(GenericObject vars)
public java.lang.Object getVariable(java.lang.String name)
public void setVariable(java.lang.String name, java.lang.Object value)
public WavesetResult getResult()
A task always has a result object, we'll create one if necessary.
public void setResult(WavesetResult res)
public java.lang.String getHost()
public void setHost(java.lang.String h)
public XmlObject getExtension()
public void setExtension(XmlObject obj)
public java.util.List getHosts()
public void setHosts(java.util.List l)
public void setResultLimit(int l)
A limit of zero means that the TaskInstance will be deleted immediately after the task is complete.
A limit of -1 means that the TaskInstance will never be automatically deleted, though it may be manually deleted by the user.
public int getResultLimit()
public void setExtendedStatus(java.lang.String status)
public java.lang.String getExtendedStatus()
public java.lang.String getProgress()
public void setProgress(java.lang.String msg)
public void setProcessed(boolean processed)
public boolean getProcessed()
public java.lang.String getOutputDir()
public void setOutputDir(java.lang.String outputDir)
public boolean hasExtendedResult()
WavesetResult
object has (or objects have) been stored outside this task instance;
otherwise false;
An application must call getExtendedResult()
(on an instance of LocalSession
,
TaskManager
, or Executor
)
in order to retrieve the associated result object(s).
public void hasExtendedResult(boolean b)
public java.util.List listSummaryAttributes()
PersistentObject
defined attributes
that this type of persistent object exposes as summary attributes
(regardless of whether this particular object has a value for each).
Any subclass of PersistentObject that overrides this method
should first invoke super.listSummaryAttributes()
to ensure that the subclass includes summary attributes
that are common to all PersistentObjects.
Any subclass that overrides this implementation must also consider the length of the summary string that will be generated from these attributes.
listSummaryAttributes
in class PersistentObject
defined attributes
that this type of PersistentObject exposes as summary attributes
(regardless of whether this object has a value for each).
Any subclass of PersistentObject that overrides this method
should first invoke super.listSummaryAttributes()
to ensure that the subclass includes summary attributes
that are common to all PersistentObjects.
Constants.MAX_SUMMARY_STRING_LENGTH
,
PersistentObject.getSummaryString()
public java.util.List listQueryableAttributes()
listQueryableAttributes
in class PersistentObject
defined attributes
that this type of PersistentObject exposes as queryable attributes
(regardless of whether this object has a value for each).
Any subclass of PersistentObject that overrides this method
should first invoke super.listQueryableAttributes()
to ensure that the subclass includes queryable attributes
that are common to all PersistentObjects.
public WSAttributes getSummaryAttributes()
getSummaryAttributes
in class PersistentObject
attribute values
to be displayed when this object appears in a list.
The WSAttributes
contains
a WSAttribute
for each summary attribute.
Each WSAttribute
may contain multiple values.
Any subclass of PersistentObject that overrides this method
should first invoke super.getSummaryAttributes()
to ensure that the subclass includes summary attributes
that are common to all PersistentObjects.
If a subclass wants to expose a different set of summary attributes,
that subclass should override {@link #listSummaryAttributes}.
In order to supply values for summary attributes
that may not be available in PersistentObject
(e.g., from a field specified to that subclass),
such a subclass may also override {@link #getAttributeValues(Attribute)}.
A subclass should not need to override this method
(except to limit the number of values for a summary attribute).
protected WSAttribute getAttributeValues(java.lang.String attrName)
getAttributeValues
in class PersistentObject
attrName
- - the name of the attribute for which to return values.
WSAttribute
that represents the value (or values)
that this object contains for the specified attribute.
public TaskState getRequestedState()
public void setRequestedState(TaskState s)
protected void addSubclassAttributes(java.lang.StringBuffer b)
PersistentObject
NOTE: Any subclass that overrides this method must similarly override parseSubclassAttributes() so that the subclass attributes are restored.
addSubclassAttributes
in class PersistentObject
protected void addSubclassElements(java.lang.StringBuffer b)
PersistentObject
NOTE: Any subclass that overrides this method must similarly override parseSubclassElements() so that the subclass elements are restored.
addSubclassElements
in class PersistentObject
protected void parseSubclassAttributes(org.w3c.dom.Element e) throws WavesetException
PersistentObject
parseSubclassAttributes
in class PersistentObject
WavesetException
PersistentObject's default implementation is a no-op.
,
PersistentObject.parseXml(Element)
protected void parseSubclassElements(org.w3c.dom.Element e) throws WavesetException
PersistentObject
parseSubclassElements
in class PersistentObject
WavesetException
PersistentObject's default implementation is a no-op.
,
PersistentObject.parseXml(Element)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |