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

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

final class ActivityResponse
extends java.lang.Object
implements Response

A Response corresponding to an ActivityRequest.

This class is also responsible for populating the outputs for each activity in the ActivityRequest with the data contained within a response document.

Author:
The OGSA-DAI Project Team

Field Summary
private static java.lang.String COPYRIGHT_NOTICE
          Copyright statement
private  AttachmentManager mAttachmentManager
          Manager for attachments
private  RequestStatus mRequestStatus
          The status of the request.
private  org.w3c.dom.Document mResponseDocument
          Response document as returned from a data service perform operation
private  Session mSession
          The session that the request was joined to.
 
Constructor Summary
(package private) ActivityResponse(DataService dataService, org.w3c.dom.Document response, java.util.Map outputs)
          Constructs an ActivityResponse for the given response document and populates the activity outputs with the data contained in the response document.
(package private) ActivityResponse(DataService dataService, org.w3c.dom.Document response, java.util.Map outputs, AttachmentManager attachmentManager)
          Constructs an ActivityResponse for the given response document and populates the activity outputs with the data contained in the response document.
 
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.
 java.lang.String toString()
          Returns a brief description of this activity response.
 
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

mResponseDocument

private org.w3c.dom.Document mResponseDocument
Response document as returned from a data service perform operation


mSession

private final Session mSession
The session that the request was joined to.


mRequestStatus

private final RequestStatus mRequestStatus
The status of the request.


mAttachmentManager

private final AttachmentManager mAttachmentManager
Manager for attachments

Constructor Detail

ActivityResponse

ActivityResponse(DataService dataService,
                 org.w3c.dom.Document response,
                 java.util.Map outputs)
           throws DataFormatException
Constructs an ActivityResponse for the given response document and populates the activity outputs with the data contained in the response document.

Parameters:
dataService - Proxy for the data service that processed the request that and returned the response document.
response - Response document returned from the service's perform operation
outputs - Mapping of activity output names (java.lang.String) to activity outputs (ActivityOutput) for all the activity outputs that were in the corresponding ActivityRequest.
Throws:
DataFormatException - if response is not actually a response document.

ActivityResponse

ActivityResponse(DataService dataService,
                 org.w3c.dom.Document response,
                 java.util.Map outputs,
                 AttachmentManager attachmentManager)
           throws DataFormatException
Constructs an ActivityResponse for the given response document and populates the activity outputs with the data contained in the response document. Stores reference to the object managing attachments.

Parameters:
dataService - Proxy for the data service that processed the request that and returned the response document.
response - Response document returned from the service's perform operation
outputs - Mapping of activity output names (java.lang.String) to activity outputs (ActivityOutput) for all the activity outputs that were in the corresponding ActivityRequest.
attachmentManager - Manager for attachments.
Throws:
DataFormatException - if response is not actually a response document.
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

toString

public java.lang.String toString()
Returns a brief description of this activity response. The exact details of this are subject to change but the format at present is as follows:
"[ActivityResponse: hashCode=f359ad3a]"

Overrides:
toString in class java.lang.Object

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.