|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.turbine.services.session.SessionTool
public class SessionTool
A pull tool for accessing the SessionService from a velocity template.
Constructor Summary | |
---|---|
SessionTool()
|
Method Summary | |
---|---|
void |
addSession(javax.servlet.http.HttpSession session)
Adds a session to the current list. |
Collection<javax.servlet.http.HttpSession> |
getActiveSessions()
Gets a list of the active sessions |
Collection<User> |
getActiveUsers()
Gets a collection of all user objects representing the users currently logged in. |
Collection<javax.servlet.http.HttpSession> |
getSessionsForUser(User user)
Get a collection of all session on which the given user is logged in. |
User |
getUserFromSession(javax.servlet.http.HttpSession session)
Gets the User object of the the specified HttpSession. |
void |
init(Object o)
Initialize the application tool. |
boolean |
isUserLoggedIn(User user)
Determines if a given user is currently logged in. |
void |
refresh()
Refresh the application tool. |
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 |
---|
public SessionTool()
Method Detail |
---|
public void init(Object o)
ApplicationTool
It is possible that session scope tools will be initialized with a null
User
object. This happens when the first request on a
session happens to the be login action.
If your session tool depends on having a User
object, you
should look at implementing the RunDataApplicationTool
interface
instead.
init
in interface ApplicationTool
o
- initialization datapublic void refresh()
ApplicationTool
refresh
in interface ApplicationTool
public Collection<javax.servlet.http.HttpSession> getActiveSessions()
public void addSession(javax.servlet.http.HttpSession session)
session
- Session to addpublic void removeSession(javax.servlet.http.HttpSession session)
session
- Session to removepublic boolean isUserLoggedIn(User user)
user
- User to check for
public Collection<User> getActiveUsers()
public User getUserFromSession(javax.servlet.http.HttpSession session)
session
-
public Collection<javax.servlet.http.HttpSession> getSessionsForUser(User user)
user
- the user
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |