com.infoengine.SAK
Class Task

java.lang.Object
  extended bycom.infoengine.SAK.Task
All Implemented Interfaces:
Cloneable, Serializable

public class Task
extends Object
implements Cloneable, Serializable

This class supports dynamic compilation, instantiation, and execution of Info*Engine tasks.

See Also:
Serialized Form

Nested Class Summary
private  class Task.NullOutputStream
          Private inner class that provides a null sink for output.
 
Field Summary
private  Group authMapGroup
           
private  CheckpointProcessor checkpointProcessor
           
private  TaskCompiler compiler
           
private  Group cookieGroup
           
private static String DEFAULT_SIGNATURE_ALGORITHM
           
private  Group formGroup
           
private  IeMultipartInputStream inputStream
           
private static KeyStore keystore
           
private static long keystoreExpiry
           
private  com.infoengine.log.LogWriter log
           
private  OutputStream outputStream
           
private  Vector processors
           
private static boolean PROFILING_INSTALLED
           
static String RESOURCE
           
private  Group serverGroup
           
private  IeService service
           
private static Task singleton
           
private  Tasklet task
           
private  int taskType
           
private  String taskURI
           
static int TYPE_CREDENTIALS_MAPPER
           
static int TYPE_NORMAL
           
private  String uniqueIdentifier
           
 
Constructor Summary
Task()
          Constructs an instance that is initialized with no task URI.
Task(String uri)
          Constructs an instance that is initialized with a specified task URI.
Task(String uri, String processor)
          Constructs an instance that causes a task to be executed on a remote task processor.
Task(String uri, Vector processors)
          Constructs an instance that causes a task to be executed on a remote task processor.
 
Method Summary
private  void addAttribute(Group group, String name, String value)
          Adds an attribute to the first element of a group.
 void addGroup(Group group)
          Adds a group to the task's VDB.
 void addParam(String name, Object value)
          Adds a task parameter value.
 void addProcessor(String name)
          Adds a name to the vector of remote task processor names.
 void compile()
          Compiles the task if it needs to be compiled.
static IeCollection executeTask(String uri, String processor, Task task, IeCollection vdb, Group form)
          Executes a task specified by URI.
static IeCollection executeTask(String uri, Task task, Boolean isCredentialsMapper)
          Executes a task specified by URI.
static IeCollection executeTask(String uri, Vector processors, Task task, IeCollection vdb, Group form)
          Executes a task specified by URI.
static void executeTaskRemotely(String uri, Task task, IeService service, IeMultipartInputStream is, OutputStream os, Vector processors)
          Executes a task in a remote task processor.
 Group getAuthMapGroup()
          Returns the group containing authentication mapping information.
 Group getCookieGroup()
          Returns the group containing attributes that serve as cookie information.
 Group getFormGroup()
          Returns the group containing attributes that serve as form variables.
 Group getGroup(String name)
          Returns a group from the task's VDB.
 Enumeration getGroupNames()
          Returns the names of all groups in the task's VDB.
 IeMultipartInputStream getInputStream()
          Returns the input stream currently associated with the task.
private static KeyStore getKeyStore()
          Returns an instance of the keystore specified by configuration properties.
 com.infoengine.log.LogWriter getLog()
          Returns the log writer currently associated with the object.
 OutputStream getOutputStream()
          Returns the output stream currently associated with this task object.
 Object getParam(String name)
          Returns the value of a task parameter.
 Enumeration getParamNames()
          Returns the names of all task parameters currently defined.
private  String getParams()
          for printing out the paramaters of a task for logging
 Vector getProcessors()
          Returns the vector of remote task processor names.
 Group getServerGroup()
          Returns the group containing attributes that serve as server variables.
 IeService getService()
          Returns the server context currently associated with this task.
 Tasklet getTasklet()
          Returns the compiled tasklet associated with this task object.
 int getTaskType()
          Returns the task type currently associated with this task.
 String getTaskURI()
          Returns the URI of the Info*Engine task currently associated with the object.
 IeCollection getVDB()
          Returns the VDB of the task.
 void initialize(Tasklet tasklet, String uri)
          Initializes the task from an initialized tasklet (usually the parent tasklet of a new subtask).
 void invoke()
          Executes the compiled tasklet.
 void recover()
          Recovers the saved state of a task.
 void removeAllParams()
          Removes all parameters from the set of task parameters that will be passed to the tasklet associated with this task.
 void removeParam(String name)
          Removes a parameter from the set of task parameters that will be passed to the tasklet associated with this task.
 void setAuthMapGroup(Group group)
          Sets the group containing authentication mapping information.
 void setCheckpointProcessor(String uniqueIdentifier, CheckpointProcessor checkpointProcessor)
          Sets the checkpoint processor associated with the Task object.
