Presentation handler handles the response for the inbound request and process the channel policy exception while the request is rejected by channel policy. There are two levels of presentation handler:
▪ Global presentation handler: the presentation handler is configured in file btt.xml as following code:
The default implementation class of SMS presentation handler is com.ibm.btt.channel.sms.SMSPresentationHandler, which returns empty string for the inbound http request. The SMS presentation handler is recommended to be configured in file btt.xml as the global presentation handler. If the inbound local presentation handler is set, it uses the local level; if the local is not set, it uses the global presentation handler; if neither is set, it throws exception DSENoRegisteredPresentationHandlerException.
Application can extend class com.ibm.btt.channel.sms.SMSPresentationHandler and override the protected String getContent(ChannelContext channelContext) to return specific data required by gateway. Following is the example of extended presentation handler:
package com.ibm.btt.test; import com.ibm.btt.base.DSEObjectNotFoundException; import com.ibm.btt.channel.sms.SMSHandlerConstant; import com.ibm.btt.channel.sms.SMSHandlerException; import com.ibm.btt.channel.sms.SMSPresentationHandler; import com.ibm.btt.channel.sms.config.InboundHandlerConfiguration; import com.ibm.btt.clientserver.ChannelContext; public class MovilgatePresentationHandler extends SMSPresentationHandler {