org.apache.jetspeed.portlet
Interface PortletSession


Deprecated. since 6.0. Support of the IBM portlet API may be removed in a future release of WebSphere Portal. Use of the Java Portlet API (javax.portlet) is recommended instead.

public interface PortletSession

The PortletSession holds the user-specific data that the portlet needs to personalize the one global portlet instance. Together with the portlet, the portlet session constitutes the concrete portlet instance.

Since:
4.1
See Also:
Portlet

Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Deprecated. Returns the value of the attribute with the given name, or null if no attribute with the given name exists.
 java.util.Enumeration getAttributeNames()
          Deprecated. Returns an enumeration of names of all attributes available to this session.
 long getCreationTime()
          Deprecated. Returns the point of time that this session was created.
 long getLastAccessedTime()
          Deprecated. Returns the point of time that this session was last accessed.
 User getUser()
          Deprecated. use portletRequest.getUser() since version 1.1
 void invalidate()
          Deprecated. This method is inherited from the HttpSession interface, but exhibits a different behavior for a portlet session.
 void removeAttribute(java.lang.String name)
          Deprecated. Removes the attribute with the given name.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Deprecated. Associates an attribute with the given name and value with this session.
 

Method Detail

getUser

User getUser()
Deprecated. use portletRequest.getUser() since version 1.1

Returns the user object. The user object contains useful information about the user and his or her preferences.

If the user has not logged in or does not grant access to the portlet, this method returns null.

Returns:
the user object

getCreationTime

long getCreationTime()
Deprecated. 
Returns the point of time that this session was created. Essentially, this will also be the time when the user logged in. The time is returned as the number of milliseconds since January 1, 1970 GMT.

Returns:
the time of creation

getLastAccessedTime

long getLastAccessedTime()
Deprecated. 
Returns the point of time that this session was last accessed. The time is returned as the number of milliseconds since January 1, 1970 GMT.

Returns:
the time of the last access

setAttribute

void setAttribute(java.lang.String name,
                  java.lang.Object value)
Deprecated. 
Associates an attribute with the given name and value with this session. If a portlet needs to communicate information to embedded servlets or JSP, this methods can used carry the information along.

The portlet provider should take care that the the namespace of attribute names is not unnecessarily polluted. It is recommended to prefix all attributes the package and class name of the portlet that makes use of this method.

Parameters:
name - the attribute name
value - the attribute value

getAttribute

java.lang.Object getAttribute(java.lang.String name)
Deprecated. 
Returns the value of the attribute with the given name, or null if no attribute with the given name exists.

Parameters:
name - the attribute name
Returns:
the attribute value

getAttributeNames

java.util.Enumeration getAttributeNames()
Deprecated. 
Returns an enumeration of names of all attributes available to this session. This method returns an empty enumeration if the session has no attributes available to it.

Returns:
an enumeration of attribute names

removeAttribute

void removeAttribute(java.lang.String name)
Deprecated. 
Removes the attribute with the given name.

Parameters:
name - the name of attribute to be removed

invalidate

void invalidate()
Deprecated. 
This method is inherited from the HttpSession interface, but exhibits a different behavior for a portlet session. It is recommended not to use this method on a portlet session.

This method removes all session attributes of the portlet and calls the PortletSessionListener.logout method, but does not actually invalidate the session object; later access to the session is not guaranteed to cause an exception. Within the same user session, the login and logout methods of the portlet will not be called again, even if a new PortletSession is created.