private  void setContextGroup(String name, Group group)
          Sets a context group for the tasklet.
 void setCookieGroup(Group group)
          Sets the group containing attributes that serve as cookie information.
 void setFormGroup(Group group)
          Sets the group containing attributes that serve as form variables.
 void setInputStream(IeMultipartInputStream is)
          Sets the input stream from which the task can read BLOB data.
 void setInputStream(InputStream is, String contentType, String name, String filename)
          Sets the input stream from which the task can read BLOB data.
 void setInputStream(javax.servlet.ServletRequest request)
          Sets the input stream from which the task can read BLOB data.
 void setLog(com.infoengine.log.LogWriter log)
          Sets the log writer associated with the object.
 void setOutputStream(OutputStream os)
          Sets the output stream associated with this task object.
 void setOutputStream(Writer writer)
          Sets the output stream associated with this task object.
 void setParam(String name, Object value)
          Sets the value of a task parameter.
 void setProcessors(Vector processors)
          Sets the vector of remote task processor names associated with the task.
 void setRequest(javax.servlet.http.HttpServletRequest request)
          Associates an HTTP servlet request object with the task.
 void setServerAttribute(String name, String value)
          Sets an attribute in the server context group (@SERVER).
 void setServerGroup(Group group)
          Sets the group containing attributes that serve as server variables.
 void setService(IeService service)
          Sets the server context associated with this task.
 void setTaskType(int taskType)
          Sets the type of the task.
 void setTaskURI(String taskURI)
          Sets the URI of the Info*Engine task to associate with the object.
 void setUsername(String user)
          Sets the "auth-user" attribute value in the SERVER context group (@SERVER).
 void setUsername(String user, String signer)
          Sets the "auth-user" attribute value in the SERVER context group and also sets "auth-signer" and "auth-signature" attribute values that provide a digital signature for the username and the name of the signer.
 void setUsername(String user, String signer, PrivateKey key)
          Sets the "auth-user" attribute value in the SERVER context group and also sets "auth-signer" and "auth-signature" attribute values that provide a digital signature for the username and the name of the signer.
 void setUsername(String user, String signer, String password, KeyStore keystore)
          Sets the "auth-user" attribute value in the SERVER context group and also sets "auth-signer" and "auth-signature" attribute values that provide a digital signature for the username and the name of the signer.
 void setVDB(IeCollection vdb)
          Sets the VDB of the task.
private static void signUsername(Group group, String signer, PrivateKey key)
          Signs the auth-user attribute value in a specific group using a specific signer's name and private key.
static void signUsername(Task task, String signer)
          Sets the "auth-signer" and "auth-signature" attribute values that provide a digital signature for the "auth-user" attribute of the SERVER context group of a specific task.
static void signUsername(Task task, String signer, PrivateKey key)
          Signs the auth-user attribute value in a SERVER context group using a specific signer's name and private key.
static void signUsername(Task task, String user, String signer)
          Sets the "auth-user" attribute value in the SERVER context group of a specific task and also sets "auth-signer" and "auth-signature" attribute values that provide a digital signature for the username and the name of the signer.
static void signUsername(Task task, String user, String signer, PrivateKey key)
          Sets a specific value for the auth-user attribute value in the SERVER context group of a specific task, and signs it using a specific signer's name and private key.
static void signUsername(Task task, String user, String signer, String password, KeyStore keystore)
          Sets the "auth-user" attribute value in the SERVER context group of a specific task and also sets "auth-signer" and "auth-signature" attribute values that provide a digital signature for the username and the name of the signer.
 String toString()
          Returns a string containing the output currently associated with this task.
static boolean verifyUsername(Task task)
          Verifies the authenticity of the auth-user attribute value in a SERVER context group based upon the auth-signer and auth-signature attribute values of the same group.
static boolean verifyUsername(Task task, Certificate certificate)
          Verifies the authenticity of the auth-user attribute value in a SERVER context group based upon the auth-signer and auth-signature attribute values of the same group.
