public class TurbineSessionService extends TurbineBaseService implements SessionService
web.xml
deployment descriptor as follows:
<listener> <listener-class> org.apache.turbine.session.SessionListener </listener-class> </listener>
SessionListener
configuration, name, serviceBroker
initableBroker, isInitialized
SERVICE_NAME
Constructor and Description |
---|
TurbineSessionService() |
Modifier and Type | Method and Description |
---|---|
void |
addSession(HttpSession session)
Adds a session to the current list.
|
Collection<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.
|
HttpSession |
getSession(String sessionId)
Gets the HttpSession by the session identifier
|
Collection<HttpSession> |
getSessionsForUser(User user)
Get a collection of all session on which the given user
is logged in.
|
User |
getUserFromSession(HttpSession session)
Gets the User object of the the specified HttpSession.
|
void |
init()
Initializes the service
|
boolean |
isUserLoggedIn(User user)
Determines if a given user is currently logged in.
|
void |
removeSession(HttpSession session)
Removes a session from the current list.
|
void |
shutdown()
Returns to uninitialized state.
|
init, init
getConfiguration, getName, getProperties, getServiceBroker, setName, setServiceBroker
getInit, getInitableBroker, setInit, setInitableBroker
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConfiguration, getName, getProperties, setName, setServiceBroker
getInit, init, setInitableBroker
public TurbineSessionService()
public Collection<HttpSession> getActiveSessions()
getActiveSessions
in interface SessionService
HttpSession
objects.public void addSession(HttpSession session)
addSession
in interface SessionService
session
- Session to addpublic void removeSession(HttpSession session)
removeSession
in interface SessionService
session
- Session to removepublic boolean isUserLoggedIn(User user)
isUserLoggedIn
in interface SessionService
user
- User to check forpublic Collection<User> getActiveUsers()
getActiveUsers
in interface SessionService
User
objects.public User getUserFromSession(HttpSession session)
getUserFromSession
in interface SessionService
session
- The session from which to extract a user.public HttpSession getSession(String sessionId)
getSession
in interface SessionService
sessionId
- The unique session identifier.public Collection<HttpSession> getSessionsForUser(User user)
getSessionsForUser
in interface SessionService
user
- the userpublic void init()
init
in interface Initable
init
in class TurbineBaseService
public void shutdown()
shutdown
in interface Initable
shutdown
in class TurbineBaseService
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.