com.ibm.commerce.browseradapter
Class HttpBrowserAdapter

java.lang.Object
  |
  +--com.ibm.commerce.adapter.AbstractHttpAdapter
        |
        +--com.ibm.commerce.browseradapter.HttpBrowserAdapter
All Implemented Interfaces:
DeviceFormatAdapter, HttpAdapter, HttpAdapterFactory

public class HttpBrowserAdapter
extends AbstractHttpAdapter

HttpBrowserAdapter is the device format adapter that is responsible for handling http requests that comes from a browser.


Fields inherited from class com.ibm.commerce.adapter.AbstractHttpAdapter
desc, req, reqObj, requestProperties, resp, sessionContext
 
Fields inherited from interface com.ibm.commerce.adapter.HttpAdapter
COPYRIGHT, DEVFMTID_BROWSER, DEVFMTNAME_BROWSER, DEVFMTNAME_IMODE, DEVFMTTYP_BROWSER, DEVFMTTYP_PVCDEVICE, DEVFMTTYP_XMLFMT, DEVFMTTYPID_BROWSER, DEVFMTTYPID_PVC, DEVFMTTYPID_XML
 
Fields inherited from interface com.ibm.commerce.adapter.HttpAdapterFactory
COPYRIGHT
 
Constructor Summary
HttpBrowserAdapter()
          HttpDeviceBrowser default constructor.
 
Method Summary
 boolean checkDeviceFormat(com.ibm.commerce.browseradapter.HttpServletRequest req, TypedProperty prop)
          This method checks whether the request can be handled by this adapter.
 HttpAdapter createAdapter(com.ibm.commerce.browseradapter.HttpServletRequest _req, com.ibm.commerce.browseradapter.HttpServletResponse _resp, TypedProperty _prop)
          This method returns an instance of the adapter if the request has the correct format
 HttpSessionContext createSessionContext()
          Creates an HttpSessionContext for the browser.
 boolean getCacheObjectID(CommandContext commandContext, com.ibm.commerce.browseradapter.CacheObjectID aCacheObjectID, TypedProperty parm)
          Returns true if current request can be cached.
 java.lang.String getDocumentPathName(java.lang.String name)
          Gets the actual output document name based on a base document name.
 SessionContext getSessionContext()
          Gets the session context.
 boolean httpsRedirection()
          Returns true if secure command needs to be run under https.
 void postInvokeCommand(CommandContext commandContext)
          This method implements adapter specific function after the execution of a command.
 boolean preInvokeCommand(CommandContext commandContext)
          This method implements adapter specific function before the execution of a command.
 com.ibm.commerce.browseradapter.HttpControllerRequestObject preprocessRequest()
          Builds up the HttpControllerRequest object based on current HttpRequest and executes some session management specific security checks.
 void processCacheAdd(CommandContext aCommandContext, com.ibm.commerce.browseradapter.CacheObjectID aCacheObjectID)
          Adds the request result to the cache.
 boolean processCacheGet(CommandContext aCommandContext, com.ibm.commerce.browseradapter.CacheObjectID aCacheObjectID)
          Retrieves the request result from the cache.
static HttpBrowserAdapter singleton()
          Returns a singleton instance of this object.
 
Methods inherited from class com.ibm.commerce.adapter.AbstractHttpAdapter
displayGenericErrorView, getAdapterDesc, getDefaultDeviceFormatId, getDeviceFormatId, getDeviceFormatName, getDeviceFormatType, getDeviceFormatTypeId, getRequest, getRequestName, getRequestProperties, getResponse, httpRedirection, initFactory, isEnabled, processErrorResponse, processRequest, processResponse, setAdapterDesc, setDefaultDeviceFormatId, setDeviceFormatClass, setDeviceFormatId, setDeviceFormatName, setDeviceFormatType, setDeviceFormatTypeId, setRequest, setRequestProperties, setResponse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.commerce.adapter.HttpAdapterFactory
checkDeviceFormat, createAdapter
 

Constructor Detail

HttpBrowserAdapter

public HttpBrowserAdapter()
HttpDeviceBrowser default constructor.
Method Detail

checkDeviceFormat

public boolean checkDeviceFormat(com.ibm.commerce.browseradapter.HttpServletRequest req,
                                 TypedProperty prop)
This method checks whether the request can be handled by this adapter. This method always returns true for the HttpBrowserAdapter.

Parameters:
req - HttpServletRequest
prop - TypedProperties
Returns:
boolean - true if the adapter can handle this request - false if the adapter cannot handle this request.

createAdapter

public HttpAdapter createAdapter(com.ibm.commerce.browseradapter.HttpServletRequest _req,
                                 com.ibm.commerce.browseradapter.HttpServletResponse _resp,
                                 TypedProperty _prop)
This method returns an instance of the adapter if the request has the correct format

createSessionContext

public HttpSessionContext createSessionContext()
                                        throws ECException
Creates an HttpSessionContext for the browser.

getCacheObjectID

public boolean getCacheObjectID(CommandContext commandContext,
                                com.ibm.commerce.browseradapter.CacheObjectID aCacheObjectID,
                                TypedProperty parm)
Returns true if current request can be cached.

getDocumentPathName

public java.lang.String getDocumentPathName(java.lang.String name)
Gets the actual output document name based on a base document name.
Overrides:
getDocumentPathName in class AbstractHttpAdapter
Following copied from class: com.ibm.commerce.adapter.AbstractHttpAdapter
Returns:
String - the actual document path name

getSessionContext

public SessionContext getSessionContext()
                                 throws ECException
Gets the session context.
Returns:
SessionContext

httpsRedirection

public boolean httpsRedirection()
Returns true if secure command needs to be run under https. This methd always returns true for HttpBrowserAdapter.

postInvokeCommand

public void postInvokeCommand(CommandContext commandContext)
This method implements adapter specific function after the execution of a command.

Parameters:
commandContext - CommandContext - the command context associated with the command.
Throws:
ECException -  

preInvokeCommand

public boolean preInvokeCommand(CommandContext commandContext)
This method implements adapter specific function before the execution of a command. Also executes session management security checks.

Parameters:
commandContext - CommandContext - the command context associated with the command.
Throws:
ECException -  

preprocessRequest

public com.ibm.commerce.browseradapter.HttpControllerRequestObject preprocessRequest()
Builds up the HttpControllerRequest object based on current HttpRequest and executes some session management specific security checks.
Overrides:
preprocessRequest in class AbstractHttpAdapter

processCacheAdd

public void processCacheAdd(CommandContext aCommandContext,
                            com.ibm.commerce.browseradapter.CacheObjectID aCacheObjectID)
Adds the request result to the cache.

processCacheGet

public boolean processCacheGet(CommandContext aCommandContext,
                               com.ibm.commerce.browseradapter.CacheObjectID aCacheObjectID)
Retrieves the request result from the cache.

singleton

public static HttpBrowserAdapter singleton()
Returns a singleton instance of this object.