IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.clientserver
Class DSERequestHandler

java.lang.Object
  extended by com.ibm.btt.clientserver.DSERequestHandler
All Implemented Interfaces:
RequestHandler
Direct Known Subclasses:
HtmlRequestHandler, JavaRequestHandler, MobileRequestHandler, SMSRequestHandler, Web2RequestHandler

public abstract class DSERequestHandler
extends java.lang.Object
implements RequestHandler

This class implements RequestHandler interface.

This is the abstract implementation to be used by all channel specific request handlers


Field Summary
protected  java.lang.String errorCode
           
protected static java.util.ResourceBundle javaClientException
           
protected static java.util.ResourceBundle javaClientTrace
          Trace File for NLS
 
Constructor Summary
DSERequestHandler()
           
 
Method Summary
protected  void checkExecutionPermission(java.lang.String sessionId, java.lang.String invokerID, ChannelContext channelContext)
          Checks if the user associated to the session sessId can execute the operation opName.
protected  java.lang.Object executeRequest(ChannelContext channelContext)
          Extend this method to perform the actual operation or process
protected  void executeSession(ChannelContext channelContext)
          Extend this method to perform any required application session processing
protected  java.lang.String formatOpContext(Operation oper, ChannelContext channelCtx, java.lang.String csResponseFormat)
          Use reply formatter to format the operation context to string
protected  PresentationHandler getPresentationHandler(ChannelContext channelContext)
          Defalt implementation to get the presentation handler from the registry.
protected  java.lang.String getRequestValue(ChannelContext channelCtx, java.lang.String key)
          Convenience method to get the request data element's value
protected  Context getSessionContext(java.lang.String sessionId, java.lang.String applicationId)
          Get session context It will be either an application session context, an application sub session context or any other predefined parent of the operation context.
protected  java.lang.String getSessionId(ChannelContext aChannelContext)
          Convenience method to dertermine the session id from the channel session
protected  void handleException(ChannelContext channelContext, java.lang.Exception ex)
          Handle the exceptions raised by the request handler Default implementation attempts to invoke the presentation handler to process the reply
protected  void handleException(java.lang.Throwable ex)
          Handle the exceptions raised by the request handler Log the exception to the server trace console if enabled
protected  boolean isNotNull(java.lang.String str)
          check the string is null or not
protected  void preProcessRequest(ChannelContext channelContext)
          Extend this method to perform any initial processing required by the request handler
 void process(ChannelContext aChannelCtx)
          This method will control all the logic of the requestHandler
 void processRequest(ChannelContext channelContext)
          Process the request for a specific channel This is the default flow to process a request.
 void processSessionRequest(ChannelContext channelContext)
          Process the request to establish a session for a specific channel This is the default flow to process a session request.
protected  boolean runInSession(ChannelContext channelContext)
          Convenience method to determine the runInSession value
protected  void setReplyFmt(ChannelContext channelContext, java.lang.String csReplyFormat)
          Set the reply format name
protected  java.lang.String tryToFormat(java.lang.String fmtName, Operation oper, ChannelContext ctx)
          Use reply formatter to format the operation context to string Try to use formatter defined in the operation, if it isn't found, try to use global formatter.
protected  void tryToUnformat(java.lang.String fmtName, java.lang.String requestData, Operation oper)
          Unformat the request data and set the values to operation context.
protected  void unFormatRequest(Operation oper, ChannelContext ctx, java.lang.String csRequestFormat, java.lang.String requestData)
          Unformat the request and set the values to operation context
protected  boolean usingCookies(ChannelContext channelContext)
          Convenience method to determine if cookies are being used to manage the client server session for the specified device type By default using cookies is false
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

errorCode

protected java.lang.String errorCode

javaClientTrace

protected static final java.util.ResourceBundle javaClientTrace
Trace File for NLS


javaClientException

protected static final java.util.ResourceBundle javaClientException
Constructor Detail

DSERequestHandler

public DSERequestHandler()
Method Detail

executeRequest

protected java.lang.Object executeRequest(ChannelContext channelContext)
                                   throws java.lang.Exception
Extend this method to perform the actual operation or process

Parameters:
channelContext - com.ibm.btt.clientserver.ChannelContext
Returns:
com.ibm.btt.base.ServerOperation
Throws:
java.lang.Exception

executeSession

protected void executeSession(ChannelContext channelContext)
                       throws java.lang.Exception
Extend this method to perform any required application session processing

Parameters:
channelContext - com.ibm.btt.clientserver.ChannelContext
Throws:
java.lang.Exception

getPresentationHandler

protected PresentationHandler getPresentationHandler(ChannelContext channelContext)
                                              throws DSENoRegisteredPresentationHandlerException
Defalt implementation to get the presentation handler from the registry.

Parameters:
channelContext - com.ibm.btt.clientserver.ChannelContext
Returns:
com.ibm.btt.clientserver.PresentationHandler
Throws:
DSENoRegisteredPresentationHandlerException

handleException

protected void handleException(ChannelContext channelContext,
                               java.lang.Exception ex)
Handle the exceptions raised by the request handler Default implementation attempts to invoke the presentation handler to process the reply

Parameters:
channelContext - com.ibm.btt.clientserver.ChannelContext
ex - java.lang.Exception

handleException

protected void handleException(java.lang.Throwable ex)
Handle the exceptions raised by the request handler Log the exception to the server trace console if enabled

Parameters:
ex - java.lang.Exception

