Version: 1.1.1

ca.ucalgary.services.util
Interface DataRecorder

All Known Implementing Classes:
PBERecorder

public interface DataRecorder

This interface allows implementing classes to intercept data as it is proxied between the HTML interface user and the remote Web Service in ca.ucalgary.services.SoapServlet or the remote CGIs in ca.ucalgary.services.CGIServlet .* This interception allows the DataRecorder to save and/or modify the on-the-wire messages to the service.

Author:
Paul Gordon

Field Summary
static String PASSTHROUGH_ACTION
          If this variable is passed in a GET request to WrappingServlet, WrappingServlet will forward the GET request as-is to the data recorder.
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          The WrappingServlet may delegate the whole request to the data recorder (if a parameter named after PASSTHROUGH_ACTION is in the GET request).
 String getBody(javax.servlet.http.HttpServletRequest formRequest)
          Gives the data recorder an opportunity to insert extra HTML elements into the body (at the start) of the WrappingServlet generates for the user-facing CGI form.
 Node[] getBodyAsDOM(javax.servlet.http.HttpServletRequest formRequest, Document owner)
           
 String getBodyAttrs(javax.servlet.http.HttpServletRequest formRequest)
          Gives the data recorder an opportunity to insert extra HTML element attributes into the body element the WrappingServlet generates for the Web Service's CGI form.
 Attr[] getBodyAttrsAsDOM(javax.servlet.http.HttpServletRequest formRequest, Document owner)
           
 String getHead(javax.servlet.http.HttpServletRequest formRequest)
          Gives the data recorder an opportunity to insert extra HTML into the head element of the HTML the WrappingServlet generates for the Web Service's CGI form.
 Node[] getHeadAsDOM(javax.servlet.http.HttpServletRequest formRequest, Document owner)
          Gives the data recorder an opportunity to insert extra HTML into the head element of the HTML the WrappingServlet generates for the Web Service's CGI form.
 Attr getOnEventAsDOM(Document owner)
           
 String getOnEventText()
          Gives the data recorder an opportunity to insert a javascript event handler into every form input element the WrappingServlet generates for the Web Service's CGI form.
 Attr getOnSubmitAsDOM(Document owner)
           
 String getOnSubmitText()
          Gives the data recorder an opportunity to insert a javascript event handler into the form submission tags the WrappingServlet generates for the Web Service's CGI form.
 void interceptRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 byte[] markupResponse(byte[] responseBody, String contentType, String charSetEncoding, javax.servlet.http.HttpServletRequest submissionRequest)
          Gives the data recorder an opportunity to record or modify the CGI response before WrappingServlet returns it to the HTTP client.
 String markupResponse(Source resultSource, javax.servlet.http.HttpServletRequest submissionRequest)
          Gives the data recorder an opportunity to record or modify the Web Service response before WrappingServlet returns it to the HTTP client.
 void setInputParams(javax.servlet.http.HttpServletRequest submissionRequest, Map<String,byte[]> httpParams, List<String> hiddenParams)
          Lets the data recorder know what the input XML to the Web Service looked like.
 void setInputSource(javax.servlet.http.HttpServletRequest submissionRequest, SourceMap source)
          Lets the data recorder know what the input XML to the Web Service looked like.
 void setParameter(javax.servlet.http.HttpSession session, String paramName, String paramValue)
          Allows a WrappingServlet to set the equivalent of HTTP request parameters (which are normally immutable).
 void setTransformer(Transformer transformer)
          Specify a XML transformation to be applied to the service results.
 boolean shouldIntercept(javax.servlet.http.HttpServletRequest request)
          Lets the WrappingServlet know if the HTTP GET request should be handles by interceptRequest or not.
 void startRecording(javax.servlet.http.HttpServletRequest initialRequest)
          Tells the data recorder that a new Web Service proxying has been requested.
 String writeWrapperForm(javax.servlet.http.HttpServletRequest request)
           
 

Field Detail

PASSTHROUGH_ACTION

static final String PASSTHROUGH_ACTION
If this variable is passed in a GET request to WrappingServlet, WrappingServlet will forward the GET request as-is to the data recorder.

See Also:
Constant Field Values
Method Detail

setTransformer

void setTransformer(Transformer transformer)
Specify a XML transformation to be applied to the service results. For example, SoapServlet tries to indent the results nicely.


startRecording

void startRecording(javax.servlet.http.HttpServletRequest initialRequest)
Tells the data recorder that a new Web Service proxying has been requested. The data recorder might want to set a cookie or something of the sort to track further callbacks.

