uk.org.ogsadai.client.toolkit
Class Request

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.Request
Direct Known Subclasses:
ActivityRequest, DocumentRequest

public abstract class Request
extends java.lang.Object

A class representing a OGSA-DAI request. This includes a data service stub, a data service resource ID, the request (perform document) and the response document (when it arrives).

Author:
The OGSA-DAI Team.

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  DataService mDataService
          The data service that will process the request.
 
Constructor Summary
Request()
           
 
Method Summary
abstract  Response createResponse(org.w3c.dom.Document response)
          Create a response object corresponding to the given XML document which is assumed to hold an OGSA-DAI XML response document.
abstract  Response createResponse(org.w3c.dom.Document response, AttachmentManager attachmentManager)
          Create a response object corresponding to the given XML document which is assumed to hold an OGSA-DAI XML response document.
protected  DataService getDataService()
          Gets the proxy of the data service at which the request will be directed.
abstract  org.w3c.dom.Document getDocument()
          Get the request (perform document) in its XML format.
abstract  void setDataResourceID(ResourceID id)
          Set the ID of the data service resource at which the request will be directed.
 void setDataService(DataService dataService)
          Sets the proxy of the data service at which the request will be directed.
 
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

mDataService

private DataService mDataService
The data service that will process the request.

Constructor Detail

Request

public Request()
Method Detail

setDataResourceID

public abstract void setDataResourceID(ResourceID id)
Set the ID of the data service resource at which the request will be directed.

Parameters:
id - Data service resource ID.

setDataService

public void setDataService(DataService dataService)
Sets the proxy of the data service at which the request will be directed.

Parameters:
dataService - Data service proxy that will process the request.
Throws:
java.lang.IllegalArgumentException - if dataService is null.

getDataService

protected DataService getDataService()
Gets the proxy of the data service at which the request will be directed.

Returns:
data service proxy.
Throws:
java.lang.IllegalStateException - if this method is called before setDataService.

getDocument

public abstract org.w3c.dom.Document getDocument()
Get the request (perform document) in its XML format.

Returns:
request as an XML perform document.

createResponse

public abstract Response createResponse(org.w3c.dom.Document response)
                                 throws DataFormatException
Create a response object corresponding to the given XML document which is assumed to hold an OGSA-DAI XML response document.

Parameters:
response - OGSA-DAI response document.
Returns:
response object.
Throws:
DataFormatException - if response does not hold an OGSA-DAI Response document.

createResponse

public abstract Response createResponse(org.w3c.dom.Document response,
                                        AttachmentManager attachmentManager)
                                 throws DataFormatException
Create a response object corresponding to the given XML document which is assumed to hold an OGSA-DAI XML response document. The response object will also contain a reference to the AttachmentManager object which provides access to attachments data.

Parameters:
response - OGSA-DAI response document.
attachmentManager - Object managing attachments.
Returns:
response object.
Throws:
DataFormatException - if response does not hold an OGSA-DAI Response document.