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

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.Request
        |
        +--uk.org.ogsadai.client.toolkit.activity.ActivityRequest

public class ActivityRequest
extends Request

OGSA-DAI request constructed as a collection of connected activities.

OGSA-DAI sends requests to the data service to perform a number of activities that manipulate this data. The Activity objects that make up the request will have their corresponding ActivityOutput objects populated with any result data when the request is passed to the data service's perform method.

Author:
The OGSA-DAI Project Team

Constructor Summary
ActivityRequest()
          Constructs an activity request with no activities.
ActivityRequest(RequestComponent[] components)
          Constructs an activity request that contains the specified components.
 
Method Summary
 void add(RequestComponent component)
          Adds the given composite component to the request.
 void add(RequestComponent[] components)
          Adds the given array of request components to the request.
 void clear()
          Removes all the activities from the request.
 Response createResponse(org.w3c.dom.Document response)
          Returns a Response object compatible with this Request object.
 org.w3c.dom.Document getDocument()
          Gets the request as an XML DOM object.
 void setDataResourceID(ResourceID id)
          Inform all of the activities in this request of the ResourceID identifying the resource that this request is being executed against.
 void setDataServiceStub(Stub stub)
          Inform all of the activities in this request of the DataService object executing the request.
 java.lang.String toString()
          Returns a brief description of this activity output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ActivityRequest

public ActivityRequest()
Constructs an activity request with no activities. Activities can be added using the add methods.


ActivityRequest

public ActivityRequest(RequestComponent[] components)
Constructs an activity request that contains the specified components.

Parameters:
components - array of components to include in the request
Throws:
java.lang.IllegalArgumentException - if the argument is null
Method Detail

add

public void add(RequestComponent component)
Adds the given composite component to the request.

Parameters:
component - composite activity to add
Throws:
java.lang.IllegalArgumentException - If the argument is null

add

public void add(RequestComponent[] components)
Adds the given array of request components to the request.

Parameters:
components -

clear

public void clear()
Removes all the activities from the request.


toString

public java.lang.String toString()
Returns a brief description of this activity output. The exact details of this are unspecified and subject to change but the following may be regarded as typical:
"[ActivityRequest: #activities=3 ]"

Overrides:
toString in class java.lang.Object

createResponse

public Response createResponse(org.w3c.dom.Document response)
Returns a Response object compatible with this Request object.

The Response object will populated with the XML response document.

Specified by:
createResponse in class Request
Parameters:
response - XML response document
Returns:
Response object.

setDataResourceID

public void setDataResourceID(ResourceID id)
Inform all of the activities in this request of the ResourceID identifying the resource that this request is being executed against.

Specified by:
setDataResourceID in class Request
Parameters:
id - the ResourceID object

setDataServiceStub

public void setDataServiceStub(Stub stub)
Inform all of the activities in this request of the DataService object executing the request.

Specified by:
setDataServiceStub in class Request
Parameters:
stub - the DataService object

getDocument

public org.w3c.dom.Document getDocument()
Gets the request as an XML DOM object.

Specified by:
getDocument in class Request
Returns:
The request as an XML DOM object.
Throws:
InternalErrorException - If an internal OGSA-DAI error occurs because an activity generated invalid XML.