Parameters:
initialRequest - the GET request that specifies the WSDL to be proxied

doGet

void doGet(javax.servlet.http.HttpServletRequest request,
           javax.servlet.http.HttpServletResponse response)
The WrappingServlet may delegate the whole request to the data recorder (if a parameter named after PASSTHROUGH_ACTION is in the GET request). This is the method called if that parameter exists.


shouldIntercept

boolean shouldIntercept(javax.servlet.http.HttpServletRequest request)
Lets the WrappingServlet know if the HTTP GET request should be handles by interceptRequest or not. This will generally be determined by special request parameters the data recorder inserted into the request form.


interceptRequest

void interceptRequest(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)

writeWrapperForm

String writeWrapperForm(javax.servlet.http.HttpServletRequest request)

setInputSource

void setInputSource(javax.servlet.http.HttpServletRequest submissionRequest,
                    SourceMap source)
Lets the data recorder know what the input XML to the Web Service looked like.


setInputParams

void setInputParams(javax.servlet.http.HttpServletRequest submissionRequest,
                    Map<String,byte[]> httpParams,
                    List<String> hiddenParams)
Lets the data recorder know what the input XML to the Web Service looked like.


markupResponse

String markupResponse(Source resultSource,
                      javax.servlet.http.HttpServletRequest submissionRequest)
                      throws Exception
Gives the data recorder an opportunity to record or modify the Web Service response before WrappingServlet returns it to the HTTP client.

Returns:
the XML serialization of the resultSource, potentially modified
Throws:
Exception

markupResponse

byte[] markupResponse(byte[] responseBody,
                      String contentType,
                      String charSetEncoding,
                      javax.servlet.http.HttpServletRequest submissionRequest)
                      throws Exception
Gives the data recorder an opportunity to record or modify the CGI response before WrappingServlet returns it to the HTTP client.

Returns:
responseBody, potentially modified
Throws:
Exception

getHead

String getHead(javax.servlet.http.HttpServletRequest formRequest)
Gives the data recorder an opportunity to insert extra HTML into the head element of the HTML the WrappingServlet generates for the Web Service's CGI form.

Returns:
recorder-specific HTML code for the CGI form header

getHeadAsDOM

Node[] getHeadAsDOM(javax.servlet.http.HttpServletRequest formRequest,
                    Document owner)
Gives the data recorder an opportunity to insert extra HTML into the head element of the HTML the WrappingServlet generates for the Web Service's CGI form.

Parameters:
owner - the Document that should be used to create the DOM elements returned
Returns:
recorder-specific HTML code for the CGI form header

getBodyAttrs

String getBodyAttrs(javax.servlet.http.HttpServletRequest formRequest)
Gives the data recorder an opportunity to insert extra HTML element attributes into the body element the WrappingServlet generates for the Web Service's CGI form.

Returns:
recorder-specific HTML body-tag attributes for the CGI form header

getBodyAttrsAsDOM

Attr[] getBodyAttrsAsDOM(javax.servlet.http.HttpServletRequest formRequest,
                         Document owner)

getBody

String getBody(javax.servlet.http.HttpServletRequest formRequest)
Gives the data recorder an opportunity to insert extra HTML elements into the body (at the start) of the WrappingServlet generates for the user-facing CGI form.

Returns:
recorder-specific HTML body-tag attributes for the CGI form header

getBodyAsDOM

Node[] getBodyAsDOM(javax.servlet.http.HttpServletRequest formRequest,
                    Document owner)

getOnEventText

String getOnEventText()
Gives the data recorder an opportunity to insert a javascript event handler into every form input element the WrappingServlet generates for the Web Service's CGI form.

Returns:
recorder-specific CGI form attributes for input elements

getOnEventAsDOM

Attr getOnEventAsDOM(Document owner)

getOnSubmitText

String getOnSubmitText()
Gives the data recorder an opportunity to insert a javascript event handler into the form submission tags the WrappingServlet generates for the Web Service's CGI form.

Returns:
recorder-specific CGI form attributes for form submission tags

getOnSubmitAsDOM

Attr getOnSubmitAsDOM(Document owner)

setParameter

void setParameter(javax.servlet.http.HttpSession session,
                  String paramName,
                  String paramValue)
Allows a WrappingServlet to set the equivalent of HTTP request parameters (which are normally immutable). Useful in case salient parameters such as WrappingServlet.SERVICE_SPEC_PARAM or WrappingServlet.SRC_PARAM are passed around by aletrnate means (e.g. multipart encoded form like in CGIServlet)


Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010