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.turbine.services.session
Class TurbineSession

    java.lang.Object
      org.apache.turbine.services.session.TurbineSession

    public abstract class TurbineSession

extends Object

This is a conveience class provided to allow access to the SessionService through static methods. The SessionService should ALWAYS be accessed through this class.

Version:
  $Id: TurbineSession.java 1066925 2011-02-03 19:44:37Z ludwig $
Author:
  Quinton McCombs
See Also:
  `SessionService`

Constructor Summary
`TurbineSession()`

Method Summary
`static void` | `addSession(javax.servlet.http.HttpSession session)` Adds a session to the current list.
`static Collection<javax.servlet.http.HttpSession>` | `getActiveSessions()` Gets a list of the active sessions
`static Collection<User>` | `getActiveUsers()` Gets a collection of all user objects representing the users currently logged in.
`static javax.servlet.http.HttpSession` | `getSession(String sessionId)` Gets the HttpSession by the session identifier
`static Collection<javax.servlet.http.HttpSession>` | `getSessionsForUser(User user)` Get a collection of all session on which the given user is logged in.
`static User` | `getUserFromSession(javax.servlet.http.HttpSession session)` Gets the User object of the the specified HttpSession.
`static boolean` | `isUserLoggedIn(User user)` Determines if a given user is currently logged in.
`static void` | `removeSession(javax.servlet.http.HttpSession session)` Removes a session from the current list.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TurbineSession

    public TurbineSession()

Method Detail

### getActiveSessions

    public static Collection<javax.servlet.http.HttpSession> getActiveSessions()

  Gets a list of the active sessions

  Returns:
    List of HttpSession objects

### addSession

    public static void addSession(javax.servlet.http.HttpSession session)

  Adds a session to the current list. This method should only be called by the listener.

  Parameters:
    `session` - Session to add

### removeSession

    public static void removeSession(javax.servlet.http.HttpSession session)

  Removes a session from the current list. This method should only be called by the listener.

  Parameters:
    `session` - Session to remove

### isUserLoggedIn

    public static boolean isUserLoggedIn(User user)

  Determines if a given user is currently logged in. The actual implementation of the User object must implement the equals() method. By default, Torque based objects (liek TurbineUser) have an implementation of equals() that will compare the result of getPrimaryKey().

  Parameters:
    `user` - User to check for
  Returns:
    true if the user is logged in on one of the active sessions.

### getActiveUsers

    public static Collection<User> getActiveUsers()

  Gets a collection of all user objects representing the users currently logged in. This will exclude any instances of anonymous user that Turbine will use before the user actually logs on.

  Returns:
    collection of org.apache.turbine.om.security.User objects

### getUserFromSession

    public static User getUserFromSession(javax.servlet.http.HttpSession session)

  Gets the User object of the the specified HttpSession.

  Parameters:
    `session` -
  Returns:

### getSession

    public static javax.servlet.http.HttpSession getSession(String sessionId)

  Gets the HttpSession by the session identifier

  Parameters:
    `sessionId` -
  Returns:

### getSessionsForUser

    public static Collection<javax.servlet.http.HttpSession> getSessionsForUser(User user)

  Get a collection of all session on which the given user is logged in.

  Parameters:
    `user` - the user
  Returns:
    Collection of HtttSession objects

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 © 2000-2011 The Apache Software Foundation. All Rights Reserved.