IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.http
Class HttpChannelResponse

java.lang.Object
  extended by com.ibm.btt.http.HttpChannelResponse
All Implemented Interfaces:
ChannelResponse
Direct Known Subclasses:
JavaAssignChannelResponse, JavaProtocolChannelResponse, JSONHttpChannelResponse, MobileResponse, RestChannelResponse, SMSChannelResponse, XmlHttpChannelResponse

public class HttpChannelResponse
extends java.lang.Object
implements ChannelResponse

The channel response used to wrap the HttpServletResponse.


Field Summary
protected  javax.servlet.http.HttpServletResponse response
           
 
Constructor Summary
HttpChannelResponse(javax.servlet.http.HttpServletResponse response)
          Construct the HttpChannelResponse object
 
Method Summary
 void addCookie(java.lang.String name, java.lang.String value)
          add the cookie the response
 java.lang.String getCharacterEncoding()
           
 java.io.OutputStream getOutputStream()
           
 java.lang.Object getResponse()
          The channel response is a wrapper, so you can use this to get the underlying response object
 void handleServerException(ChannelContext channelContext, java.lang.Exception e)
          Convenience method to ensure that a response is returned to the client for the case where no presentation handler exists or because the server is not initialized.
 void sendResult(ChannelContext channelContext, java.lang.String result)
          Send the result back to the client
 void setCharacterEncoding(java.lang.String encoding)
          Set the character encoding of the request and the response
 void setContentLength(int length)
          Set the content length
 void setContentType(java.lang.String contentType)
          Set the content type of the response
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

response

protected javax.servlet.http.HttpServletResponse response
Constructor Detail

HttpChannelResponse

public HttpChannelResponse(javax.servlet.http.HttpServletResponse response)
Construct the HttpChannelResponse object

Parameters:
response - HttpServletResponse the response
Method Detail

handleServerException

public void handleServerException(ChannelContext channelContext,
                                  java.lang.Exception e)
                           throws java.lang.Exception
Convenience method to ensure that a response is returned to the client for the case where no presentation handler exists or because the server is not initialized. This implementation is trying to reply to an Web client.

Specified by:
handleServerException in interface ChannelResponse
Parameters:
e - exception object
Throws:
java.lang.Exception - The exception description.

sendResult

public void sendResult(ChannelContext channelContext,
                       java.lang.String result)
                throws java.lang.Exception
Send the result back to the client

Specified by:
sendResult in interface ChannelResponse
Parameters:
channelContext - the channel context object
result - the result send back to the client
Throws:
java.lang.Exception

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Specified by:
getCharacterEncoding in interface ChannelResponse
Returns:
the character encoding of the request and the response

getResponse

public java.lang.Object getResponse()
The channel response is a wrapper, so you can use this to get the underlying response object

Specified by:
getResponse in interface ChannelResponse
Returns:
the underlying the response object

setCharacterEncoding

public void setCharacterEncoding(java.lang.String encoding)
                          throws java.io.UnsupportedEncodingException
Set the character encoding of the request and the response

Specified by:
setCharacterEncoding in interface ChannelResponse
Parameters:
encoding - the character encoding
Throws:
java.io.UnsupportedEncodingException - if the encoding isn't supported

addCookie

public void addCookie(java.lang.String name,
                      java.lang.String value)
add the cookie the response

Specified by:
addCookie in interface ChannelResponse
Parameters:
name - the name of the cookie
value - the value of the cookie

getOutputStream

public java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Specified by:
getOutputStream in interface ChannelResponse
Returns:
the output stream of the response
Throws:
java.io.IOException

setContentLength

public void setContentLength(int length)
Set the content length

Specified by:
setContentLength in interface ChannelResponse
Parameters:
length - the length of the content

setContentType

public void setContentType(java.lang.String contentType)
Set the content type of the response

Specified by:
setContentType in interface ChannelResponse
Parameters:
contentType - the content type of the response

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011