uk.org.ogsadai.client.toolkit
Class DocumentRequest

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

public class DocumentRequest
extends Request

OGSA-DAI request constructed from an XML perform document.

Author:
he OGSA-DAI Project Team

Constructor Summary
DocumentRequest(org.w3c.dom.Document request)
          Constructs a request that consists of the given request document.
DocumentRequest(java.io.File file)
          Constructs a request that consists of request document in the specified file.
DocumentRequest(java.lang.String request)
          Constructs a request that consists of the given request document.
 
Method Summary
 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)
          This implementation takes no action.
 void setDataServiceStub(Stub stub)
          Set the stub of the data service at which the request will be directed.
 java.lang.String toString()
          Returns XML request document as a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DocumentRequest

public DocumentRequest(org.w3c.dom.Document request)
Constructs a request that consists of the given request document.

Parameters:
request - XML request document
Throws:
java.lang.IllegalArgumentException - If argument is null.

DocumentRequest

public DocumentRequest(java.lang.String request)
                throws DocumentParsingException
Constructs a request that consists of the given request document.

Parameters:
request - XML request document
Throws:
DocumentParsingException - If the given request is not valid XML
java.lang.IllegalArgumentException - If argument is null

DocumentRequest

public DocumentRequest(java.io.File file)
                throws java.io.FileNotFoundException,
                       java.io.IOException,
                       DocumentParsingException
Constructs a request that consists of request document in the specified file.

Parameters:
file - file containing request document
Throws:
java.io.FileNotFoundException - If the file does not exist
java.io.IOException - If an IO exception occurs when attempting to access the file.
DocumentParsingException - If the file is not valid XML
java.lang.IllegalArgumentException - If argument is null
Method Detail

toString

public java.lang.String toString()
Returns XML request document as a String.

Overrides:
toString in class java.lang.Object
Returns:
XML request document

setDataResourceID

public void setDataResourceID(ResourceID id)
This implementation takes no action.

Specified by:
setDataResourceID in class Request
Parameters:
id - - data service resource ID.
See Also:
Request.setDataResourceID(ResourceID id)

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.

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.

setDataServiceStub

public void setDataServiceStub(Stub stub)
Description copied from class: Request
Set the stub of the data service at which the request will be directed.

Specified by:
setDataServiceStub in class Request
Parameters:
stub - - data service stub.