com.infoengine.SAK
Interface Tasklet

All Known Implementing Classes:
BasicTasklet

public interface Tasklet


Method Summary
 void addAttribute(String name, Object value)
          Adds a tasklet attribute value.
 void addGroup(Group group)
          Adds a group to the tasklet's VDB.
 void addParam(String name, Object value)
          Adds a tasklet parameter value.
 Object getAttribute(String name)
          Returns the value of a tasklet attribute.
 Object getAttribute(String name, Object deflt)
          Returns the value of a tasklet attribute.
 Enumeration getAttributeNames()
          Returns the names of all tasklet attributes currently defined.
 IeCollection getContext()
          Returns the context collection associated with this tasklet.
 Group getGroup(String name)
          Returns a group from the tasklet's VDB.
 Object getParam(String name)
          Returns the value of a tasklet parameter.
 Object getParam(String name, Object deflt)
          Returns the value of a tasklet parameter.
 Enumeration getParamNames()
          Returns the names of all tasklet parameters currently defined.
 Vector getParams(String name)
          Returns all of the values of a possibly multivalued tasklet parameter.
 IeService getService()
          Returns the server context associated with this tasklet.
 IeMultipartInputStream getTaskletInputStream()
          Returns the input stream from which the tasklet can read BLOB data.
 OutputStream getTaskletOutputStream()
          Returns the output stream associated with this tasklet.
 int getTaskType()
          Returns the task type currently associated with this tasklet.
 IeCollection getVdb()
          Returns the VDB collection associated with this tasklet.
 int getVersion()
          Returns the version number of the task compiler that compiled the task most recently.
 void initialize()
          Initializes the tasklet.
 void invoke()
          Executes the tasklet.
 void removeAttribute(String name)
          Removes a tasklet attribute.
 void setAttribute(String name, Object value)
          Sets the value of a tasklet attribute.
 void setCheckpointProcessor(String uniqueIdentifier, CheckpointProcessor checkpointProcessor)
          Sets the checkpoint processor associated with the tasklet.
 void setContext(IeCollection collection)
          Sets the context groups associated with this tasklet.
 void setParam(String name, Object value)
          Sets the value of a tasklet parameter.
 void setService(IeService service)
          Sets the server context associated with this tasklet.
 void setTaskletInputStream(IeMultipartInputStream is)
          Sets the input stream from which the tasklet can read BLOB data.
 void setTaskletOutputStream(OutputStream os)
          Sets the output stream associated with this tasklet.
 void setTaskType(int taskType)
          Sets the task type context associated with this tasklet.
 void setVdb(IeCollection collection)
          Sets the VDB associated with this tasklet.
 String toString()
          Returns a string containing the output currently associated with this tasklet.
 void write(String s)
          Writes a string to the output stream associated with this tasklet.
 void write(String s, String encoding)
          Writes a string to the output stream associated with this tasklet.
 

Method Detail

getVersion

public int getVersion()
Returns the version number of the task compiler that compiled the task most recently. If the version number of the current compiler does not match the number returned by this method, the compiler will recompile the task.

Returns:
The version number of the compiler that compiled the task most recently.

initialize

public void initialize()
                throws IEException
Initializes the tasklet.

Throws:
IEException - if the tasklet is not initialized successfully.

invoke

public void invoke()
            throws IEException,
                   IOException
Executes the tasklet.

Throws:
IEException - if the tasklet is not executed successfully.
IOException - if an I/O error occurs.

setCheckpointProcessor

public void setCheckpointProcessor(String uniqueIdentifier,
                                   CheckpointProcessor checkpointProcessor)
Sets the checkpoint processor associated with the tasklet. The checkpoint processor is an object that is responsible for saving the state of the tasklet such that it can be restored to restart the tasklet after its execution is interrupted for some reason. Normally, this method is called by a task processor service that implements guaranteed task execution.

Parameters:
uniqueIdentifier - The unique identifier assigned to the tasklet instance. This will be passed to the checkpoint processor object to aid it in associating saved state with a specific tasklet instance over time.
checkpointProcessor - The object that can be called to save a tasklet's state. If null, state information will not be saved for the tasklet.

setTaskletInputStream

public void setTaskletInputStream(IeMultipartInputStream is)
Sets the input stream from which the tasklet can read BLOB data.

Parameters:
is - The Info*Engine multipart input stream from which the tasklet can read BLOB data.

getTaskletInputStream

public IeMultipartInputStream getTaskletInputStream()
Returns the input stream from which the tasklet can read BLOB data.

Returns:
The Info*Engine multipart input stream from which the tasklet can read BLOB data.

setTaskletOutputStream

public void setTaskletOutputStream(OutputStream os)
Sets the output stream associated with this tasklet.

Parameters:
os - The new output stream.

getTaskletOutputStream

public OutputStream getTaskletOutputStream()
Returns the output stream associated with this tasklet.

Returns:
The output stream associated with this tasklet.

write

public void write(String s)
           throws IOException
Writes a string to the output stream associated with this tasklet. The string is written using the default character encoding.

Parameters:
s - The string to write.
Throws:
IOException - if an I/O error occurs.

write

public void write(String s,
                  String encoding)
           throws IOException
Writes a string to the output stream associated with this tasklet. The string is written using a specified character encoding.

Parameters:
s - The string to write.
encoding - The character encoding to use.
Throws:
IOException - if an I/O error occurs.

toString

public String toString()
Returns a string containing the output currently associated with this tasklet. Usually, the output is generated as a result of calling the invoke method.

Returns:
A String containing the output associated with the tasklet.

getTaskType

public int getTaskType()
Returns the task type currently associated with this tasklet.

Returns:
The current task type, usually one of Task.TYPE_NORMAL or Task.TYPE_CREDENTIALS_MAPPER

setTaskType

public void setTaskType(int taskType)
Sets the task type context associated with this tasklet.

Parameters:
taskType - The new task type, usually one of Task.TYPE_NORMAL or Task.TYPE_CREDENTIALS_MAPPER

getService

public IeService getService()
Returns the server context associated with this tasklet.

Returns:
The server context

setService

public void setService(IeService service)
Sets the server context associated with this tasklet.

Parameters:
service - The new server context.

getVdb

public IeCollection getVdb()
Returns the VDB collection associated with this tasklet.

Returns:
The collection of VDB groups

setVdb

public void setVdb(IeCollection collection)
Sets the VDB associated with this tasklet.

Parameters:
collection - The new collection of VDB groups.

getContext

public IeCollection getContext()
Returns the context collection associated with this tasklet.

Returns:
The collection of context groups

setContext

public void setContext(IeCollection collection)
Sets the context groups associated with this tasklet.

Parameters:
collection - The new collection of context groups.

addGroup

public void addGroup(Group group)
Adds a group to the tasklet's VDB.

Parameters:
group - the group to be added

getGroup

public Group getGroup(String name)
Returns a group from the tasklet's VDB.

Parameters:
name - the name of the group to be returned
Returns:
the group, or null if the group does not exist

setParam

public void setParam(String name,
                     Object value)
Sets the value of a tasklet parameter.

Parameters:
name - The name of the parameter to set.
value - The value to be set.

addParam

public void addParam(String name,
                     Object value)
Adds a tasklet parameter value.

Parameters:
name - The name of the parameter to add.
value - The value to associate with the name.

getParam

public Object getParam(String name)
Returns the value of a tasklet parameter.

Parameters:
name - The name of the parameter to return.
Returns:
The value of the parameter, or null if the parameter is unknown.

getParam

public Object getParam(String name,
                       Object deflt)
Returns the value of a tasklet parameter. If the parameter is undefined, a specified default value is returned.

Parameters:
name - The name of the parameter to return.
deflt - The default value.
Returns:
The value of the parameter, or the default value if the parameter is unknown.

getParams

public Vector getParams(String name)
Returns all of the values of a possibly multivalued tasklet parameter.

Parameters:
name - The name of the tasklet parameter.
Returns:
The values of the tasklet parameter, or null if the parameter is unknown.

getParamNames

public Enumeration getParamNames()
Returns the names of all tasklet parameters currently defined.

Returns:
The names of all currently defined tasklet parameters.

setAttribute

public void setAttribute(String name,
                         Object value)
Sets the value of a tasklet attribute.

Parameters:
name - The name of the attribute to set.
value - The value to be set.

addAttribute

public void addAttribute(String name,
                         Object value)
Adds a tasklet attribute value.

Parameters:
name - The name of the attribute to add.
value - The value to associate with the name.

getAttribute

public Object getAttribute(String name)
Returns the value of a tasklet attribute.

Parameters:
name - The name of the attribute to return.
Returns:
The value of the attribute, or null if the attribute is unknown.

getAttribute

public Object getAttribute(String name,
                           Object deflt)
Returns the value of a tasklet attribute. If the attribute is undefined, a specified default value is returned.

Parameters:
name - The name of the attribute to return.
deflt - The default value.
Returns:
The value of the attribute, or the default value if the parameter is unknown.

getAttributeNames

public Enumeration getAttributeNames()
Returns the names of all tasklet attributes currently defined.

Returns:
The names of all currently defined tasklet attributes.

removeAttribute

public void removeAttribute(String name)
Removes a tasklet attribute.

Parameters:
name - The name of the attribute to remove.