public final class SessionHelper
extends java.lang.Object
When coding a new WebSphere Commerce portlet event handler, you need to be aware of a number of things. There is additional runtime information that needs to be gathered for use with the WebSphere Commerce service client library. When calling a client library, two mandatory objects are required - a business context object and the authentication callback handler.
This portlet session helper is designed to store and retrieve a business context object and authentication callback handler object in the portlet session.
Modifier and Type | Method and Description |
---|---|
static BusinessContextType | getBusinessContextType(javax.portlet.PortletRequest portletRequest, java.lang.String contextKey)
Retrieves the context object from session using the given context key.
|
static java.lang.String | getBusinessContextTypeValue(BusinessContextType businessContextType, java.lang.String name)
Retrieves the value of the given name in the business context object.
|
static javax.security.auth.callback.CallbackHandler | getCallbackHandler(javax.portlet.PortletRequest portletRequest, java.lang.String contextKey)
Retrieves a copy of the callback handler object from the session using the given context key.
|
static java.lang.String | getContextKey(javax.portlet.PortletRequest portletRequest)
Gets the context key for storing the portlet request object into the session.
|
static javax.portlet.PortletSession | getSession(javax.portlet.PortletRequest portletRequest)
Returns the portlet session from the given portlet request.
|
static java.lang.String | getStoreId(javax.portlet.PortletRequest portletRequest)
Searches for the storeId sequentially from the portlet request, business context objects in the session, and the default context setting in the portlet preference.
|
static void | setBusinessContextType(javax.portlet.PortletRequest portletRequest, java.lang.String contextKey, BusinessContextType businessContextType)
Stores the given context object into the session using the context key as the identifier.
|
static void | setCallbackHandler(javax.portlet.PortletRequest portletRequest, java.lang.String contextKey, javax.security.auth.callback.CallbackHandler callbackHandler)
Stores the given callback handler into the session using the context key as identifier.
|
public static javax.portlet.PortletSession getSession(javax.portlet.PortletRequest portletRequest)
public static java.lang.String getContextKey(javax.portlet.PortletRequest portletRequest)
public static java.lang.String getStoreId(javax.portlet.PortletRequest portletRequest)
public static java.lang.String getBusinessContextTypeValue(BusinessContextType businessContextType, java.lang.String name)
public static BusinessContextType getBusinessContextType(javax.portlet.PortletRequest portletRequest, java.lang.String contextKey)
public static void setBusinessContextType(javax.portlet.PortletRequest portletRequest, java.lang.String contextKey, BusinessContextType businessContextType)
public static javax.security.auth.callback.CallbackHandler getCallbackHandler(javax.portlet.PortletRequest portletRequest, java.lang.String contextKey)
public static void setCallbackHandler(javax.portlet.PortletRequest portletRequest, java.lang.String contextKey, javax.security.auth.callback.CallbackHandler callbackHandler)