© 2001 BEA Systems, Inc.

com.beasys.commerce.axiom.p13n.http
Class Session

com.beasys.commerce.axiom.p13n.http.Session
All Implemented Interfaces:
java.io.Serializable

public class Session
implements java.io.Serializable

The Personalization Server implementation of the Http Session interface.

This object is used by the Personalization Server to get properties on an Http Session in a format understandable to Personalization Core Services such as the Rules Service. Note, we require the request to be passed into many methods since there are cases where we need to look at the request. The getProperty method will look in the HTTP session attributes for the property.

This will use a DefaultSessionFilter to filter out attributes. After loading the session attributes, this will additionally call out to any AttributeLoaders specified by the "p13n.session.loaders" property in weblogiccommerce.properties.

See Also:
Serialized Form

Inner Class Summary
static interface Session.AttributeLoader
          An object which is capable of loading additional attributes into a Session.
 
Constructor Summary
Session()
          Default Constructor
Session(javax.servlet.http.HttpServletRequest request)
          Creates a P13N HTTP Session.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
           
 java.util.Enumeration getAttributeNames()
           
 long getCreationTime()
           
 java.lang.String getId()
          Returns the id of the HttpSession for which this surrogate represents
 long getLastAccessedTime()
           
 int getMaxInactiveInterval()
           
 java.lang.Object getProperty(java.lang.String scopeName, java.lang.String propertyName, ConfigurableEntity successor, java.lang.Object defaultValue)
          Retrieves a property value for the specified scope and key.
 javax.servlet.http.HttpSessionContext getSessionContext()
           
 java.lang.Object getValue(java.lang.String name)
           
 java.lang.String[] getValueNames()
           
 void invalidate()
           
 boolean isNew()
           
 void putValue(java.lang.String name, java.lang.Object val)
           
 void removeAttribute(java.lang.String name)
           
 void removeValue(java.lang.String name)
           
 void setAttribute(java.lang.String name, java.lang.Object val)
           
 void setMaxInactiveInterval(int interval)
           
 

Constructor Detail

Session

public Session()
Default Constructor

Session

public Session(javax.servlet.http.HttpServletRequest request)
Creates a P13N HTTP Session. This object clones the session values provided in the session in the HttpRequest.
Parameters:
session - the HttpServletRequest used to get the Http session values.
Method Detail

getProperty

public java.lang.Object getProperty(java.lang.String scopeName,
                                    java.lang.String propertyName,
                                    ConfigurableEntity successor,
                                    java.lang.Object defaultValue)
Retrieves a property value for the specified scope and key. The getProperty method will first look in the cloned session values for the property. If not found, then it uses the scopeName parameter to find a schema entity for a 'SESSION' schema group name. If found, it uses the default value in the schema.
Parameters:
scopeName - The name of the scope for which the property is sought. The scope is only used if no property is found in the request and we use the scope to look up the default value in the Schema for the request. This parameter can be null.
key - The property name. This name should be "de-qualified" since the creation of this object instance loaded the session values from the current Service Provider for the current request. For example, if the HttpSession has PortalA.frequentFlyer, use frequentFlyer for this parameter.
successor - The successor. Must be null. It is not used in this method and will be ignored.
defaultValue - the default value to return if the property is not found
Returns:
the property value

getCreationTime

public long getCreationTime()

getId

public java.lang.String getId()
Returns the id of the HttpSession for which this surrogate represents
Returns:
The Http Session id, returns null if the id is not valid

getLastAccessedTime

public long getLastAccessedTime()

setMaxInactiveInterval

public void setMaxInactiveInterval(int interval)

getMaxInactiveInterval

public int getMaxInactiveInterval()

getSessionContext

public javax.servlet.http.HttpSessionContext getSessionContext()

getAttribute

public java.lang.Object getAttribute(java.lang.String name)

getValue

public java.lang.Object getValue(java.lang.String name)

getAttributeNames

public java.util.Enumeration getAttributeNames()

getValueNames

public java.lang.String[] getValueNames()

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object val)

putValue

public void putValue(java.lang.String name,
                     java.lang.Object val)

removeAttribute

public void removeAttribute(java.lang.String name)

removeValue

public void removeValue(java.lang.String name)

invalidate

public void invalidate()

isNew

public boolean isNew()

© 2001 BEA Systems, Inc.

Copyright © 2001 BEA Systems, Inc. All Rights Reserved