preProcessRequest

protected void preProcessRequest(ChannelContext channelContext)
                          throws DSEException
Extend this method to perform any initial processing required by the request handler

Parameters:
channelContext - com.ibm.btt.clientserver.ChannelContext
Throws:
DSEException

process

public void process(ChannelContext aChannelCtx)
             throws java.lang.Exception
This method will control all the logic of the requestHandler

Parameters:
aChannelCtx - com.ibm.btt.clientserver.ChannelContext
Throws:
java.lang.Exception

processRequest

public void processRequest(ChannelContext channelContext)
Process the request for a specific channel This is the default flow to process a request. It may generate the following error code during the process: CSS01.

Specified by:
processRequest in interface RequestHandler
Parameters:
channelContext - com.ibm.btt.clientserver.ChannelContext

processSessionRequest

public void processSessionRequest(ChannelContext channelContext)
Process the request to establish a session for a specific channel This is the default flow to process a session request.

Specified by:
processSessionRequest in interface RequestHandler
Parameters:
channelContext - com.ibm.btt.clientserver.ChannelContext

usingCookies

protected boolean usingCookies(ChannelContext channelContext)
Convenience method to determine if cookies are being used to manage the client server session for the specified device type By default using cookies is false

Parameters:
channelContext - com.ibm.btt.clientserver.ChannelContext
Returns:
boolean

runInSession

protected boolean runInSession(ChannelContext channelContext)
Convenience method to determine the runInSession value

Parameters:
channelContext - com.ibm.btt.clientserver.ChannelContext
Returns:
boolean

checkExecutionPermission

protected void checkExecutionPermission(java.lang.String sessionId,
                                        java.lang.String invokerID,
                                        ChannelContext channelContext)
                                 throws ACLException
Checks if the user associated to the session sessId can execute the operation opName. If the user can't then a com.ibm.btt.services.acl.ACLException is thrown.

Parameters:
sessionId -
invokerID -
channelContext -
Throws:
ACLException

unFormatRequest

protected void unFormatRequest(Operation oper,
                               ChannelContext ctx,
                               java.lang.String csRequestFormat,
                               java.lang.String requestData)
                        throws DSEInvalidRequestException,
                               DSEInvalidArgumentException,
                               java.io.IOException,
                               DSEObjectNotFoundException
Unformat the request and set the values to operation context

Parameters:
oper -
ctx -
csRequestFormat -
requestData -
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException
java.io.IOException
DSEObjectNotFoundException

tryToUnformat

protected void tryToUnformat(java.lang.String fmtName,
                             java.lang.String requestData,
                             Operation oper)
                      throws DSEInvalidRequestException,
                             DSEInvalidArgumentException,
                             java.io.IOException
Unformat the request data and set the values to operation context. It first fetch the formatter from operation. If it isn't found, then try use the global formatter

Parameters:
fmtName -
requestData -
oper -
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException
java.io.IOException

formatOpContext

protected java.lang.String formatOpContext(Operation oper,
                                           ChannelContext channelCtx,
                                           java.lang.String csResponseFormat)
                                    throws DSEInvalidRequestException,
                                           DSEInvalidArgumentException,
                                           DSEInvalidClassException,
                                           java.io.IOException,
                                           DSEObjectNotFoundException
Use reply formatter to format the operation context to string

Parameters:
oper -
channelCtx -
csResponseFormat -
Returns:
Throws:
DSEInvalidRequestException
DSEInvalidArgumentException
DSEInvalidClassException
java.io.IOException
DSEObjectNotFoundException

tryToFormat

protected java.lang.String tryToFormat(java.lang.String fmtName,
                                       Operation oper,
                                       ChannelContext ctx)
                                throws DSEInvalidArgumentException,
                                       java.io.IOException,
                                       DSEInvalidClassException,
                                       DSEInvalidRequestException
Use reply formatter to format the operation context to string Try to use formatter defined in the operation, if it isn't found, try to use global formatter.

Parameters:
fmtName -
oper -
ctx -
Returns:
Throws:
DSEInvalidArgumentException
java.io.IOException
DSEInvalidClassException
DSEInvalidRequestException

setReplyFmt

protected void setReplyFmt(ChannelContext channelContext,
                           java.lang.String csReplyFormat)
Set the reply format name

Parameters:
channelContext -
csReplyFormat -

isNotNull

protected boolean isNotNull(java.lang.String str)
check the string is null or not

Parameters:
str -
Returns:

getRequestValue

protected java.lang.String getRequestValue(ChannelContext channelCtx,
                                           java.lang.String key)
                                    throws DSEObjectNotFoundException
Convenience method to get the request data element's value

Parameters:
channelCtx -
key -
Returns:
Throws:
DSEObjectNotFoundException

getSessionId

protected java.lang.String getSessionId(ChannelContext aChannelContext)
Convenience method to dertermine the session id from the channel session

Parameters:
aChannelContext - com.ibm.btt.clientserver.ChannelContext
Returns:
java.lang.String

getSessionContext

protected Context getSessionContext(java.lang.String sessionId,
                                    java.lang.String applicationId)
                             throws DSEInvalidRequestException
Get session context It will be either an application session context, an application sub session context or any other predefined parent of the operation context.

Parameters:
sessionId - java.lang.String
applicationId - java.lang.String
Throws:
DSEInvalidRequestException - There is no context associated with given sessionId or applicationId

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011