uk.org.ogsadai.engine.controlflow
Class ResponseBuilderImpl

java.lang.Object
  |
  +--uk.org.ogsadai.engine.controlflow.ResponseBuilderImpl
All Implemented Interfaces:
ResponseBuilder

public class ResponseBuilderImpl
extends java.lang.Object
implements ResponseBuilder

A ResponseBuilder to assemble an OGSA-DAI response document that conforms to the response document schema for OGSA-DAI R6.

Author:
The OGSA-DAI Project Team

Constructor Summary
ResponseBuilderImpl()
           
 
Method Summary
 void buildError(java.lang.String name, java.lang.Exception cause)
          Assembles part of the response document describing an error that has occurred while processing part of a request.
 void buildRequestError(java.lang.String cause)
          Assembles the part of the response document describing the status of a request that has failed due to an error.
 void buildRequestStatus(Status status)
          Assembles the part of the response document describing the status of the request.
 void buildResult(java.lang.String name, Status status, byte[] data)
          Assembles part of the response document describing the result of processing part of the request.
 org.w3c.dom.Document getResponseDocument()
          Gets the assembled response document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResponseBuilderImpl

public ResponseBuilderImpl()
Method Detail

buildResult

public void buildResult(java.lang.String name,
                        Status status,
                        byte[] data)
Description copied from interface: ResponseBuilder
Assembles part of the response document describing the result of processing part of the request.

Specified by:
buildResult in interface ResponseBuilder
Parameters:
name - the name associated with the result
status - the status of the result
data - the result data. This may be null or an empty String if the result contains no result data.

buildError

public void buildError(java.lang.String name,
                       java.lang.Exception cause)
Description copied from interface: ResponseBuilder
Assembles part of the response document describing an error that has occurred while processing part of a request.

Specified by:
buildError in interface ResponseBuilder
Parameters:
name - the name associated with the error
cause - the Exception that was raised by the error

buildRequestStatus

public void buildRequestStatus(Status status)
Description copied from interface: ResponseBuilder
Assembles the part of the response document describing the status of the request.

Specified by:
buildRequestStatus in interface ResponseBuilder
Parameters:
status - the Status of the request

buildRequestError

public void buildRequestError(java.lang.String cause)
Description copied from interface: ResponseBuilder
Assembles the part of the response document describing the status of a request that has failed due to an error.

Specified by:
buildRequestError in interface ResponseBuilder
Parameters:
cause - the cause string for the error

getResponseDocument

public org.w3c.dom.Document getResponseDocument()
Description copied from interface: ResponseBuilder
Gets the assembled response document. This should be invoked after the building process has been completed.

Specified by:
getResponseDocument in interface ResponseBuilder
Returns:
the response Document