uk.org.ogsadai.client.toolkit.activity
Class RequestComponent

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.activity.RequestComponent
Direct Known Subclasses:
Activity, Composite

public abstract class RequestComponent
extends java.lang.Object

Superclass for components of a request.

Author:
The OGSA-DAI Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  DataService mDataService
          The data service associated with the request component.
private  java.lang.String mName
          Unique name of the activity - auto-generated
private  ResourceID mResource
          ID of data service resource to which the request of which this component is a part has been submitted, or null if there is no associated resource.
private  Session mSession
          Session within which the request of which this component is a part, was executed.
 
Constructor Summary
RequestComponent()
           
 
Method Summary
protected abstract  void addOutputs(java.util.Map allOutputs)
          Add the outputs of this request component to the given map.
protected abstract  java.lang.String generateXML()
          Generates the XML representing the activity.
private  java.lang.String getClassName()
          Gets the unqualified name of this class.
protected  ResourceID getDataResourceID()
          Gets the ID of the data service resource executing this activity, or null if there is no associated resource.
protected  DataService getDataService()
           
 java.lang.String getName()
          Gets the activity name.
protected  Session getSession()
          Gets the session that the request to which this request component belongs has been executed within.
protected  void setDataResourceID(ResourceID id)
          Sets the ID of the data service resource executing this activity, or null if there is no associated resource.
protected  void setDataService(DataService dataService)
           
protected  void setSession(Session session)
          Sets the session that the request to which this request component belongs has been executed within.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

mName

private java.lang.String mName
Unique name of the activity - auto-generated


mResource

private ResourceID mResource
ID of data service resource to which the request of which this component is a part has been submitted, or null if there is no associated resource.


mDataService

private DataService mDataService
The data service associated with the request component.


mSession

private Session mSession
Session within which the request of which this component is a part, was executed.

Constructor Detail

RequestComponent

public RequestComponent()
Method Detail

getClassName

private java.lang.String getClassName()
Gets the unqualified name of this class. For example, the type of the activity.

Returns:
this class's name, with no package-qualification.

getName

public java.lang.String getName()
Gets the activity name. Each activity instance will have a unique name.

Returns:
activity name

getDataResourceID

protected ResourceID getDataResourceID()
Gets the ID of the data service resource executing this activity, or null if there is no associated resource.

This method may be called by activities which need to know information about the resource.

Returns:
the resource ID.

setDataResourceID

protected void setDataResourceID(ResourceID id)
Sets the ID of the data service resource executing this activity, or null if there is no associated resource.

Parameters:
id - Resource ID

setSession

protected void setSession(Session session)
Sets the session that the request to which this request component belongs has been executed within. This is invoked after the enclosing request has been executed.

Parameters:
session - Session within which the request component was executed.
Throws:
java.lang.IllegalArgumentException - If session is null. All request components are executed within a session.

getSession

protected Session getSession()
                      throws java.lang.IllegalStateException
Gets the session that the request to which this request component belongs has been executed within.

Throws:
java.lang.IllegalStateException - if the method is invoked before the request to which this component belongs has been executed.

setDataService

protected void setDataService(DataService dataService)

getDataService

protected DataService getDataService()

generateXML

protected abstract java.lang.String generateXML()
Generates the XML representing the activity. This XML can then be inserted into a perform document that is sent to a data service.

Returns:
the XML for the activity

addOutputs

protected abstract void addOutputs(java.util.Map allOutputs)
Add the outputs of this request component to the given map. The map is assumed to map java.lang.String to uk.org.ogsadai.client.toolkit.activity.ActivityOutput.

Parameters:
allOutputs - Map from strings to activity outputs.