uk.org.ogsadai.engine
Class RequestContext

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

public class RequestContext
extends java.lang.Object

This class encapsulates information describing the context of a request made to an Engine. This includes the security credentials of the user making the request. An instance of this class is passed as a parameter to the invoke method of the Engine interface in order to initiate a request. This class also provides access to any external inputs and outputs of a request.

Author:
The OGSA-DAI Project Team

Field Summary
protected  ActivityContext mActivityContext
          Activity context associated with a request.
 
Constructor Summary
RequestContext(SecurityContext securityContext)
          Constructs an invocation context for the specified SecurityContext.
 
Method Summary
 ActivityContext createActivityContext(EngineConfiguration engineConfiguration)
          Factory method to create the ActivityContext that will be available to any activity implementation.
 BlockWriter getInput(java.lang.String name)
          Gets the BlockWriter for the external input with the specified name allowing data to be written into a request.
 BlockReader getOutput(java.lang.String name)
          Gets the BlockReader for the external output with the specified name allowing data to be read from the request.
 SecurityContext getSecurityContext()
          Gets the security context associated with a request.
 java.lang.String getURL()
          Gets the URL associated with this request
 boolean hasInput(java.lang.String name)
          Checks whether the context contains a Pipe for an external input with the specified name.
 boolean hasOutput(java.lang.String name)
          Checks whether the context contains a Pipe for an external output with the specified name.
 void setSecurityContext(SecurityContext securityContext)
          Sets the security context associated with a request.
 void setURL(java.lang.String url)
          Sets the URL associated with this request
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mActivityContext

protected ActivityContext mActivityContext
Activity context associated with a request.

Constructor Detail

RequestContext

public RequestContext(SecurityContext securityContext)
Constructs an invocation context for the specified SecurityContext.

Parameters:
securityContext - the SecurityContext
Method Detail

getSecurityContext

public SecurityContext getSecurityContext()
Gets the security context associated with a request.

Returns:
a SecurityContext instance

setSecurityContext

public final void setSecurityContext(SecurityContext securityContext)
Sets the security context associated with a request.

Parameters:
securityContext - a SecurityContext instance

getOutput

public BlockReader getOutput(java.lang.String name)
Gets the BlockReader for the external output with the specified name allowing data to be read from the request.

Parameters:
name - The name of the external output.
Returns:
A BlockReader from which data can be read or null if there is no output with the specified name.

getInput

public BlockWriter getInput(java.lang.String name)
Gets the BlockWriter for the external input with the specified name allowing data to be written into a request.

Parameters:
name - The name of the external input.
Returns:
A BlockWriter into which data can be written or null if there is no output with the specified name.

hasInput

public final boolean hasInput(java.lang.String name)
Checks whether the context contains a Pipe for an external input with the specified name.

Parameters:
name - The name of the external input.
Returns:
true if the input exists, false otherwise.

hasOutput

public final boolean hasOutput(java.lang.String name)
Checks whether the context contains a Pipe for an external output with the specified name.

Parameters:
name - The name of the external output.
Returns:
true if the output exists, false otherwise.

createActivityContext

public ActivityContext createActivityContext(EngineConfiguration engineConfiguration)
Factory method to create the ActivityContext that will be available to any activity implementation. This method can be overridden by a subclass in order to create an extended ActivityContext.

Parameters:
engineConfiguration - the configuration of the engine processing the request
Returns:
an ActivityContext

getURL

public java.lang.String getURL()
Gets the URL associated with this request

Returns:
the URL associated with this request

setURL

public void setURL(java.lang.String url)
Sets the URL associated with this request

Parameters:
url - the URL associated with this request