uk.org.ogsadai.client.toolkit
Class DocumentResponse

java.lang.Object
  |
  +--uk.org.ogsadai.client.toolkit.DocumentResponse
All Implemented Interfaces:
Response

final class DocumentResponse
extends java.lang.Object
implements Response

A class representing an OGSA-DAI response corresponding to a request that, client-side, was represented as a DocumentRequest.

Every Request has a corresponding Response that processes the response returned by a service containing the results of the request.

This class does not process the OGSA-DAI XML response document received from a service in any way. The class simply provides methods to access XML document.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  AttachmentManager mAttachmentManager
           
private  RequestStatus mRequestStatus
          Request status as contained in the response document
private  org.w3c.dom.Document mResponseDocument
          Response document
private  Session mSession
          Session that the request was joined to
 
Constructor Summary
DocumentResponse(DataService dataService, org.w3c.dom.Document response)
          Creates a new document response object.
DocumentResponse(DataService dataService, org.w3c.dom.Document response, AttachmentManager attachmentManager)
           
 
Method Summary
 java.lang.String getAsString()
          Gets the response document in its unprocessed XML form as a String.
 AttachmentManager getAttachmentManager()
          Gets the attachment manager object that provides convenient access to attachmens data.
 org.w3c.dom.Document getDocument()
          Gets the response as in its unprocessed XML form.
 RequestStatus getRequestStatus()
          Gets the status of the request as contained in the response.
 Session getSession()
          Gets the session details from the response.
 
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

mResponseDocument

private org.w3c.dom.Document mResponseDocument
Response document


mSession

private final Session mSession
Session that the request was joined to


mRequestStatus

private final RequestStatus mRequestStatus
Request status as contained in the response document


mAttachmentManager

private final AttachmentManager mAttachmentManager
Constructor Detail

DocumentResponse

public DocumentResponse(DataService dataService,
                        org.w3c.dom.Document response)
                 throws DataFormatException
Creates a new document response object.

Parameters:
dataService - Data service that generated the response.
response - Response document from service.
Throws:
DataFormatException - If the request status or session status cannot be extracted from the response.

DocumentResponse

public DocumentResponse(DataService dataService,
                        org.w3c.dom.Document response,
                        AttachmentManager attachmentManager)
                 throws DataFormatException
Method Detail

getDocument

public org.w3c.dom.Document getDocument()
Description copied from interface: Response
Gets the response as in its unprocessed XML form.

Specified by:
getDocument in interface Response
Returns:
the response document

getAsString

public java.lang.String getAsString()
Description copied from interface: Response
Gets the response document in its unprocessed XML form as a String.

Specified by:
getAsString in interface Response
Returns:
the response document

getSession

public Session getSession()
Description copied from interface: Response
Gets the session details from the response. These identify the session that the corresponding request was joined to.

Specified by:
getSession in interface Response
Returns:
a Session object identifying the session.

getRequestStatus

public RequestStatus getRequestStatus()
Description copied from interface: Response
Gets the status of the request as contained in the response.

Specified by:
getRequestStatus in interface Response
Returns:
status of the request.

getAttachmentManager

public AttachmentManager getAttachmentManager()
Description copied from interface: Response
Gets the attachment manager object that provides convenient access to attachmens data.

Specified by:
getAttachmentManager in interface Response
Returns:
Attachment manager object.