static boolean verifyUsername(Task task, KeyStore keystore)
          Verifies the authenticity of the auth-user attribute value in a SERVER context group based upon the auth-signer and auth-signature attribute values of the same group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

public static final String RESOURCE
See Also:
Constant Field Values

DEFAULT_SIGNATURE_ALGORITHM

private static final String DEFAULT_SIGNATURE_ALGORITHM
See Also:
Constant Field Values

TYPE_NORMAL

public static final int TYPE_NORMAL
See Also:
Constant Field Values

TYPE_CREDENTIALS_MAPPER

public static final int TYPE_CREDENTIALS_MAPPER
See Also:
Constant Field Values

checkpointProcessor

private CheckpointProcessor checkpointProcessor

compiler

private TaskCompiler compiler

inputStream

private IeMultipartInputStream inputStream

log

private com.infoengine.log.LogWriter log

outputStream

private OutputStream outputStream

processors

private Vector processors

service

private IeService service

task

private Tasklet task

taskType

private int taskType

taskURI

private String taskURI

uniqueIdentifier

private String uniqueIdentifier

authMapGroup

private Group authMapGroup

cookieGroup

private Group cookieGroup

formGroup

private Group formGroup

serverGroup

private Group serverGroup

keystore

private static KeyStore keystore

keystoreExpiry

private static long keystoreExpiry

singleton

private static Task singleton

PROFILING_INSTALLED

private static final boolean PROFILING_INSTALLED
Constructor Detail

Task

public Task()
Constructs an instance that is initialized with no task URI. Use setTaskURI to specify the URI of the Info*Engine task associated with this object.


Task

public Task(String uri)
Constructs an instance that is initialized with a specified task URI.

Parameters:
uri - The URI of the Info*Engine task to associate with this object.

Task

public Task(String uri,
            Vector processors)
Constructs an instance that causes a task to be executed on a remote task processor.

Parameters:
uri - The URI of the Info*Engine task to associate with this object.
processors - A vector of task processor names. Each of these processors has a copy of the specified task. The processors are tried in sequence until a connection can be created successfully to one of them.

Task

public Task(String uri,
            String processor)
Constructs an instance that causes a task to be executed on a remote task processor.

Parameters:
uri - The URI of the Info*Engine task to associate with this object.
processor - The name of the task processor on which to execute the task.
Method Detail

getTaskURI

public String getTaskURI()
Returns the URI of the Info*Engine task currently associated with the object.

Returns:
The task URI currently associated with the object.

setTaskURI

public void setTaskURI(String taskURI)
Sets the URI of the Info*Engine task to associate with the object.

Parameters:
taskURI - The new task URI.

getTasklet

public Tasklet getTasklet()
Returns the compiled tasklet associated with this task object.

Returns:
The tasklet associated with this task

setService

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

Parameters:
service - The new server context.

getService

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

Returns:
The task's current server context.

setTaskType

public void setTaskType(int taskType)
Sets the type of the task. his is usually one of TYPE_NORMAL or TYPE_CREDENTIALS_MAPPER.

Parameters:
taskType - The new task type.

getTaskType

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

Returns:
The task's current type.

setLog

public void setLog(com.infoengine.log.LogWriter log)
Sets the log writer associated with the object. If a log writer is defined, the object will write informative messages to it.

Parameters:
log - The new log writer.

getLog

public com.infoengine.log.LogWriter getLog()
Returns the log writer currently associated with the object.

Returns:
The log writer currently associated with the object.

setCheckpointProcessor

public void setCheckpointProcessor(String uniqueIdentifier,
                                   CheckpointProcessor checkpointProcessor)
Sets the checkpoint processor associated with the Task object. The checkpoint processor is an object that is responsible for saving the state of the task such that it can be restored to restart the task 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 task instance. This will be passed to the checkpoint processor object to aid it in associating saved state with a specific task instance over time.
checkpointProcessor - The object that can be called to save a task's state. If null, state information will not be saved for the task.

recover

public void recover()
             throws IEException
Recovers the saved state of a task. If no saved state exists, this method returns without error and without changing the state of the task instance. Before calling this method, setCheckpointProcessor must be called in order to establish a checkpoint processor and the unique identifier of the task to be recovered. The checkpoint processor is expected to throw the exception com.infoengine.exception.nonfatal.IENoSavedStateException when no saved state is available (usually because no state was previously saved).

Throws:
IEException - if state can not be recovered or queried successfully.

setProcessors

