IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.channel
Interface ChannelResponse

All Known Implementing Classes:
HttpChannelResponse, JavaAssignChannelResponse, JavaProtocolChannelResponse, JSONHttpChannelResponse, MobileResponse, XmlHttpChannelResponse

public interface ChannelResponse

The interface used to wrap the response object. So it can make the channel processing logic protocol independent.


Field Summary
static java.lang.String COPYRIGHT
           
 
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 of the response
 void setContentType(java.lang.String contentType)
          Set the content type of the response
 

Field Detail

COPYRIGHT

static final java.lang.String COPYRIGHT
See Also:
Constant Field Values
Method Detail

handleServerException

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.

Parameters:
e - exception object
Throws:
java.lang.Exception - The exception description.

sendResult

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

Parameters:
channelContext - the channel context object
result - the result send back to the client
Throws:
java.lang.Exception

getCharacterEncoding

java.lang.String getCharacterEncoding()
Returns:
the character encoding of the request and the response

setCharacterEncoding

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

Parameters:
encoding - the character encoding
Throws:
java.io.UnsupportedEncodingException - if the encoding isn't supported

getResponse

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

Returns:
the underlying the response object

setContentType

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

Parameters:
contentType - the content type of the response

getOutputStream

java.io.OutputStream getOutputStream()
                                     throws java.io.IOException
Returns:
the output stream of the response
Throws:
java.io.IOException

setContentLength

void setContentLength(int length)
Set the content length of the response

Parameters:
length - the length of the content

addCookie

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

Parameters:
name - the name of the cookie
value - the value of the cookie

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2010