|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--uk.org.ogsadai.activity.ActivityContext
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.
Field Summary | |
private static java.lang.String |
COPYRIGHT_NOTICE
Copyright statement. |
private static DAILogger |
LOG
Logger object for logging in this class. |
private RequestContext |
mContext
Holds the basic request context. |
private EngineConfiguration |
mEngineConfiguration
Engine configuration |
private java.util.Map |
mInternalPipes
Holds internal pipes used for transporting data between activities |
Constructor Summary | |
ActivityContext(EngineConfiguration engineConfiguration,
RequestContext context)
Constructs an internal request context. |
Method Summary | |
(package private) void |
addPipe(java.lang.String name,
Pipe pipe)
Adds a Pipe to the request context. |
(package private) ActivityRequest |
getActivityRequest()
Gets the activity request containing the activity. |
AttachmentManager |
getAttachmentManager()
Gets the attachment manager through which attachments can be added to the response document. |
AccessAuthorizer |
getAuthorizer()
Gets the authorizer which authorizes access to resources and activities. |
(package private) java.lang.Throwable |
getCauseOfError()
If there is an error during the processing of a request, return the exception. |
DataResourceAccessor |
getDataResourceAccessor()
Gets the DataResourceAccessor providing access to
the underlying data resource associated with the data service
resource. |
DataServiceResourceFactory |
getDataResourceFactory()
Gets the data service resource factory through which new data service resources can be created. |
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 from the
activity. |
java.lang.String |
getResourceID()
Returns the resource ID associated with the request |
SecurityContext |
getSecurityContext()
Gets the security context associated with the request. |
java.lang.String |
getURL()
Returns the local path to the data service within its enclosing web application. |
(package private) boolean |
hasError()
Indicates whether or not there has been an error while the request has been processing. |
(package private) boolean |
hasPipe(java.lang.String name)
Checks whether the context contains a pipe with the given name. |
(package private) void |
setError(java.lang.Throwable cause)
Sets a reference to the first error raised by an activity. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String COPYRIGHT_NOTICE
private static final DAILogger LOG
private final RequestContext mContext
private final java.util.Map mInternalPipes
private final EngineConfiguration mEngineConfiguration
Constructor Detail |
public ActivityContext(EngineConfiguration engineConfiguration, RequestContext context)
engineConfiguration
- Engine configuration which provides access to data resource
accessors.context
- Request context containing the security settings.Method Detail |
final void addPipe(java.lang.String name, Pipe pipe) throws DuplicatePipeException
Pipe
to the request context.
name
- The name of the pipe to add.pipe
- The Pipe
to add.
DuplicatePipeException
- If a pipe with the same name has already been added to the context.final boolean hasPipe(java.lang.String name)
name
- The name of the pipe.
true
if it does, else false
.public final DataResourceAccessor getDataResourceAccessor()
DataResourceAccessor
providing access to
the underlying data resource associated with the data service
resource.
DataResourceAccessor
, the concrete type of
which depends on the data service resource configuration.public final DataServiceResourceFactory getDataResourceFactory()
public final BlockReader getInput(java.lang.String name) throws ActivityStreamNotFoundException
BlockReader
for an internal input to the
activity.
name
- The name of the input.
BlockReader
from which the input
data can be read.
ActivityStreamNotFoundException
- If the specified input is not contained in the context.public final BlockWriter getOutput(java.lang.String name) throws ActivityStreamNotFoundException
BlockWriter
for an internal output from the
activity.
name
- The name of the output.
BlockWriter
to which the output
data can be written.
ActivityStreamNotFoundException
- If the specified output is not contained in the context.public final SecurityContext getSecurityContext()
SecurityContext
instancepublic java.lang.String getURL()
String
object or null
if
the request is running outwith a web service.public java.lang.String getResourceID()
public AttachmentManager getAttachmentManager()
public AccessAuthorizer getAuthorizer()
final void setError(java.lang.Throwable cause)
cause
- Error raised by an activity.final boolean hasError()
true
if there has been an error, otherwise
false
final java.lang.Throwable getCauseOfError()
null
final ActivityRequest getActivityRequest()
ActivityRequest
object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |