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

Client toolkit wrapper for OGSA-DAI perform documents provided by a client.

Author:
he OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  org.w3c.dom.Document mPerformDoc
          Request (perform document)
 
Fields inherited from class uk.org.ogsadai.client.toolkit.Request
 
Constructor Summary
DocumentRequest(org.w3c.dom.Document performDoc)
          Constructs a request that consists of the given perform document.
DocumentRequest(java.io.File performDocFile)
          Constructs a request that consists of the given perform document.
DocumentRequest(java.lang.String performDoc)
          Constructs a request that consists of the given perform document.
 
Method Summary
 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.
 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.
 org.w3c.dom.Document getDocument()
          Get the request (perform document) in its XML format.
 void setDataResourceID(ResourceID id)
          Set the ID of the data service resource at which the request will be directed.
 java.lang.String toString()
          Return the request as a string.
 
Methods inherited from class uk.org.ogsadai.client.toolkit.Request
getDataService, setDataService
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COPYRIGHT_NOTICE

private static final java.lang.String COPYRIGHT_NOTICE
Copyright statement

See Also:
Constant Field Values

mPerformDoc

private org.w3c.dom.Document mPerformDoc
Request (perform document)

Constructor Detail

DocumentRequest

public DocumentRequest(org.w3c.dom.Document performDoc)
Constructs a request that consists of the given perform document. It is up to the client to ensure that document is indeed a valid OGS-DAI perform document.

Parameters:
performDoc - OGSA-DAI perform document.
Throws:
java.lang.IllegalArgumentException - if performDoc is null.

DocumentRequest

public DocumentRequest(java.lang.String performDoc)
                throws XMLParseException
Constructs a request that consists of the given perform document. It is up to the client to ensure that document is indeed a valid OGS-DAI perform document.

Parameters:
performDoc - OGSA-DAI perform document in a string
Throws:
java.lang.IllegalArgumentException - if performDoc is null.
XMLParseException - if the given request is not valid XML

DocumentRequest

public DocumentRequest(java.io.File performDocFile)
                throws XMLFileException,
                       XMLParseException
Constructs a request that consists of the given perform document. It is up to the client to ensure that document is indeed a valid OGS-DAI perform document.

Parameters:
performDocFile - OGSA-DAI perform document in a string
Throws:
java.lang.IllegalArgumentException - if performDocFile is null.
XMLFileException - if there is a problem accessing the given request file.
XMLParseException - if the given request is not valid XML.
Method Detail

toString

public java.lang.String toString()
Return the request as a string.

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

setDataResourceID

public void setDataResourceID(ResourceID id)
Description copied from class: Request
Set the ID of the data service resource at which the request will be directed.

Specified by:
setDataResourceID in class Request
Parameters:
id - Data service resource ID.

createResponse

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

Specified by:
createResponse in class Request
Parameters:
response - OGSA-DAI response document.
Returns:
response object.
Throws:
DataFormatException - if response does not hold an OGSA-DAI Response document.

createResponse

public Response createResponse(org.w3c.dom.Document response,
                               AttachmentManager attachmentManager)
                        throws DataFormatException
Description copied from class: Request
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.

Specified by:
createResponse in class Request
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.

getDocument

public org.w3c.dom.Document getDocument()
Description copied from class: Request
Get the request (perform document) in its XML format.

Specified by:
getDocument in class Request
Returns:
request as an XML perform document.