|
||||||||||
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.TaskTemplate
A class used to maintain a collection of task launch parameters. These can be stored in the repository to capture complex task inputs for repeated execution. They may also be constructed on the fly as a mechanism to pass task launch arguments through the various layers of the system.
Complex tasks may require the user to specify many input variables before they can be launched. Often, a task needs to be launched repeatedly with a certain set of inputs. Rather that requiring the user to enter those inputs every time the task is launched, the inputs can be encapsulated in a TaskTemplate object and stored. Later, the template can be used to launch the task, elimininating some or all of the user interaction. This is a generalization of the concept first implemented by the UsageReport object, which was used to encapsulate inputs passed to report generation tasks. Since the concept can be useful for any task, it made sense to generalize it so we don't have to invent new storage Types for each task's input collection. The class overlaps a bit with the TaskSchedule class which is used to represent "crontab" entries for tasks scheduled to run in the furture. It would be good if TaskSchedule were retooled to contain a TaskTemplate to avoid duplication. I made it this a real Type rather than a Configuration extension so we can associate authorization with it more easily, and if necessary define template subtypes for more granular control. It is also an XmlObject so that it may be embedded inside other things more easily. It would be good if PersistentObject could evolve to extended AbstractXmlObject.
Nested Class Summary |
Nested classes inherited from class com.waveset.object.PersistentObject |
PersistentObject.Comparator, PersistentObject.InitialInstance |
Field Summary | |
static java.lang.String |
code_id
|
Fields inherited from class com.waveset.object.PersistentObject |
_trace, trace |
Constructor Summary | |
TaskTemplate()
Construct a new empty template object. |
|
TaskTemplate(org.w3c.dom.Element e)
Deserialize a TaskSchedule object from XML. |
|
TaskTemplate(TaskDefinition def)
Create a TaskTemplate based on a TaskDefinition. |
|
TaskTemplate(TaskSchedule sched)
Until TaskSchedule embeds a TaskTemplate, we've got to perform this little value dance to build a template from a schedule entry. |
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). |
void |
assimilateVariables(GenericObject vars,
boolean override)
Assimilates a set of variables into this templates set of variables. |
protected WSAttribute |
getAttributeValues(java.lang.String attrName)
|
TaskDefinition |
getDefinition()
Resolve the task definition. |
java.lang.String |
getDefinitionName()
|
ObjectRef |
getDefinitionRef()
|
java.lang.String |
getDescription()
|
TaskDefinition.ExecMode |
getExecMode()
|
Form |
getForm()
|
ObjectRef |
getFormRef()
|
ObjectGroup |
getGroup()
Resolve the group reference. |
ObjectRef |
getGroupRef()
|
java.util.List |
getHosts()
|
TaskDefinition.ExecMode |
getMode()
Deprecated. use getExecMode instead |
java.lang.String |
getOwner()
|
java.util.ArrayList |
getReferences()
Return the list of references within this object. |
WavesetResult |
getResult()
|
Subject |
getSubject()
|
java.lang.String |
getTaskDisplayName()
|
java.lang.String |
getTaskName()
|
java.lang.String |
getTaskType()
|
java.lang.String |
getTaskTypeDisplayName()
|
java.lang.String |
getTrackingId()
Get the optional tracking id. |
Type |
getType()
Return the Type object associated with this class. |
java.lang.Object |
getVariable(java.lang.String name)
Get the value of one input variable. |
GenericObject |
getVariables()
|
java.lang.String |
getVisibility()
|
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)
|
void |
setDescription(java.lang.String s)
Set the optional description. |
void |
setExecMode(java.lang.String s)
|
void |
setExecMode(TaskDefinition.ExecMode mode)
|
void |
setFormRef(ObjectRef ref)
|
void |
setGroup(ObjectGroup g)
Set the object group. |
void |
setGroup(java.lang.String name)
|
void |
setGroupRef(ObjectRef ref)
|
void |
setHosts(java.util.List l)
|
void |
setMode(java.lang.String s)
Deprecated. - use setExecMode(). |
void |
setMode(TaskDefinition.ExecMode mode)
Deprecated. - use setExecMode(). |
void |
setOwner(java.lang.String owner)
Set the task owner as an anonymous name. |
void |
setResult(WavesetResult res)
Set the initial result. |
void |
setSubject(java.lang.String s)
Set the subject from a serialized string. |
void |
setSubject(Subject subject)
Set the task owner from a Subject. |
void |
setTaskDisplayName(java.lang.String s)
Set the optional task name. |
void |
setTaskName(java.lang.String s)
Set the desired task name. |
void |
setTaskType(java.lang.String s)
Set the task type. |
void |
setTaskTypeDisplayName(java.lang.String s)
Set the task type display name. |
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 input variable. |
void |
setVariables(GenericObject vars)
Set the initial input variables. |
void |
setVisibility(java.lang.String s)
|
void |
visit(Visitor v)
Visitor interface. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.waveset.util.XmlObject |
getElementName, toXml, toXml |
Field Detail |
public static final java.lang.String code_id
Constructor Detail |
public TaskTemplate()
public TaskTemplate(org.w3c.dom.Element e) throws WavesetException
public TaskTemplate(TaskSchedule sched) throws WavesetException
public TaskTemplate(TaskDefinition def) throws WavesetException
Method Detail |
public void setDefinition(TaskDefinition def)
public void setDefinitionRef(ObjectRef ref)
public void setTaskType(java.lang.String s)
public void setTaskTypeDisplayName(java.lang.String s)
public void setGroup(ObjectGroup g)
public void setGroupRef(ObjectRef ref)
public void setGroup(java.lang.String name)
public void setTaskName(java.lang.String s)
The task name has to be truncated to a number of characters such that it will fit in a DB column of MAX_NAME_LENGTH bytes (on Oracle, characters elsewhere). By truncating it here we protect the database, but run the risk of setting the name to a value the caller is not expecting. There are two possible workaraounds if that is happenning, both on the callers back. 1) The caller can call getTaskname to find out what value actually got set 2) the caller can build a name using Util.truncateEncodedString() themselves to avoid the problem. Solution (1) is a little more efficient, but not always possible when the name is passed down a couple of layers before being set. In those cases solution (2) looks like your only option.
public void setTaskDisplayName(java.lang.String s)
public void setVariables(GenericObject vars)
public void assimilateVariables(GenericObject vars, boolean override) throws WavesetException
override
parameter.
vars
- GenericObject
containing variables to assimilateoverride
- when 'true' causes values from var
to override
those already contained in this template.
WavesetException
public void setResult(WavesetResult res)
public void setSubject(Subject subject)
public void setSubject(java.lang.String s) throws WavesetException
WavesetException
public void setOwner(java.lang.String owner)
public void setDescription(java.lang.String s)
public void setMode(TaskDefinition.ExecMode mode)
setExecMode(TaskDefinition.ExecMode)
public void setExecMode(TaskDefinition.ExecMode mode)
public void setMode(java.lang.String s)
setExecMode(String)
public void setExecMode(java.lang.String s)
public void setVisibility(java.lang.String s)
public TaskDefinition getDefinition() throws WavesetException
WavesetException
public ObjectRef getDefinitionRef()
public java.lang.String getDefinitionName()
public java.lang.String getTaskType()
public java.lang.String getTaskTypeDisplayName()
public ObjectGroup getGroup() throws WavesetException
WavesetException
public ObjectRef getGroupRef()
public GenericObject getVariables()
public WavesetResult getResult()
public Subject getSubject()
public java.lang.String getOwner()
public java.lang.String getTaskName()
public java.lang.String getTaskDisplayName()
public java.lang.String getDescription()
public TaskDefinition.ExecMode getMode()
public TaskDefinition.ExecMode getExecMode()
public java.lang.Object getVariable(java.lang.String name)
public void setVariable(java.lang.String name, java.lang.Object value)
public java.lang.String getVisibility()
public ObjectRef getFormRef()
public void setFormRef(ObjectRef ref)
public Form getForm() throws WavesetException
WavesetException
public java.util.List getHosts()
public void setHosts(java.util.List l)
public void setTrackingId(java.lang.String id)
public java.lang.String getTrackingId()
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 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 suclass includes queryable attributes
that are common to all PersistentObjects.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()
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.
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 |