public void setProcessors(Vector processors)
Sets the vector of remote task processor names associated with the task. When the task is invoked, the task processors in the vector are tried one at a time in sequence until a connection is successfully made to one of them. A request to execute the remote task is then sent to the processor.

Parameters:
processors - The vector of remote task processor names.

getProcessors

public Vector getProcessors()
Returns the vector of remote task processor names.

Returns:
The vector of remote task processor names.

addProcessor

public void addProcessor(String name)
Adds a name to the vector of remote task processor names.

Parameters:
name - The name of a remote task processor.

setInputStream

public void setInputStream(InputStream is,
                           String contentType,
                           String name,
                           String filename)
                    throws IOException
Sets the input stream from which the task can read BLOB data.

Parameters:
is - The input stream.
contentType - The MIME content type associated with the stream.
name - The form variable name, if any, associated with the stream.
filename - The file name, if any, associated with the stream.
Throws:
IOException - if the input stream can not be set.

setInputStream

public void setInputStream(javax.servlet.ServletRequest request)
                    throws IOException
Sets the input stream from which the task can read BLOB data. The input stream is obtained from a servlet request object.

Parameters:
request - The servlet request object from which the input stream will be obtained.
Throws:
IOException - if the input stream can not be set.

setInputStream

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

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

getInputStream

public IeMultipartInputStream getInputStream()
Returns the input stream currently associated with the task.

Returns:
The input stream currently associated with the task.

setOutputStream

public void setOutputStream(OutputStream os)
Sets the output stream associated with this task object.

Parameters:
os - The new output stream.

setOutputStream

public void setOutputStream(Writer writer)
Sets the output stream associated with this task object. This method uses the WriterOutputStream class to wrap a writer so that it can be used as the output stream of the task.

Parameters:
writer - The writer to be wrapped in an output stream.

getOutputStream

public OutputStream getOutputStream()
Returns the output stream currently associated with this task object.

Returns:
The task's current output stream.

setParam

public void setParam(String name,
                     Object value)
Sets the value of a task parameter. These parameters are passed to the tasklet associated with this task when it is invoked via the invoke method. The getParam method of the tasklet can be used by the tasklet to query these parameters.

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

addParam

public void addParam(String name,
                     Object value)
Adds a task parameter value. These parameters are passed to the tasklet associated with this task when it is invoked via the invoke method. The getParam method of the tasklet can be used by the tasklet to query these parameters.

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 task parameter.

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

getParamNames

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

Returns:
The names of all currently defined task parameters.

removeParam

public void removeParam(String name)
Removes a parameter from the set of task parameters that will be passed to the tasklet associated with this task.

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

removeAllParams

public void removeAllParams()
Removes all parameters from the set of task parameters that will be passed to the tasklet associated with this task.


setAuthMapGroup

public void setAuthMapGroup(Group group)
Sets the group containing authentication mapping information.

Parameters:
group - The new group containing authentication mapping information.

getAuthMapGroup

public Group getAuthMapGroup()
Returns the group containing authentication mapping information.

Returns:
The task's current authentication mapping group.

setFormGroup

public void setFormGroup(Group group)
Sets the group containing attributes that serve as form variables. The attributes of this group can be accessed within tasks using the group name @FORM.

Parameters:
group - The new group containing form variables.

getFormGroup

public Group getFormGroup()
Returns the group containing attributes that serve as form variables.

Returns:
The task's current form group.

setServerGroup

public void setServerGroup(Group group)
Sets the group containing attributes that serve as server variables. The attributes of this group can be accessed within tasks using the group name @SERVER.

Parameters:
group - The new group containing server variables.

getServerGroup

public Group getServerGroup()
Returns the group containing attributes that serve as server variables.

Returns:
The task's current server group.

setServerAttribute

public void setServerAttribute(String name,
                               String value)
Sets an attribute in the server context group (@SERVER).

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

setUsername

public void setUsername(String user)
Sets the "auth-user" attribute value in the SERVER context group (@SERVER).

Parameters:
user - The username to set.

setUsername

public void setUsername(String user,
                        String signer)
                 throws IEException
Sets the "auth-user" attribute value in the SERVER context group and also sets "auth-signer" and "auth-signature" attribute values that provide a digital signature for the username and the name of the signer. The file system pathname of the keystore, the keystore type, the keystore password, and the password used in obtaining the signer's private key are obtained from configuration properties serviceName.keystore.path, serviceName.keystore.type, serviceName.keystore.password, and serviceName.keystore.signer.password.

