com.infoengine.object.factory
Class Task

java.lang.Object
  extended bycom.infoengine.object.factory.Task
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BasicTasklet, BusinessTask

public class Task
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
static String AUTH_MAP
           
static String CONTEXT
           
private static int counter
           
private  IeRequest myRequest
           
private  Webject myWebject
           
static String SOURCE
           
static String STATUS
           
static String TASKS
           
static String VDB
           
static String WEBJECTS
           
 
Constructor Summary
Task()
          Constructs an unnamed task.
Task(IeRequest req)
          Construcst a task wrapper around an incoming request.
Task(String name)
          Constructs a named task.
Task(Webject webject)
          Constructs a task wrapper around an existing webject.
 
Method Summary
 void addContext(Group grp)
          Adds a context group to this task.
 void addError(String message, int status)
          Adds an error message and status to this task.
 void addInput(Group grp)
          Deprecated.  
 void addOutput(Group grp)
          Deprecated.  
 void addOutput(String data)
          Deprecated.  
 void addVdb(Group grp)
          Adds a VDB group to this task.
 void addVdb(String data)
          Adds an output string to this task.
 Webject bindParams()
          Binds parameters to the webject wrapped in this task.
 Webject bindParams(Webject webject)
          Binds parameters to a specific webject.
protected  void checkWebjects()
           
 void clearInput()
          Deprecated.  
 Task deepClone()
          Creates a deep copy of this task.
 Element getAuthElement(String key)
          Returns the authentication map element associated with a specified instance key.
 IeCollection getContext()
          Returns a collection containing the context groups of this task.
 IeGroup getContext(String name)
          Returns a named context group contained within this task.
 Group getContextGroup(String name)
          Returns a named context group contained within this task.
 String getDesc()
          Returns the description currently assigned to this task.
 Group getGroupIn()
          Returns the default input group for this task.
 Group getGroupIn(String name)
          Returns a named input group for this task.
 Group getGroupOut()
          Returns the default output group from this task.
 Group getGroupOut(String name)
          Returns a named output group contained within this task.
 IeCollection getInput()
          Deprecated.  
 Group getInput(String name)
          Deprecated.  
 Enumeration getInputGroups()
          Returns all input groups contained within this task.
 Enumeration getInputs()
          Deprecated.  
 IeMultipartInputStream getInputStream()
          Returns the input stream currently assigned to this task.
 String getMessage()
          Returns the concatenation of the error messages attached to this task.
 Enumeration getMessages()
          Returns the error messages attached to this task.
 IeMultipartInputStream getMimeInputStream()
          Deprecated. use getInputStream instead
 String getName()
          Returns the name of this task.
 IeCollection getOutput()
          Deprecated.  
 Group getOutput(String name)
          Deprecated.  
 Enumeration getOutputGroups()
          Returns all output groups contained within this task.
 IeMultipartOutputStream getOutputStream()
          Returns the output stream currently assigned to this task.
 String getPassword()
          Returns the password currently assigned to this task.
 IeRequest getRequest()
          Returns the standard request used to pass this task to a service.
 String getSource()
          Returns the source currently assigned to this task.
 int getStatus()
          Returns the status of this task
 String getType()
          Returns the type of this task.
 String getUserName()
          Returns the user name currently assigned to this task.
 Enumeration getVariables(String lex, Param param)
           
 IeCollection getVdb()
          Returns the collection containing VDB groups for the task.
 Group getVdb(String name)
          Returns a named group from the collection containing VDB groups for the task.
 Group getVdbIn()
          Returns the default VDB group for this task.
 Group getVdbIn(String name)
          Returns a named VDB group contained within this task.
 Webject getWebject()
          Returns the webject that this task wraps.
protected static IeRequest newStructure()
          Builds a new empty request for this task.
private static int nextSeqNo()
           
 void printTree()
          Prints the structure of the task to System.out.
 void removeInput(Group grp)
          Deprecated.  
 void removeVdb(Group grp)
          Removes a VDB group from this task.
 void setContext(IeCollection collection)
          Sets the collection containing the context groups for this task.
 void setDesc(String desc)
          Sets the description of this task.
 void setInput(IeCollection collection)
          Deprecated.  
 void setInputStream(IeMultipartInputStream in)
          Sets the input stream to be used by this task.
 void setName(String name)
          Sets the name of this task.
 void setOutputStream(IeMultipartOutputStream out)
          Sets the output stream to be used by this task.
 void setPassword(String pwd)
          Sets the password of this task.
 void setSource(String source)
          Sets the source for this task.
 void setType(String type)
          Sets the type of this task.
 void setUserName(String name)
          Sets the user name of this task.
 void setVdb(IeCollection collection)
          Sets the collection containing the VDB groups for this task.
 void setWebject(Webject webject)
          Sets the webject that this task wraps.
 Enumeration subVariables(String in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

counter

private static int counter

AUTH_MAP

public static final String AUTH_MAP
See Also:
Constant Field Values

CONTEXT

public static final String CONTEXT
See Also:
Constant Field Values

SOURCE

public static final String SOURCE
See Also:
Constant Field Values

TASKS

public static final String TASKS
See Also:
Constant Field Values

WEBJECTS

public static final String WEBJECTS
See Also:
Constant Field Values

VDB

public static final String VDB
See Also:
Constant Field Values

STATUS

public static final String STATUS
See Also:
Constant Field Values

myRequest

private IeRequest myRequest

myWebject

private Webject myWebject
Constructor Detail

Task

public Task()
Constructs an unnamed task.


Task

public Task(String name)
Constructs a named task.

Parameters:
name - the name to be assigned to the task

Task

public Task(Webject webject)
Constructs a task wrapper around an existing webject.

Parameters:
webject - the webject to be wrapped in a task

Task

public Task(IeRequest req)
Construcst a task wrapper around an incoming request.

Parameters:
req - the request to be wrapped in a task
Method Detail

getRequest

public IeRequest getRequest()
Returns the standard request used to pass this task to a service.

Returns:
This task's service request.

addError

public void addError(String message,
                     int status)
Adds an error message and status to this task.

Parameters:
message - The error message.
status - The status code.

getStatus

public int getStatus()
Returns the status of this task

Returns:
The integer value representing the status of the task.

getMessages

public Enumeration getMessages()
Returns the error messages attached to this task.

Returns:
All of the error/warning messages.

getMessage

public String getMessage()
Returns the concatenation of the error messages attached to this task.

Returns:
All of the error/warning messages concatenated together

getAuthElement

public Element getAuthElement(String key)
Returns the authentication map element associated with a specified instance key. The instance key usually comes from an INSTANCE parameter on an ACT or OBJ webject.

Parameters:
key - the instance key of the element to find
Returns:
Element authentication map element, or null if instance not found in the authentication map

getWebject

public Webject getWebject()
Returns the webject that this task wraps.

Returns:
This task's webject.

setInputStream

public void setInputStream(IeMultipartInputStream in)
Sets the input stream to be used by this task.

Parameters:
in - the input stream

getInputStream

public IeMultipartInputStream getInputStream()
Returns the input stream currently assigned to this task.

Returns:
The input stream assigned to this task, or null if no such input stream is currently assigned.

getMimeInputStream

public IeMultipartInputStream getMimeInputStream()
Deprecated. use getInputStream instead

Returns the MIME input stream currently assigned to this task.

Returns:
The MIME input stream assigned to this task, or null if no such input stream is currently assigned.

setOutputStream

public void setOutputStream(IeMultipartOutputStream out)
Sets the output stream to be used by this task.

Parameters:
out - the output stream

getOutputStream

public IeMultipartOutputStream getOutputStream()
Returns the output stream currently assigned to this task.

Returns:
The output stream assigned to this task

setWebject

public void setWebject(Webject webject)
Sets the webject that this task wraps. Normally, this is the webject that this task will execute.

Parameters:
webject - The webject to be wrapped in this task.

getName

public String getName()
Returns the name of this task.

Returns:
The task's current name.

setName

public void setName(String name)
Sets the name of this task.

Parameters:
name - The task's new name.

setPassword

public void setPassword(String pwd)
Sets the password of this task.

Parameters:
pwd - The task's new password.

getPassword

public String getPassword()
Returns the password currently assigned to this task.

Returns:
The task's current password.

setUserName

public void setUserName(String name)
Sets the user name of this task.

Parameters:
name - The task's new user name.

getUserName

public String getUserName()
Returns the user name currently assigned to this task.

Returns:
The task's current user name.

setDesc

public void setDesc(String desc)
Sets the description of this task.

Parameters:
desc - The task's new description.

getDesc

public String getDesc()
Returns the description currently assigned to this task.

Returns:
The task's current description.

getType

public String getType()
Returns the type of this task.

Returns:
The task's current type.

setType

public void setType(String type)
Sets the type of this task.

Parameters:
type - The task's new type.

getSource

public String getSource()
Returns the source currently assigned to this task.

Returns:
The task's current source string.

setSource

public void setSource(String source)
Sets the source for this task.

Parameters:
source - The task's new source string.

getContextGroup

public Group getContextGroup(String name)
Returns a named context group contained within this task.

Parameters:
name - The name of the desired context group.
Returns:
The named context group, or null if the group is not found in the task.

clearInput

public void clearInput()
Deprecated.  

Removes all input groups from this task.


removeInput

public void removeInput(Group grp)
Deprecated.  

Removes an input group from this task.

Parameters:
grp - The group of objects to be removed.

removeVdb

public void removeVdb(Group grp)
Removes a VDB group from this task.

Parameters:
grp - The group of objects to be removed.

addInput

public void addInput(Group grp)
Deprecated.  

Adds an input group to this task.

Parameters:
grp - A group of objects for input to this task.

addVdb

public void addVdb(Group grp)
Adds a VDB group to this task. If the group already exists, it is replaced.

Parameters:
grp - The group to add.

getGroupIn

public Group getGroupIn()
Returns the default input group for this task.

Returns:
The default input group.

getGroupIn

public Group getGroupIn(String name)
Returns a named input group for this task.

Parameters:
name - The name of the desired input group.
Returns:
The named input group, or null if the group is not found in the task.

getVdbIn

public Group getVdbIn()
Returns the default VDB group for this task.

Returns:
The default VDB group.

getVdbIn

public Group getVdbIn(String name)
Returns a named VDB group contained within this task.

Parameters:
name - The name of the desired VDB group.
Returns:
The named VDB group, or null if the group is not found in this task.

getInputGroups

public Enumeration getInputGroups()
Returns all input groups contained within this task.

Returns:
The input groups.

addOutput

public void addOutput(String data)
Deprecated.  

Adds an output string to this task.

Parameters:
data - The string to add to the output of this task.

addVdb

public void addVdb(String data)
Adds an output string to this task.

Parameters:
data - The string to add to the output of this task.

addOutput

public void addOutput(Group grp)
Deprecated.  

Adds an output group to this task.

Parameters:
grp - A group of objects to be added to the output of this task.

getGroupOut

public Group getGroupOut()
Returns the default output group from this task.

Returns:
The default output group.

getGroupOut

public Group getGroupOut(String name)
Returns a named output group contained within this task.

Parameters:
name - The name of the desired output group.
Returns:
The named output group, or null if the group is not found within this task.

getOutputGroups

public Enumeration getOutputGroups()
Returns all output groups contained within this task.

Returns:
The output groups.

bindParams

public Webject bindParams()
Binds parameters to the webject wrapped in this task. During the binding process, parameter values are evaluated and substitution is performed.

Returns:
A new webject derived from the wrapped one, but with evaluated parameters bound to it. This new webject replaces the original unbound one as the webject wrapped in this task.

bindParams

public Webject bindParams(Webject webject)
Binds parameters to a specific webject. During the binding process, parameter values are evaluated and substitution is performed.

Parameters:
webject - The webject to which parameters will be bound.
Returns:
A new webject derived from the specified one, but with evaluated parameters bound to it.

subVariables

public Enumeration subVariables(String in)

getVariables

public Enumeration getVariables(String lex,
                                Param param)

nextSeqNo

private static int nextSeqNo()

getContext

public IeCollection getContext()
Returns a collection containing the context groups of this task.

Returns:
The collection containing the context groups.

getContext

public IeGroup getContext(String name)
Returns a named context group contained within this task.

Returns:
The named context group, or null if the group is not found within this task.

setContext

public void setContext(IeCollection collection)
Sets the collection containing the context groups for this task. This replaces any previous collection that might have been established as the context collection.

Parameters:
collection - the new collection to be established as the one containing context groups for this task.

setInput

public void setInput(IeCollection collection)
Deprecated.  

Sets the collection containing the input groups for this task. This replaces any previous collection that might have been established as the input collection.

Parameters:
collection - the new collection to be established as the one containing input groups for this task.

setVdb

public void setVdb(IeCollection collection)
Sets the collection containing the VDB groups for this task. This replaces any previous collection that might have been established as the VDB collection.

Parameters:
collection - the new collection to be established as the one containing VDB groups for this task.

addContext

public void addContext(Group grp)
Adds a context group to this task.

Parameters:
grp - The context group (FORM, SERVER, etc.)

getInputs

public Enumeration getInputs()
Deprecated.  

Returns the names of all input groups contained within this task.

Returns:
The names of all input groups in the task.

getInput

public IeCollection getInput()
Deprecated.  

Returns the collection containing input groups for the task.

Returns:
The collection containing the task's current input groups.

getInput

public Group getInput(String name)
Deprecated.  

Returns a named group from the collection containing input groups for the task.

Parameters:
name - The name of the input group desired.
Returns:
The named input group, or null if the group is not found in the task.

getOutput

public IeCollection getOutput()
Deprecated.  

Returns the collection containing output groups for the task.

Returns:
The collection containing the task's current output groups.

getOutput

public Group getOutput(String name)
Deprecated.  

Returns a named group from the collection containing output groups for the task.

Parameters:
name - The name of the output group desired.
Returns:
The named output group, or null if the group is not found in the task.

getVdb

public IeCollection getVdb()
Returns the collection containing VDB groups for the task.

Returns:
The collection containing the task's current VDB groups.

getVdb

public Group getVdb(String name)
Returns a named group from the collection containing VDB groups for the task.

Parameters:
name - The name of the VDB group desired.
Returns:
The named VDB group, or null if the group is not found in the task.

newStructure

protected static IeRequest newStructure()
Builds a new empty request for this task.

Returns:
The new service request.

checkWebjects

protected void checkWebjects()

deepClone

public Task deepClone()
Creates a deep copy of this task.

Returns:
The cloned task.

printTree

public void printTree()
Prints the structure of the task to System.out.