|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.stratelia.silverpeas.peasCore.SessionManager
@Named(value="sessionManagement") public class SessionManager
Class declaration This object is a singleton used by SilverpeasSessionOpenener : when the user log in, ComponentRequestRouter : when the user access a component. It provides functions to manage the sessions, to write a log journal and getFactory informations about the logged users.
Method Summary | |
---|---|
void |
closeSession(String sessionId)
Closes the specified user session. |
void |
doSessionManagement(Date currentDate)
This method is called every scheduledSessionManagementTimeStamp minute by the scheduler, it notify the user when timeout has expired and then invalidates the session if the user has not accessed the server. |
Collection<SessionInfo> |
getConnectedUsersList()
Gets all the connected users and the duration of their session. |
Collection<SessionInfo> |
getDistinctConnectedUsersList(UserDetail user)
Gets all the connected users and the duration of their session. |
int |
getNbConnectedUsersList(UserDetail user)
Gets number of connected users |
long |
getNextSessionTimeOut(String sessionKey)
Gets the next timeout of the specified user session. |
SessionInfo |
getSessionInfo(String sessionId)
Gets information about the specified user session. |
void |
initSessionManager()
Init attributes |
boolean |
isUserConnected(UserDetail user)
Is the specified user currently connected to Silverpeas? |
void |
jobFailed(SchedulerEvent anEvent)
Invoked when the normal execution thread of a job is broken by an exception. |
void |
jobSucceeded(SchedulerEvent anEvent)
Invoked when the execution of a job has been completed correctly. |
SessionInfo |
openAnonymousSession(javax.servlet.http.HttpServletRequest request)
Opens a new anonymous session with the specified HTTP request at the origin of the session ask. |
SessionInfo |
openSession(UserDetail user)
This method is dedicated to the authentication for only accessing the WEB services published in Silverpeas. |
SessionInfo |
openSession(UserDetail user,
javax.servlet.http.HttpServletRequest request)
This method is dedicated to the authentication of users behind a WEB browser. |
void |
removeSession(String sessionId)
Remove a session and log session's data. |
void |
shutdown()
This method remove and invalidates all sessions. |
void |
triggerFired(SchedulerEvent anEvent)
Invoked when a job trigger fires the execution of a job. |
SessionInfo |
validateSession(SessionValidationContext context)
Validates the session identified uniquely by the specified key. |
SessionInfo |
validateSession(String sessionKey)
Calls SessionManagement.validateSession(SessionValidationContext) method by specifying to it a
context that contains only the specified session key. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
@PostConstruct public void initSessionManager()
public SessionInfo validateSession(String sessionKey)
SessionManagement
SessionManagement.validateSession(SessionValidationContext)
method by specifying to it a
context that contains only the specified session key.
validateSession
in interface SessionManagement
sessionKey
- the key of the user session.
SessionManagement.validateSession(SessionValidationContext)
execution.public SessionInfo validateSession(SessionValidationContext context)
SessionManagement
validateSession
in interface SessionManagement
context
- the context of the validation that contains at least the session key
public void removeSession(String sessionId)
sessionId
- identifierLogoutServlet
public void closeSession(String sessionId)
SessionManagement
closeSession
in interface SessionManagement
sessionId
- the key of the session to close.public SessionInfo getSessionInfo(String sessionId)
SessionManagement
getSessionInfo
in interface SessionManagement
sessionId
- the key of the user session.
public Collection<SessionInfo> getConnectedUsersList()
getConnectedUsersList
in interface SessionManagement
public Collection<SessionInfo> getDistinctConnectedUsersList(UserDetail user)
getDistinctConnectedUsersList
in interface SessionManagement
user
- a user from whom all the distinct connected users are visible.
public int getNbConnectedUsersList(UserDetail user)
getNbConnectedUsersList
in interface SessionManagement
user
-
public void doSessionManagement(Date currentDate)
currentDate
- the date when the method is called by the schedulerfor parameters, addSession, setLastAccess
public void shutdown()
public void triggerFired(SchedulerEvent anEvent) throws Exception
SchedulerEventListener
triggerFired
in interface SchedulerEventListener
anEvent
- the event coming from the trigger firing.
Exception
public void jobSucceeded(SchedulerEvent anEvent)
SchedulerEventListener
jobSucceeded
in interface SchedulerEventListener
anEvent
- the event coming from the job completion.public void jobFailed(SchedulerEvent anEvent)
SchedulerEventListener
jobFailed
in interface SchedulerEventListener
anEvent
- the event coming from the job failure.public SessionInfo openSession(UserDetail user)
openSession
in interface SessionManagement
user
- the user for which the session has to be opened
public SessionInfo openSession(UserDetail user, javax.servlet.http.HttpServletRequest request)
openSession
in interface SessionManagement
user
- the user for which the session has to be openedrequest
- the HTTP servlet request in which the authentication is performed.
public SessionInfo openAnonymousSession(javax.servlet.http.HttpServletRequest request)
SessionManagement
openAnonymousSession
in interface SessionManagement
request
- the HTTP request at the origin of the session opening ask.
public boolean isUserConnected(UserDetail user)
SessionManagement
isUserConnected
in interface SessionManagement
user
- the user for which the connection is checked.
public long getNextSessionTimeOut(String sessionKey)
SessionManagement
getNextSessionTimeOut
in interface SessionManagement
sessionKey
- the keu of the user session.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |