uk.org.ogsadai.engine
Class ActivityContext

java.lang.Object
  |
  +--uk.org.ogsadai.engine.ActivityContext

public class ActivityContext
extends java.lang.Object

The ActivityContext provides a view of the context of a request suitable for activity implementations. Various get methods are provided for accessing objects such as the inputs and output block readers and block writers, as well as the connection manager. Along with the RequestContext class, this class provides an extension point for users wishing to store additional objects within the request context.

Author:
The OGSA-DAI Project Team

Constructor Summary
ActivityContext(EngineConfiguration engineConfiguration, RequestContext context)
          Constructs an internal request context.
 
Method Summary
 ConnectionManager getConnectionManager()
          Gets the DataResource implementation providing access to the underlying data resource associated with the grid data service.
 BlockReader getExternalInput(java.lang.String name)
          Gets the BlockReader for an external input to the activity.
 BlockWriter getExternalOutput(java.lang.String name)
          Gets the BlockWriter for an external output to the activity.
 BlockReader getInput(java.lang.String name)
          Gets the BlockReader for an internal input to the activity.
 BlockWriter getOutput(java.lang.String name)
          Gets the BlockWriter for an internal output to the activity.
 SecurityContext getSecurityContext()
          Gets the security context associated with the request containing the activity.
 java.lang.String getURL()
          Returns the URL associated with the Request
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivityContext

public ActivityContext(EngineConfiguration engineConfiguration,
                       RequestContext context)
Constructs an internal request context.

Parameters:
context - The RequestContext containing the security settings.
Method Detail

getConnectionManager

public final ConnectionManager getConnectionManager()
Gets the DataResource implementation providing access to the underlying data resource associated with the grid data service.

Returns:
a DataResource the concrete type of which depends on the grid data service configuration

getExternalInput

public final BlockReader getExternalInput(java.lang.String name)
                                   throws CommonUserException
Gets the BlockReader for an external input to the activity.

Parameters:
name - The name of the input.
Returns:
A BlockReader from which the input data can be read.
Throws:
CommonUserException - If the specified input is not contained in the context.

getExternalOutput

public final BlockWriter getExternalOutput(java.lang.String name)
                                    throws CommonUserException
Gets the BlockWriter for an external output to the activity.

Parameters:
name - The name of the output
Returns:
A BlockWriter in to which output data can be written.
Throws:
CommonUserException - If the specified output is not contained in the context.

getInput

public final BlockReader getInput(java.lang.String name)
                           throws CommonUserException
Gets the BlockReader for an internal input to the activity.

Parameters:
name - The name of the input.
Returns:
A BlockReader from which the input data can be read.
Throws:
CommonUserException - If the specified input is not contained in the context.

getOutput

public final BlockWriter getOutput(java.lang.String name)
                            throws CommonUserException
Gets the BlockWriter for an internal output to the activity.

Parameters:
name - The name of the output.
Returns:
A BlockWriter in to which output data can be written.
Throws:
CommonUserException - If the specified output is not contained in the context.

getSecurityContext

public final SecurityContext getSecurityContext()
Gets the security context associated with the request containing the activity.

Returns:
a SecurityContext instance

getURL

public java.lang.String getURL()
Returns the URL associated with the Request

Returns:
a String object or null if the Engine is not running within a grid service.