com.ibm.commerce.browseradapter
Class HttpSessionContext

java.lang.Object
  |
  +--com.ibm.commerce.browseradapter.HttpSessionContext
All Implemented Interfaces:
SessionContext

public class HttpSessionContext
extends java.lang.Object
implements SessionContext

This is a container for session information belonging to current request.


Field Summary
static java.lang.String ERR_INVALID_X509CERT
           
static java.lang.Long GENERIC_USER_ID
           
 
Constructor Summary
HttpSessionContext(com.ibm.commerce.browseradapter.HttpServletRequest req, com.ibm.commerce.browseradapter.HttpServletResponse res, TypedProperty typedProperty)
          Default constructor.
 
Method Summary
 void commit()
          Commits the session data.
 com.ibm.commerce.server.WCSCookie getCookie()
          Returns the WCSCookie class containing the session management cookie.
 java.lang.Object getExtendedSessionData(java.lang.String strParamName)
          Gets an extended session data, asociated with specified name, for current user.
protected  int getHierarchyChange()
          Returns numeric value identifying the user identity change during the request.
 SessionData getSessionData()
          Returns the session data object asociated with current request
 java.lang.String getUniqueSessionTag()
          Gets the unique session tag.
 java.lang.Long getValidUserId()
          Gets the validated user Id.
 java.lang.Long handleSingleSignOn(java.lang.Long lExistingUserId, com.ibm.commerce.browseradapter.HttpServletRequest req)
          Returns userId of the user who has been identified in LTPA token or null if LTPA token does not correspond to any user.
 java.lang.Long handleX509User(java.lang.Long lExistingUserId, com.ibm.commerce.browseradapter.HttpServletRequest req)
           
protected  void initializeInstanceVariables(com.ibm.commerce.browseradapter.HttpServletRequest req, com.ibm.commerce.browseradapter.HttpServletResponse res, TypedProperty typedProperty)
          Initializes all instance variables
protected  void readExtendedSessionData()
          Reads an extended session data
 void rollback()
          Rollback previously set session data.
 void setExtendedSessionData(java.lang.String strParamName, java.lang.Object oParamVal)
          Sets an extended session data.
 void setSessionData(SessionData sessionData)
          Sets the base session data.
 void setUniqueSessionTag(java.lang.String strSessionTag)
          Sets the unique session tag.
 boolean validateX509Attribute(java.lang.String strAttributeName, int nLength, boolean bNullable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ERR_INVALID_X509CERT

public static final java.lang.String ERR_INVALID_X509CERT

GENERIC_USER_ID

public static final java.lang.Long GENERIC_USER_ID
Constructor Detail

HttpSessionContext

public HttpSessionContext(com.ibm.commerce.browseradapter.HttpServletRequest req,
                          com.ibm.commerce.browseradapter.HttpServletResponse res,
                          TypedProperty typedProperty)
                   throws ECSystemException
Default constructor.
Method Detail

commit

public void commit()
            throws ECSystemException
Commits the session data. Processes all session management functions needed at the end of the request.
Specified by:
commit in interface SessionContext
Following copied from interface: com.ibm.commerce.adapter.SessionContext
Throws:
ECSystemException -  

getCookie

public com.ibm.commerce.server.WCSCookie getCookie()
Returns the WCSCookie class containing the session management cookie.

getExtendedSessionData

public java.lang.Object getExtendedSessionData(java.lang.String strParamName)
Gets an extended session data, asociated with specified name, for current user.
Specified by:
getExtendedSessionData in interface SessionContext
Following copied from interface: com.ibm.commerce.adapter.SessionContext
Parameters:
strParamName - String - name of extended session data
Returns:
String - value of extended session data

getHierarchyChange

protected int getHierarchyChange()
Returns numeric value identifying the user identity change during the request. The value -1,0,1 corresponds to logoff, no change, logon action.
Parameters:
i - java.lang.Long
f - java.lang.Long
Returns:
int

getSessionData

public SessionData getSessionData()
Returns the session data object asociated with current request

Specified by:
getSessionData in interface SessionContext
Returns:
SessionData

getUniqueSessionTag

public java.lang.String getUniqueSessionTag()
Gets the unique session tag.

Specified by:
getUniqueSessionTag in interface SessionContext
Returns:
String - session tag

getValidUserId

public java.lang.Long getValidUserId()
                              throws ECSystemException
Gets the validated user Id.

Specified by:
getValidUserId in interface SessionContext
Returns:
Long - the user Id
Throws:
ECSystemException -  

handleSingleSignOn

public java.lang.Long handleSingleSignOn(java.lang.Long lExistingUserId,
                                         com.ibm.commerce.browseradapter.HttpServletRequest req)
                                  throws ECSystemException
Returns userId of the user who has been identified in LTPA token or null if LTPA token does not correspond to any user.

Returns:
Long

handleX509User

public java.lang.Long handleX509User(java.lang.Long lExistingUserId,
                                     com.ibm.commerce.browseradapter.HttpServletRequest req)
                              throws ECSystemException

initializeInstanceVariables

protected void initializeInstanceVariables(com.ibm.commerce.browseradapter.HttpServletRequest req,
                                           com.ibm.commerce.browseradapter.HttpServletResponse res,
                                           TypedProperty typedProperty)
Initializes all instance variables

readExtendedSessionData

protected void readExtendedSessionData()
Reads an extended session data

Parameters:
strParamName - String - name of extended session data
Returns:
Object - value of extended session data

rollback

public void rollback()
Rollback previously set session data.

Specified by:
rollback in interface SessionContext
Throws:
ECSystemException -  

setExtendedSessionData

public void setExtendedSessionData(java.lang.String strParamName,
                                   java.lang.Object oParamVal)
Sets an extended session data.

Specified by:
setExtendedSessionData in interface SessionContext
Parameters:
strParamName - String - session data name
oParamValue - Object - session data value
Throws:
ECException -  

setSessionData

public void setSessionData(SessionData sessionData)
                    throws ECSystemException
Sets the base session data.

Specified by:
setSessionData in interface SessionContext
Throws:
ECSystemException -  

setUniqueSessionTag

public void setUniqueSessionTag(java.lang.String strSessionTag)
                         throws ECException
Sets the unique session tag.

Specified by:
setUniqueSessionTag in interface SessionContext
Parameters:
strSessionTag - String - session specific tag
Throws:
ECException -  

validateX509Attribute

public boolean validateX509Attribute(java.lang.String strAttributeName,
                                     int nLength,
                                     boolean bNullable)
                              throws ECSystemException