use of org.openforis.collect.manager.SessionManager in project collect by openforis.
the class SessionListener method sessionCreated.
@Override
public void sessionCreated(HttpSessionEvent se) {
SessionManager sessionManager = getSessionManager(se);
sessionManager.createSessionState(se.getSession());
if (LOG.isInfoEnabled()) {
LOG.info("Session created: " + se.getSession().getId());
}
}
use of org.openforis.collect.manager.SessionManager in project collect by openforis.
the class SessionListener method sessionDestroyed.
@Override
public void sessionDestroyed(HttpSessionEvent se) {
SessionManager sessionManager = getSessionManager(se);
try {
SessionState sessionState = sessionManager.getSessionState();
User user = null;
if (sessionState != null) {
user = sessionState.getUser();
if (user != null) {
sessionManager.sessionDestroyed();
}
}
if (LOG.isInfoEnabled()) {
String message = "Session destroyed: " + se.getSession().getId();
if (user != null) {
message += " username: " + user.getUsername();
}
LOG.info(message);
}
} catch (InvalidSessionException e) {
// ignore it, session was anonymous
}
}
Aggregations