Parameters:
user - The username to set. Usually, this is a user's LDAP directory distinguished name.
signer - The alias of the signer. This is the alias that selects a private key from the keystore. The alias is conveyed to the verifier in the auth-signer attribute, so it must be known to the verifier because the verifier will use it to select a public certificate from its keystore.
Throws:
IEException - if the signer's private key can not be obtained from the keystore or the key can not be used successfully in creating the signature.
See Also:
Signature

setUsername

public void setUsername(String user,
                        String signer,
                        String password,
                        KeyStore keystore)
                 throws IEException
Sets the "auth-user" attribute value in the SERVER context group and also sets "auth-signer" and "auth-signature" attribute values that provide a digital signature for the username and the name of the signer.

Parameters:
user - The username to set. Usually, this is a user's LDAP directory distinguished name.
signer - The alias of the signer. This is the alias that selects a private key from the keystore. The alias is conveyed to the verifier in the auth-signer attribute, so it must be known to the verifier because the verifier will use it to select a public certificate from its keystore.
password - The password to use in recovering the signer's private key from the keystore.
keystore - The keystore object containing the private key of the signer.
Throws:
IEException
See Also:
Signature

setUsername

public void setUsername(String user,
                        String signer,
                        PrivateKey key)
                 throws IEException
Sets the "auth-user" attribute value in the SERVER context group and also sets "auth-signer" and "auth-signature" attribute values that provide a digital signature for the username and the name of the signer.

Parameters:
user - The username to set. Usually, this is a user's LDAP directory distinguished name.
signer - The alias of the signer. This is the alias that selects a private key from the keystore. The alias is conveyed to the verifier in the auth-signer attribute, so it must be known to the verifier because the verifier will use it to select a public certificate from its keystore.
key - The private key to use in generating the signed authorization.
Throws:
IEException
See Also:
Signature

signUsername

public static void signUsername(Task task,
                                String signer)
                         throws IEException
Sets the "auth-signer" and "auth-signature" attribute values that provide a digital signature for the "auth-user" attribute of the SERVER context group of a specific task. The file system pathname of the keystore, the keystore type, the keystore password, and the password used in obtaining the signer's private key are obtained from configuration properties serviceName.keystore.path, serviceName.keystore.type, serviceName.keystore.password, and serviceName.keystore.signer.password.

Parameters:
task - The com.infoengine.object.factory.Task instance containing the SERVER context group.
signer - The alias of the signer. This is the alias that selects a private key from the keystore. The alias is conveyed to the verifier in the auth-signer attribute, so it must be known to the verifier because the verifier will use it to select a public certificate from its keystore.
Throws:
IEException - if the signer's private key can not be obtained from the keystore or the key can not be used successfully in creating the signature.
See Also:
Signature

signUsername

public static void signUsername(Task task,
                                String user,
                                String signer)
                         throws IEException
Sets the "auth-user" attribute value in the SERVER context group of a specific task and also sets "auth-signer" and "auth-signature" attribute values that provide a digital signature for the username and the name of the signer. The file system pathname of the keystore, the keystore type, the keystore password, and the password used in obtaining the signer's private key are obtained from configuration properties serviceName.keystore.path, serviceName.keystore.type, serviceName.keystore.password, and serviceName.keystore.signer.password.

Parameters:
task - The com.infoengine.object.factory.Task instance containing the SERVER context group.
user - The username to set. Usually, this is a user's LDAP directory distinguished name.
signer - The alias of the signer. This is the alias that selects a private key from the keystore. The alias is conveyed to the verifier in the auth-signer attribute, so it must be known to the verifier because the verifier will use it to select a public certificate from its keystore.
Throws:
IEException - if the signer's private key can not be obtained from the keystore or the key can not be used successfully in creating the signature.
See Also:
Signature

signUsername

public static void signUsername(Task task,
                                String user,
                                String signer,
                                String password,
                                KeyStore keystore)
                         throws IEException
Sets the "auth-user" attribute value in the SERVER context group of a specific task and also sets "auth-signer" and "auth-signature" attribute values that provide a digital signature for the username and the name of the signer.

Parameters:
task - The com.infoengine.object.factory.Task instance containing the SERVER context group.
user - The username to set. Usually, this is a user's LDAP directory distinguished name.
signer - The alias of the signer. This is the alias that selects a private key from the keystore. The alias is conveyed to the verifier in the auth-signer attribute, so it must be known to the verifier because the verifier will use it to select a public certificate from its keystore.
password - The password to use in recovering the signer's private key from the keystore.
keystore - The keystore object containing the private key of the signer.
Throws:
IEException - if an exception prevents the auth-user value from being signed.
See Also:
Signature

signUsername

public static void signUsername(Task task,
                                String user,
                                String signer,
                                PrivateKey key)
                         throws IEException
Sets a specific value for the auth-user attribute value in the SERVER context group of a specific task, and signs it using a specific signer's name and private key.

Parameters:
task - The com.infoengine.object.factory.Task instance containing the SERVER context group.
user - The value to set for the auth-user attribute of the SERVER context group.
signer - The signer's name. This name will be used by the receiving system to look up the signer's public key.
key - The signer's private key.
Throws:
IEException - if an exception prevents the auth-user value from being signed.

signUsername

public static void signUsername(Task task,
                                String signer,
                                PrivateKey key)
                         throws IEException
Signs the auth-user attribute value in a SERVER context group using a specific signer's name and private key. If the SERVER context group does not contain an auth-user attribute, no signature is generated.

Parameters:
task - The com.infoengine.object.factory.Task instance containing the SERVER context group with the auth-user attribute to be signed.
signer - The signer's name. This name will be used by the receiving system to look up the signer's public key.
key - The signer's private key.
Throws:
IEException - if an exception prevents the auth-user value from being signed.

signUsername

private static void signUsername(Group group,
                                 String signer,
                                 PrivateKey key)
                          throws IEException
Signs the auth-user attribute value in a specific group using a specific signer's name and private key. If the group does not not contain an auth-user attribute, no signature is generated.

Parameters:
group - The group with the auth-user attribute to be signed.
signer - The signer's name. This name will be used by the receiving system to look up the signer's public key.
key - The signer's private key.
Throws:
IEException - if an exception prevents the auth-user value from being signed.

verifyUsername

public static boolean verifyUsername(Task task)
                              throws IEException
Verifies the authenticity of the auth-user attribute value in a SERVER context group based upon the auth-signer and auth-signature attribute values of the same group.

Parameters:
task - The com.infoengine.object.factory.Task instance containing the SERVER context group with the attributes to be verified.
Returns:
true if digital signature information is present and the auth-user value is verified successfully.
Throws:
IEException - if an exception prevents the auth-user value from being verified.

verifyUsername

public static boolean verifyUsername(Task task,
                                     KeyStore keystore)
                              throws IEException
Verifies the authenticity of the auth-user attribute value in a SERVER context group based upon the auth-signer and auth-signature attribute values of the same group.

Parameters:
task - The com.infoengine.object.factory.Task instance containing the SERVER context group with the attributes to be verified.
keystore - The keystore from which to obtain the signer's public certificate.
Returns:
true if digital signature information is present and the auth-user value is verified successfully.
Throws:
IEException - if an exception prevents the auth-user value from being verified.

verifyUsername

public static boolean verifyUsername(Task task,
                                     Certificate certificate)
                              throws IEException
Verifies the authenticity of the auth-user attribute value in a SERVER context group based upon the auth-signer and auth-signature attribute values of the same group.

Parameters:
task - The com.infoengine.object.factory.Task instance containing the SERVER context group with the attributes to be verified.
certificate - The signer's public certificate.
Returns:
true if digital signature information is present and the auth-user value is verified successfully.
Throws:
IEException - if an exception prevents the auth-user value from being verified.

getKeyStore

private static KeyStore getKeyStore()
                             throws IEException
Returns an instance of the keystore specified by configuration properties. The file system pathname of the keystore, the keystore type, and the keystore password are obtained from the properties serviceName.keystore.path, serviceName.keystore.type, and serviceName.keystore.password.

Throws:
IEException

setCookieGroup

public void setCookieGroup(Group group)
Sets the group containing attributes that serve as cookie information. The attributes of this group can be accessed within tasks using the group name @COOKIE.

Parameters:
group - The new group containing cookie information.

getCookieGroup

public Group getCookieGroup()
Returns the group containing attributes that serve as cookie information.

Returns:
The task's current cookie group.

setContextGroup

private void setContextGroup(String name,
                             Group group)
Sets a context group for the tasklet.

Parameters:
name - The name of the context group
group - The new context group

setVDB

