IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

com.ibm.btt.cs.rest.resource
Class BaseResource

java.lang.Object
  extended by com.ibm.btt.cs.rest.resource.BaseResource
Direct Known Subclasses:
FlowResource, OperationResource, SessionResource

public class BaseResource
extends java.lang.Object

The base resource class with some common methods


Constructor Summary
BaseResource()
           
 
Method Summary
 void checkNavigationAuthorization(javax.servlet.http.HttpServletRequest req, java.lang.String processorName, java.lang.String procId, java.lang.String nextEvent)
           
 void checkOperationAuthorization(javax.servlet.http.HttpServletRequest req, java.lang.String operationName)
           
 void checkProcessorAuthorization(javax.servlet.http.HttpServletRequest req, java.lang.String processorName, java.lang.String procId)
           
 void checkRequestAuthorization(javax.servlet.http.HttpServletRequest req)
           
 void filterRequest(javax.servlet.http.HttpServletRequest req, ChannelContext cc, Context ctx, java.lang.Object requestData)
          Filter the request input data using specified SecurityAdvice.
 void filterResponse(javax.servlet.http.HttpServletRequest req, ChannelContext cc, Context ctx, java.lang.Object responseData)
          Filter the response data using specified SecurityAdvice.
 JSONArray getCrossFieldErrorMessages(Context ctx)
          Retrieve the cross fields validation error messages from specified Context
 SecurityAdvice getSecurityAdvice()
          Initialize SecurityDelegate from btt.xml configuration for REST channel
 JSONArray getSingleFieldErrorMessages(Context ctx)
          Retrieve the validation error message of all single field from specified Context
 boolean validateContext(Context ctx, KeyedCollection kc, java.lang.String convType, boolean ignoreContextTable)
          Validate new context data against the context, return true for valid, return false for any mismatch, error or exceptions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseResource

public BaseResource()
Method Detail

validateContext

public boolean validateContext(Context ctx,
                               KeyedCollection kc,
                               java.lang.String convType,
                               boolean ignoreContextTable)
                        throws DSEObjectNotFoundException,
                               DSEInvalidArgumentException,
                               DSEInvalidRequestException,
                               java.lang.CloneNotSupportedException
Validate new context data against the context, return true for valid, return false for any mismatch, error or exceptions. Note, this does not do cross fields validation.

Parameters:
ctx - the context
kc - the data to be validated
convType - the conversion type
Returns:
Throws:
DSEObjectNotFoundException
DSEInvalidArgumentException
java.lang.CloneNotSupportedException
DSEInvalidRequestException

getCrossFieldErrorMessages

public JSONArray getCrossFieldErrorMessages(Context ctx)
                                     throws DSEObjectNotFoundException
Retrieve the cross fields validation error messages from specified Context

Parameters:
ctx - the context containing any validation errors messages
Returns:
Throws:
DSEObjectNotFoundException

getSingleFieldErrorMessages

public JSONArray getSingleFieldErrorMessages(Context ctx)
                                      throws DSEInvalidRequestException,
                                             DSEObjectNotFoundException,
                                             JSONException
Retrieve the validation error message of all single field from specified Context

Parameters:
ctx - the context containing validation messages
Returns:
Throws:
DSEInvalidRequestException
DSEObjectNotFoundException
JSONException

getSecurityAdvice

public SecurityAdvice getSecurityAdvice()
Initialize SecurityDelegate from btt.xml configuration for REST channel

Returns:

checkRequestAuthorization

public void checkRequestAuthorization(javax.servlet.http.HttpServletRequest req)
                               throws ForbiddenException,
                                      UnauthorizedException
Parameters:
req -
Throws:
ForbiddenException
UnauthorizedException

checkOperationAuthorization

public void checkOperationAuthorization(javax.servlet.http.HttpServletRequest req,
                                        java.lang.String operationName)
                                 throws ForbiddenException,
                                        UnauthorizedException
Parameters:
req -
operationName -
Throws:
ForbiddenException
UnauthorizedException

checkProcessorAuthorization

public void checkProcessorAuthorization(javax.servlet.http.HttpServletRequest req,
                                        java.lang.String processorName,
                                        java.lang.String procId)
                                 throws ForbiddenException,
                                        UnauthorizedException
Parameters:
req -
processorName -
procId -
Throws:
ForbiddenException
UnauthorizedException

checkNavigationAuthorization

public void checkNavigationAuthorization(javax.servlet.http.HttpServletRequest req,
                                         java.lang.String processorName,
                                         java.lang.String procId,
                                         java.lang.String nextEvent)
                                  throws ForbiddenException,
                                         UnauthorizedException
Parameters:
req -
processorName -
procId -
nextEvent -
Throws:
ForbiddenException
UnauthorizedException

filterRequest

public void filterRequest(javax.servlet.http.HttpServletRequest req,
                          ChannelContext cc,
                          Context ctx,
                          java.lang.Object requestData)
Filter the request input data using specified SecurityAdvice. Any of the parameters may be null.

Parameters:
req - the original HttpServletRequest
cc - the BTT ChannelContext dealing with this request
ctx - the Context of the session, operation or processor
requestData - the payload of the request, it would be a JSON object of POST request

filterResponse

public void filterResponse(javax.servlet.http.HttpServletRequest req,
                           ChannelContext cc,
                           Context ctx,
                           java.lang.Object responseData)
Filter the response data using specified SecurityAdvice. Any of the parameters may be null.

Parameters:
req - the original HttpServletRequest producing the response
cc - the ChannelContext dealing with the request and response
ctx - the Context of session, operation or processor
responseData - the JSON data to be returned to client

IBM WebSphere Multichannel Bank Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2011