© 2001 BEA Systems, Inc.

com.beasys.commerce.foundation.pipeline
Interface PipelineSession

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
PipelineSessionExtended

public interface PipelineSession
extends java.io.Serializable

Information about the current customer's session is stored in the PipelineSession. For example the following information about the current customer is stored in PipelineSession.

PipelineSession allows attributes when added, to be scoped. The allowed scopes are:

Note:

See Also:
PipelineConstants

Method Summary
 void clearAttributes()
          Removes all the attributes from the PipelineSession.
 void clearAttributes(int scope)
          Removes all the attributes from the PipelineSession.
 boolean containsAttribute(java.lang.String key)
          Returns true if the given key is present in the PipelineSession.
 boolean containsAttribute(java.lang.String key, int scope)
          Returns true if the given key is present in the PipelineSession.
 java.lang.Object getAttribute(java.lang.String key)
          Gets the named attribute from the PipelineSession.
 java.lang.Object getAttribute(java.lang.String key, int scope)
          Gets the named attribute from the PipelineSession.
 java.util.Hashtable getAttributeMap(int scope)
          Gets the list of all attributes in the given scope as a Hashtable.
 java.util.Enumeration getElements()
          Gets the list of all elements in the PipelineSession.
 java.util.Enumeration getElements(int scope)
          Gets the list of all elements in the PipelineSession.
 java.util.Enumeration getKeys()
          Gets the list of all keys in the PipelineSession.
 java.util.Enumeration getKeys(int scope)
          Gets the list of all keys in the PipelineSession.
 java.lang.Object removeAttribute(java.lang.String key)
          Removes the key and the element from the PipelineSession.
 java.lang.Object removeAttribute(java.lang.String key, int scope)
          Removes the key and the element from the PipelineSession.
 void setAttribute(java.lang.String key, java.lang.Object attribute)
          Adds the named attribute to the PipelineSession.
 void setAttribute(java.lang.String key, java.lang.Object attribute, int scope)
          Adds the named attribute to the PipelineSession.
 void setAttributeMap(java.util.Hashtable attrMap, int scope)
          Sets the given Hashtable to the specified scope.
 

Method Detail

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object attribute)
Adds the named attribute to the PipelineSession. This method adds the key to the PipelineConstants.PIPELINE_SESSION_SCOPE. The supported scopes are:
      PipelineConstants.PIPELINE_SESSION_SCOPE
      PipelineConstants.REQUEST_SCOPE
 
The attributes added using this API are available till the end of the current HttpSession. If the key already exists, then the key is overwritten.
Parameters:
String - the name of the attribute.
Object - the attribute.

setAttribute

public void setAttribute(java.lang.String key,
                         java.lang.Object attribute,
                         int scope)
Adds the named attribute to the PipelineSession. This method adds the key to the given scope. The supported scopes are:
      PipelineConstants.PIPELINE_SESSION_SCOPE
      PipelineConstants.REQUEST_SCOPE
 
If the scope is PipelineConstants.REQUEST_SCOPE the attributes added using this API are available till the end of the current HttpServletRequest. Otherwise the attribute are available till the end of the current HttpSession. If the key already exists, then the key is overwritten.
Parameters:
String - the name of the attribute.
Object - the attribute.
int - the scope of this attribute.

getAttribute

public java.lang.Object getAttribute(java.lang.String key)
Gets the named attribute from the PipelineSession. If the attribute is not present in the PipelineConstants.PIPELINE_SESSION_SCOPE then this will return null.
Parameters:
String - the name of the attribute.
Returns:
Object the attribute value as a Object.

getAttribute

public java.lang.Object getAttribute(java.lang.String key,
                                     int scope)
Gets the named attribute from the PipelineSession. If the attribute is not available in the given scope then this will return null.
Parameters:
String - the name of the attribute.
int - the scope in which to look for this attribute.
Returns:
Object the attribute value as a Object.

getAttributeMap

public java.util.Hashtable getAttributeMap(int scope)
Gets the list of all attributes in the given scope as a Hashtable.
Parameters:
int - scope.
Returns:
Hashtable List of all the attributes in the given scope.

setAttributeMap

public void setAttributeMap(java.util.Hashtable attrMap,
                            int scope)
Sets the given Hashtable to the specified scope.
Parameters:
Hashtable - the attribute map.
int - the scope to which this map is to be set.

getKeys

public java.util.Enumeration getKeys()
Gets the list of all keys in the PipelineSession. Returns an enumeration of all the keys that belong to the PipelineConstants.PIPELINE_SESSION_SCOPE.
Returns:
Enumeration List of all the keys in the PipelineConstants.PIPELINE_SESSION_SCOPE.

getKeys

public java.util.Enumeration getKeys(int scope)
Gets the list of all keys in the PipelineSession. Returns an enumeration of all the keys that belong to the given scope.
Parameters:
int - the scope.
Returns:
Enumeration List of all the keys in the given scope.

getElements

public java.util.Enumeration getElements()
Gets the list of all elements in the PipelineSession. Returns an enumeration of all the elements that belong to the PipelineConstants.PIPELINE_SESSION_SCOPE.
Returns:
Enumeration List of all the elements in the PipelineConstants.PIPELINE_SESSION_SCOPE.

getElements

public java.util.Enumeration getElements(int scope)
Gets the list of all elements in the PipelineSession. Returns an enumeration of all the elements that belong to the given scope.
Parameters:
int - the scope.
Returns:
Enumeration List of all the elements in the given scope.

containsAttribute

public boolean containsAttribute(java.lang.String key)
Returns true if the given key is present in the PipelineSession. If the given key belongs to the PipelineConstants.PIPELINE_SESSION_SCOPE then this method returns true.
Parameters:
String - the name of the attribute to look for.
Returns:
boolean true if key is found in the PipelineConstants.PIPELINE_SESSION_SCOPE.

containsAttribute

public boolean containsAttribute(java.lang.String key,
                                 int scope)
Returns true if the given key is present in the PipelineSession. If the given key belongs in the given scope then this method returns true.
Parameters:
String - the name of the attribute to look for.
int - the scope in which to look for.
Returns:
boolean true if key is found in the given scope.

removeAttribute

public java.lang.Object removeAttribute(java.lang.String key)
Removes the key and the element from the PipelineSession. If the given key is present in the PipelineConstants.PIPELINE_SESSION_SCOPE, then this method removes the key and returns the element. Otherwise returns null.
Parameters:
String - the name of the attribute to be removed.
Returns:
Object the removed element.

removeAttribute

public java.lang.Object removeAttribute(java.lang.String key,
                                        int scope)
Removes the key and the element from the PipelineSession. If the given key is present in the given scope, then this method removes the key and returns the element. Otherwise returns null.
Parameters:
String - the name of the attribute to be removed.
int - the scope in which to look for.
Returns:
Object the removed element.

clearAttributes

public void clearAttributes()
Removes all the attributes from the PipelineSession. Removes all the attributes that belong to the PipelineConstants.PIPELINE_SESSION_SCOPE.

clearAttributes

public void clearAttributes(int scope)
Removes all the attributes from the PipelineSession. Removes all the attributes that belong to the given scope.
Parameters:
int - the scope from which all the attributes are to be removed.

© 2001 BEA Systems, Inc.

Copyright © 2001 BEA Systems, Inc. All Rights Reserved