|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.groiss.org.UserSessionManager
public class UserSessionManager
Maintains user sessions
Field Summary | |
---|---|
static short |
INFO
|
static short |
WARNING
|
Constructor Summary | |
---|---|
UserSessionManager()
|
Method Summary | |
---|---|
static boolean |
addPendingAction(short type,
java.lang.String id,
java.lang.String message)
Add a pending action to the user session which is visible later via an icon in the toolbar. |
static boolean |
addRestartAction()
This method calls addPendingAction with the parameters WARNING, restart, and an appropriate message for the restart. |
void |
attributeAdded(javax.servlet.http.HttpSessionBindingEvent arg0)
|
void |
attributeRemoved(javax.servlet.http.HttpSessionBindingEvent arg0)
|
void |
attributeReplaced(javax.servlet.http.HttpSessionBindingEvent ev)
|
static void |
deleteUserSessions(int days)
Delete all sessions older than the given dates |
static int |
getActiveSessionCount()
return the number of users currently logged in |
static java.util.List<com.groiss.org.impl.UserSession> |
getActiveSessions()
return the list of users currently logged in |
static java.util.List<com.groiss.org.impl.UserSession> |
getActiveSessions(java.lang.String node)
return the list of users currently logged in at a node |
static java.util.List<com.groiss.org.impl.UserSession> |
getConcurrentSessions()
return the list of userssessions which count for concurrent licenses |
static int |
getConcurrentUsers()
|
static java.lang.String |
getLoginMessage()
|
static int |
getMaxConcurrent(java.util.Date since,
java.util.Date until)
|
static IUserSession |
getSessionById(java.lang.String sessionId)
called when session are read from dumped file after restart. |
static java.util.List<com.groiss.org.impl.UserSession> |
getSessions(java.lang.Boolean active,
java.util.Date since,
java.util.Date until,
com.dec.avw.core.User u)
The sessions selected by date and/or user. |
static java.util.List<com.groiss.org.impl.UserSession> |
getSessions(java.lang.Boolean active,
java.util.Date since,
java.util.Date until,
com.dec.avw.core.User u,
int lastaccess)
|
static boolean |
hasPendingAction(short type,
java.lang.String id)
Check if a pending action has been added to the user session. |
static void |
init()
|
static void |
initSessions()
On startup set namedUsers and put user session in httpSessions |
boolean |
isActiveSession(java.lang.String id)
|
static boolean |
isLoggedIn(com.dec.avw.core.User user)
|
static boolean |
isLoginAllowed()
|
static java.lang.String |
login(com.dec.avw.core.User user,
java.lang.String ip)
Called on login of a user |
static java.lang.String |
login(com.dec.avw.core.User user,
java.lang.String ip,
boolean interactive,
short sessiontype)
|
static void |
logout(java.lang.String sessionId)
End the session with the given session id (if session is already finished, do nothing). |
static void |
logout(com.groiss.org.impl.UserSession ss)
End the session (if session is already finished, do nothing). |
static void |
removeInactiveSessions()
Performs a logout for all users, where the http session is expired. |
static void |
removePendindActions()
|
static void |
removePendingAction(short type,
java.lang.String id)
|
static void |
removeSession(java.lang.String sessionId)
|
void |
sessionCreated(javax.servlet.http.HttpSessionEvent e)
|
void |
sessionDestroyed(javax.servlet.http.HttpSessionEvent e)
|
static void |
setLoginAllowed(boolean allow,
java.lang.String message)
|
static void |
setSessionEventHandler(com.groiss.org.impl.UserSessionEventHandler seh)
|
static void |
updateLastAccessOnSessions()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final short INFO
public static final short WARNING
Constructor Detail |
---|
public UserSessionManager()
Method Detail |
---|
public static void init()
public static java.lang.String login(com.dec.avw.core.User user, java.lang.String ip)
public static void setSessionEventHandler(com.groiss.org.impl.UserSessionEventHandler seh)
public static java.lang.String login(com.dec.avw.core.User user, java.lang.String ip, boolean interactive, short sessiontype)
public static IUserSession getSessionById(java.lang.String sessionId) throws java.lang.Exception
java.lang.Exception
public static void logout(java.lang.String sessionId) throws java.lang.Exception
java.lang.Exception
public static void logout(com.groiss.org.impl.UserSession ss) throws java.lang.Exception
java.lang.Exception
public static void removeSession(java.lang.String sessionId)
public static java.util.List<com.groiss.org.impl.UserSession> getActiveSessions()
public static int getActiveSessionCount()
public static java.util.List<com.groiss.org.impl.UserSession> getActiveSessions(java.lang.String node)
public static java.util.List<com.groiss.org.impl.UserSession> getConcurrentSessions()
public static int getMaxConcurrent(java.util.Date since, java.util.Date until)
public static java.util.List<com.groiss.org.impl.UserSession> getSessions(java.lang.Boolean active, java.util.Date since, java.util.Date until, com.dec.avw.core.User u)
active
- if True show only active userssince
- login since this timestampuntil
- logins until this timestampu
- only for this user
public static java.util.List<com.groiss.org.impl.UserSession> getSessions(java.lang.Boolean active, java.util.Date since, java.util.Date until, com.dec.avw.core.User u, int lastaccess)
public static boolean isLoggedIn(com.dec.avw.core.User user)
public static void setLoginAllowed(boolean allow, java.lang.String message) throws java.io.IOException
java.io.IOException
public static int getConcurrentUsers()
public static boolean isLoginAllowed()
public static java.lang.String getLoginMessage()
public static void removeInactiveSessions()
public static void updateLastAccessOnSessions()
public static void initSessions()
public void sessionCreated(javax.servlet.http.HttpSessionEvent e)
sessionCreated
in interface javax.servlet.http.HttpSessionListener
public void sessionDestroyed(javax.servlet.http.HttpSessionEvent e)
sessionDestroyed
in interface javax.servlet.http.HttpSessionListener
public void attributeAdded(javax.servlet.http.HttpSessionBindingEvent arg0)
attributeAdded
in interface javax.servlet.http.HttpSessionAttributeListener
public void attributeRemoved(javax.servlet.http.HttpSessionBindingEvent arg0)
attributeRemoved
in interface javax.servlet.http.HttpSessionAttributeListener
public void attributeReplaced(javax.servlet.http.HttpSessionBindingEvent ev)
attributeReplaced
in interface javax.servlet.http.HttpSessionAttributeListener
public static void deleteUserSessions(int days) throws java.lang.Exception
java.lang.Exception
public static boolean addPendingAction(short type, java.lang.String id, java.lang.String message)
type
- either INFO or WARNINGid
- the id of the action, it is used to remove actions.message
- the already translated message a HTML text
public static boolean hasPendingAction(short type, java.lang.String id)
type
- either INFO or WARNINGid
- the id of the action.
public static boolean addRestartAction()
public static void removePendingAction(short type, java.lang.String id)
public static void removePendindActions()
public boolean isActiveSession(java.lang.String id)
isActiveSession
in interface com.groiss.servlet.impl.UserSessionManager
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |