|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.infoengine.SAK.Task
This class supports dynamic compilation, instantiation, and execution of Info*Engine tasks.
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 |
public static final String RESOURCE
private static final String DEFAULT_SIGNATURE_ALGORITHM
public static final int TYPE_NORMAL
public static final int TYPE_CREDENTIALS_MAPPER
private CheckpointProcessor checkpointProcessor
private TaskCompiler compiler
private IeMultipartInputStream inputStream
private com.infoengine.log.LogWriter log
private OutputStream outputStream
private Vector processors
private IeService service
private Tasklet task
private int taskType
private String taskURI
private String uniqueIdentifier
private Group authMapGroup
private Group cookieGroup
private Group formGroup
private Group serverGroup
private static KeyStore keystore
private static long keystoreExpiry
private static Task singleton
private static final boolean PROFILING_INSTALLED
Constructor Detail |
public Task()
public Task(String uri)
uri
- The URI of the Info*Engine task to associate with this
object.public Task(String uri, Vector processors)
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.public Task(String uri, String processor)
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 |
public String getTaskURI()
public void setTaskURI(String taskURI)
taskURI
- The new task URI.public Tasklet getTasklet()
public void setService(IeService service)
service
- The new server context.public IeService getService()
public void setTaskType(int taskType)
taskType
- The new task type.public int getTaskType()
public void setLog(com.infoengine.log.LogWriter log)
log
- The new log writer.public com.infoengine.log.LogWriter getLog()
public void setCheckpointProcessor(String uniqueIdentifier, CheckpointProcessor checkpointProcessor)
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.public void recover() throws IEException
IEException
- if state can not be recovered or queried
successfully.public void setProcessors(Vector processors)
processors
- The vector of remote task processor names.public Vector getProcessors()
public void addProcessor(String name)
name
- The name of a remote task processor.public void setInputStream(InputStream is, String contentType, String name, String filename) throws IOException
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.
IOException
- if the input stream can not be set.public void setInputStream(javax.servlet.ServletRequest request) throws IOException
request
- The servlet request object from which the input
stream will be obtained.
IOException
- if the input stream can not be set.public void setInputStream(IeMultipartInputStream is)
is
- The Info*Engine multipart input stream from which the task
can read BLOB data.public IeMultipartInputStream getInputStream()
public void setOutputStream(OutputStream os)
os
- The new output stream.public void setOutputStream(Writer writer)
writer
- The writer to be wrapped in an output stream.public OutputStream getOutputStream()
public void setParam(String name, Object value)
name
- The name of the parameter to set.value
- The value to associate with the name.public void addParam(String name, Object value)
name
- The name of the parameter to add.value
- The value to associate with the name.public Object getParam(String name)
name
- The name of the parameter to return.
public Enumeration getParamNames()
public void removeParam(String name)
name
- The name of the parameter to remove.public void removeAllParams()
public void setAuthMapGroup(Group group)
group
- The new group containing authentication mapping
information.public Group getAuthMapGroup()
public void setFormGroup(Group group)
group
- The new group containing form variables.public Group getFormGroup()
public void setServerGroup(Group group)
group
- The new group containing server variables.public Group getServerGroup()
public void setServerAttribute(String name, String value)
name
- The name of the attribute to set.value
- The value of the attribute.public void setUsername(String user)
user
- The username to set.public void setUsername(String user, String signer) throws IEException
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.
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.Signature
public void setUsername(String user, String signer, String password, KeyStore keystore) throws IEException
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.
IEException
Signature
public void setUsername(String user, String signer, PrivateKey key) throws IEException
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.
IEException
Signature
public static void signUsername(Task task, String signer) throws IEException
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.
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.Signature
public static void signUsername(Task task, String user, String signer) throws IEException
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.
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.Signature
public static void signUsername(Task task, String user, String signer, String password, KeyStore keystore) throws IEException
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.
IEException
- if an exception prevents the auth-user
value from being signed.Signature
public static void signUsername(Task task, String user, String signer, PrivateKey key) throws IEException
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.
IEException
- if an exception prevents the auth-user
value from being signed.public static void signUsername(Task task, String signer, PrivateKey key) throws IEException
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.
IEException
- if an exception prevents the auth-user
value from being signed.private static void signUsername(Group group, String signer, PrivateKey key) throws IEException
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.
IEException
- if an exception prevents the auth-user
value from being signed.public static boolean verifyUsername(Task task) throws IEException
task
- The com.infoengine.object.factory.Task instance containing
the SERVER context group with the attributes to be
verified.
IEException
- if an exception prevents the auth-user
value from being verified.public static boolean verifyUsername(Task task, KeyStore keystore) throws IEException
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.
IEException
- if an exception prevents the auth-user
value from being verified.public static boolean verifyUsername(Task task, Certificate certificate) throws IEException
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.
IEException
- if an exception prevents the auth-user
value from being verified.private static KeyStore getKeyStore() throws IEException
IEException
public void setCookieGroup(Group group)
group
- The new group containing cookie information.public Group getCookieGroup()
private void setContextGroup(String name, Group group)
name
- The name of the context groupgroup
- The new context grouppublic void setVDB(IeCollection vdb)
vdb
- The new VDBpublic IeCollection getVDB()
public void addGroup(Group group)
group
- the group to be addedpublic Group getGroup(String name)
name
- the name of the group to be returned
public Enumeration getGroupNames()
public void initialize(Tasklet tasklet, String uri) throws IEException
tasklet
- the reference tasklet from which to initialize this taskuri
- the URI of the source for this task
IEException
public void setRequest(javax.servlet.http.HttpServletRequest request) throws IOException
request
- The HTTP servlet request object.
IOException
private void addAttribute(Group group, String name, String value)
group
- The group to which to add the attributename
- The name of the attributevalue
- The value of the attributepublic void invoke() throws IEException, IOException
IEException
- if an error other than an I/O error occurs.
IOException
- if an I/O error occurs.public void compile() throws IEException, IOException
IEException
- if an error other than an I/O error occurs.
IOException
- if an I/O error occurs.public static IeCollection executeTask(String uri, Task task, Boolean isCredentialsMapper) throws IEException
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.
IEException
- if the task is not executed successfully.public static IeCollection executeTask(String uri, String processor, Task task, IeCollection vdb, Group form) throws IEException
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.
IEException
- if the task is not executed successfully.public static IeCollection executeTask(String uri, Vector processors, Task task, IeCollection vdb, Group form) throws IEException
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.
IEException
- if the task is not executed successfully.public static void executeTaskRemotely(String uri, Task task, IeService service, IeMultipartInputStream is, OutputStream os, Vector processors) throws IEException, IOException
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.
IEException
- if an error other than an I/O error occurs
during execution of the tasklet.
IOException
- if an I/O error occurs.public String toString()
private String getParams()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |