Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.jetspeed.portlet
Interface PortletSession

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 virtual instance of the portlet.

Author:
  Thomas F. Boehme
See Also:
  `Portlet`

Method Summary
`java.lang.Object` | `getAttribute(java.lang.String name)` Returns the value of the attribute with the given name, or `null` if no attribute with the given name exists.
`java.util.Enumeration` | `getAttributeNames()` Returns an enumeration of names of all attributes available to this session.
`long` | `getCreationTime()` Returns the point of time that this session was created.
`long` | `getLastAccessedTime()` Returns the point of time that this session was last accessed.
`User` | `getUser()` Returns the user object.
`void` | `removeAttribute(java.lang.String name)` Removes the attribute with the given name.
`void` | `setAttribute(java.lang.String name, java.lang.Object value)` Associates an attribute with the given name and value with this session.

Method Detail

### getUser

    public User getUser()

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

  Returns:
    the user profile

### getCreationTime

    public long getCreationTime()

  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

    public long getLastAccessedTime()

  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

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

  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

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

  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

    public java.util.Enumeration getAttributeNames()

  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

    public void removeAttribute(java.lang.String name)

  Removes the attribute with the given name.

  Parameters:
    `name` - the name of attribute to be removed

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2002 Apache Software Foundation. All Rights Reserved.