public void setVDB(IeCollection vdb)
Sets the VDB of the task.

Parameters:
vdb - The new VDB

getVDB

public IeCollection getVDB()
Returns the VDB of the task.

Returns:
The VDB collection of the task.

addGroup

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

Parameters:
group - the group to be added

getGroup

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

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

getGroupNames

public Enumeration getGroupNames()
Returns the names of all groups in the task's VDB.

Returns:
The names of all groups in the VDB.

initialize

public void initialize(Tasklet tasklet,
                       String uri)
                throws IEException
Initializes the task from an initialized tasklet (usually the parent tasklet of a new subtask).

Parameters:
tasklet - the reference tasklet from which to initialize this task
uri - the URI of the source for this task
Throws:
IEException

setRequest

public void setRequest(javax.servlet.http.HttpServletRequest request)
                throws IOException
Associates an HTTP servlet request object with the task. HTTP protocol headers are read to establish the server context group, form and query string variables are read to establish the form context group, and HTTP request input stream is associated as the input stream of the task.

Parameters:
request - The HTTP servlet request object.
Throws:
IOException

addAttribute

private void addAttribute(Group group,
                          String name,
                          String value)
Adds an attribute to the first element of a group.

Parameters:
group - The group to which to add the attribute
name - The name of the attribute
value - The value of the attribute

invoke

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

Throws:
IEException - if an error other than an I/O error occurs.
IOException - if an I/O error occurs.

compile

public void compile()
             throws IEException,
                    IOException
Compiles the task if it needs to be compiled.

Throws:
IEException - if an error other than an I/O error occurs.
IOException - if an I/O error occurs.

executeTask

public static IeCollection executeTask(String uri,
                                       Task task,
                                       Boolean isCredentialsMapper)
                                throws IEException
Executes a task specified by URI. The server context group of the task is derived from a specified task. Other context groups are left empty.

Parameters:
uri - The URI of the task to execute.
task - The task from which to derive the server context group for the task.
isCredentialsMapper - Indicates whether the task to be executed is a credentials mapper task.
Returns:
The VDB produced by the task.
Throws:
IEException - if the task is not executed successfully.

executeTask

public static IeCollection executeTask(String uri,
                                       String processor,
                                       Task task,
                                       IeCollection vdb,
                                       Group form)
                                throws IEException
Executes a task specified by URI. The VDB collection of the task is initialized from a specified collection. The context groups of the task are derived from a specified task.

Parameters:
uri - The URI of the task to execute.
processor - The name of the remote task processor on which to execute the task, null if the task should be executed locally.
task - The task from which to derive the context groups and input and output streams for the task.
vdb - The VDB collection with which to initialize the task.
form - The FORM context group for the task.
Returns:
The VDB produced by the task.
Throws:
IEException - if the task is not executed successfully.

executeTask

public static IeCollection executeTask(String uri,
                                       Vector processors,
                                       Task task,
                                       IeCollection vdb,
                                       Group form)
                                throws IEException
Executes a task specified by URI. The VDB collection of the task is initialized from a specified collection. The context groups of the task are derived from a specified task.

Parameters:
uri - The URI of the task to execute.
processors - A vector containing the names of the remote task processors on which the task can be executed, null if the task should be executed locally.
task - The task from which to derive the context groups and input and output streams for the task.
vdb - The VDB collection with which to initialize the task.
form - The FORM context group for the task.
Returns:
The VDB produced by the task.
Throws:
IEException - if the task is not executed successfully.

executeTaskRemotely

public static void executeTaskRemotely(String uri,
                                       Task task,
                                       IeService service,
                                       IeMultipartInputStream is,
                                       OutputStream os,
                                       Vector processors)
                                throws IEException,
                                       IOException
Executes a task in a remote task processor. The caller supplies a task URI, a Task object providing context groups, a service object providing a VDB, and a vector of task processor names. An attempt is made to connect to each task processor, one at a time, until a connection is made successfully. Then, a request object is sent and the result is incorporated into the local VDB.

Parameters:
uri - The URI of the task to be executed.
task - The task from which to derive the context groups for the remote task.
service - The service object containing a VDB.
is - The input stream of the task.
os - The output stream of the task.
processors - The vector of task processor names.
Throws:
IEException - if an error other than an I/O error occurs during execution of the tasklet.
IOException - if an I/O error occurs.

toString

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

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

getParams

private String getParams()
for printing out the paramaters of a task for logging