com.sapportals.portal.prt.component
Interface IPortalComponentSession


public interface IPortalComponentSession

The IPortalComponentSession is the portal component's view on the servlet session. All objects stored in the Portal Component Session will be stored exclusively for the triple consisting of the Portal Component, the User id and the assigned scope. The available scopes are defined below. The lifetime of the shared session that is maintained by the portal environment should be determined by the portal setup only!
Note: The Portal Component Session as retrieved from an implementation of IPortalComponentRequest is only valid while procession of a request in a service call to an implementation of IPortalComponent. Do not keep a reference to an implementation of IPortalComponentSession between requests.


Field Summary
static short SCOPE_COMPONENT
          This defines the attribute scope to be on the Portal Component.
static short SCOPE_CONTEXT
          This defines the attribute scope to be on the Component Context.
static short SCOPE_UNIQUE
          This defines the attribute scope to be on the Portal Object Model node path plus the root context name.
 
Method Summary
 javax.servlet.http.HttpSession getHttpSession()
          get a reference to the main servlets session.
 java.lang.Object getValue(java.lang.String name)
          retrieve an object from this session.
 java.lang.Object getValue(java.lang.String name, short scope)
          retrieve an object from this session
 void putValue(java.lang.String name, java.lang.Object value)
          attach an object to this session.
 void putValue(java.lang.String name, java.lang.Object value, short scope)
          attach an object to this session
 void removeValue(java.lang.String name)
          remove an object from this session
 void removeValue(java.lang.String name, short scope)
          remove an object from this session.
 

Field Detail

SCOPE_UNIQUE

public static final short SCOPE_UNIQUE
This defines the attribute scope to be on the Portal Object Model node path plus the root context name. This is the most restrictive sharing policy.

SCOPE_CONTEXT

public static final short SCOPE_CONTEXT
This defines the attribute scope to be on the Component Context. Many Component Contexts can share one Portal Component

SCOPE_COMPONENT

public static final short SCOPE_COMPONENT
This defines the attribute scope to be on the Portal Component.
Method Detail

getHttpSession

public javax.servlet.http.HttpSession getHttpSession()
get a reference to the main servlets session.

Note: This method should be used only if absolutely necessary to find out about the servlets session


putValue

public void putValue(java.lang.String name,
                     java.lang.Object value)
attach an object to this session. This is equivalent to a call of putValue(name, value, SCOPE_UNIQUE).
Parameters:
name - An identifier of the object
value - An object to be held

putValue

public void putValue(java.lang.String name,
                     java.lang.Object value,
                     short scope)
attach an object to this session
Parameters:
name - An identifier of the object
value - An object to be held
scope - The scope of the name, as given by the constants SCOPE_UNIQUE, SCOPE_CONTEXT, and SCOPE_COMPONENT.

getValue

public java.lang.Object getValue(java.lang.String name)
retrieve an object from this session. This is equivalent to a call of getValue(name,SCOPE_UNIQUE).
Parameters:
name - An identifier of the object
Returns:
The held object or null if not present.

getValue

public java.lang.Object getValue(java.lang.String name,
                                 short scope)
retrieve an object from this session
Parameters:
name - An identifier of the object
scope - The scope of the name, as given by the constants SCOPE_UNIQUE, SCOPE_CONTEXT, and SCOPE_COMPONENT.
Returns:
The held object or null if not present.

removeValue

public void removeValue(java.lang.String name)
remove an object from this session
Parameters:
name - An identifier of the object

removeValue

public void removeValue(java.lang.String name,
                        short scope)
remove an object from this session. This is equivalent to a call of getValue(name,SCOPE_UNIQUE).
Parameters:
scope - The scope of the name, as given by the constants SCOPE_UNIQUE, SCOPE_CONTEXT, and SCOPE_COMPONENT.
name - An identifier of the object