com.ibm.commerce.programadapter
Class ProgramAdapter

com.ibm.commerce.programadapter.ProgramAdapter

public class ProgramAdapter

The Program Adapter that can handle generic request objects.


Field Summary
static java.lang.String _STR_CreateAdapter
           
static java.lang.String _STR_InitFactory
           
static java.lang.String _STR_SetCommandProperties
           
static java.lang.String _STR_ThisClass
           
static java.lang.String _STR_ValidateDeviceFormat
           
 
Constructor Summary
ProgramAdapter()
          NonHttpProgramAdapter constructor.
 
Method Summary
 boolean checkDeviceFormat(java.lang.Object req, TypedProperty prop)
          Return true if the input request can be processed by this adapter.
 com.ibm.commerce.adapter.nonhttp.NonHttpAdapter createAdapter(java.lang.Object request, java.lang.Object response, TypedProperty param)
          This method returns an instance of this adapter if the request has the format defined by this adapter.
 void initFactory(org.w3c.dom.Element node)
          initialize the Adapter factory based on the informtion defined in the dom node
 boolean preInvokeCommand(CommandContext commandContext)
          This method implements adapter specific function before the execution of a command.
 boolean processResponse(CommandContext commandContext, TypedProperty resProp)
          This method is called by the web controller after it has successfully finished the execution of the request.
 void setCommandProperties(CommandProperty cmdProp)
          Sets the CommandProperty of the adapter.
 CommandProperty validateDeviceFormat(java.lang.Object req)
          Return true if the input request can be processed by this adapter.
 

Field Detail

_STR_CreateAdapter

public static final java.lang.String _STR_CreateAdapter

_STR_InitFactory

public static final java.lang.String _STR_InitFactory

_STR_SetCommandProperties

public static final java.lang.String _STR_SetCommandProperties

_STR_ThisClass

public static final java.lang.String _STR_ThisClass

_STR_ValidateDeviceFormat

public static final java.lang.String _STR_ValidateDeviceFormat
Constructor Detail

ProgramAdapter

public ProgramAdapter()
NonHttpProgramAdapter constructor.
Method Detail

checkDeviceFormat

public boolean checkDeviceFormat(java.lang.Object req,
                                 TypedProperty prop)
Return true if the input request can be processed by this adapter.

Returns:
boolean - true if this request can be processed by this adapter false if this request cannot be processed by this adapter

createAdapter

public com.ibm.commerce.adapter.nonhttp.NonHttpAdapter createAdapter(java.lang.Object request,
                                                                     java.lang.Object response,
                                                                     TypedProperty param)
This method returns an instance of this adapter if the request has the format defined by this adapter. This method should first call the checkDeviceFormat() method. If it returns true, then it will instantiate an instance of this adapter. The adapter instance returned will be initialized with request, response and request properties initialized.

Parameters:
request - HttpServletRequest
response - HttpServletResponse
param - TypedProperty - request parameters

Returns:
HttpAdapter - an instance of this adapter if the request can be processed by this adapter - null if this request cannot be processed by this adapter

initFactory

public void initFactory(org.w3c.dom.Element node)
                 throws java.lang.Exception
initialize the Adapter factory based on the informtion defined in the dom node

preInvokeCommand

public boolean preInvokeCommand(CommandContext commandContext)
                         throws ECException
This method implements adapter specific function before the execution of a command.
Parameters:
commandContext - CommandContext - the command context associated with the command.
Throws:
ECException -  

processResponse

public boolean processResponse(CommandContext commandContext,
                               TypedProperty resProp)
                        throws ECException
This method is called by the web controller after it has successfully finished the execution of the request. The web controller will execute the view task associated with the command if this method returns true.
Parameters:
respProperties - TypedProperty - response properties returned by the command.
Returns:
boolean - true if the view task is to be executed by the web controller - false if there is no need to execute the view task

setCommandProperties

public void setCommandProperties(CommandProperty cmdProp)
Sets the CommandProperty of the adapter.
Parameters:
cmdProp - CommandProperty

validateDeviceFormat

public CommandProperty validateDeviceFormat(java.lang.Object req)
Return true if the input request can be processed by this adapter.

Returns:
CommandProperty - an instance of CommandProperty if this request can be processed by this adapter null if this request cannot be processed by this adapter