|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.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,
String id,
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(HttpSessionBindingEvent arg0)
|
void |
attributeRemoved(HttpSessionBindingEvent arg0)
|
void |
attributeReplaced(HttpSessionBindingEvent ev)
|
static void |
deleteUserSessions(int days)
Delete all sessions older than the given dates |
static List<com.groiss.org.impl.UserSession> |
getActiveSessions()
return the list of users currently logged in |
static List<com.groiss.org.impl.UserSession> |
getActiveSessions(String node)
return the list of users currently logged in at a node |
static List<com.groiss.org.impl.UserSession> |
getConcurrentSessions()
return the list of userssessions which count for concurrent licenses |
static int |
getConcurrentUsers()
|
static String |
getLoginMessage()
|
static int |
getMaxConcurrent(Date since,
Date until)
|
static IUserSession |
getSessionById(String sessionId)
called when session are read from dumped file after restart. |
static List<com.groiss.org.impl.UserSession> |
getSessions(Boolean active,
Date since,
Date until,
com.dec.avw.core.User u)
The sessions selected by date and/or user. |
static boolean |
hasPendingAction(short type,
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(String id)
|
static boolean |
isLoggedIn(com.dec.avw.core.User user)
|
static boolean |
isLoginAllowed()
|
static String |
login(com.dec.avw.core.User user,
String ip)
Called on login of a user |
static String |
login(com.dec.avw.core.User user,
String ip,
boolean interactive,
short sessiontype)
|
static void |
logout(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,
String id)
|
static void |
removeSession(String sessionId)
|
void |
sessionCreated(HttpSessionEvent e)
|
void |
sessionDestroyed(HttpSessionEvent e)
|
static void |
setLoginAllowed(boolean allow,
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 String login(com.dec.avw.core.User user,
String ip)
public static void setSessionEventHandler(com.groiss.org.impl.UserSessionEventHandler seh)
public static String login(com.dec.avw.core.User user,
String ip,
boolean interactive,
short sessiontype)
public static IUserSession getSessionById(String sessionId)
throws Exception
Exception
public static void logout(String sessionId)
throws Exception
Exception
public static void logout(com.groiss.org.impl.UserSession ss)
throws Exception
Exceptionpublic static void removeSession(String sessionId)
public static List<com.groiss.org.impl.UserSession> getActiveSessions()
public static List<com.groiss.org.impl.UserSession> getActiveSessions(String node)
public static List<com.groiss.org.impl.UserSession> getConcurrentSessions()
public static int getMaxConcurrent(Date since,
Date until)
public static List<com.groiss.org.impl.UserSession> getSessions(Boolean active,
Date since,
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 boolean isLoggedIn(com.dec.avw.core.User user)
public static void setLoginAllowed(boolean allow,
String message)
throws IOException
IOExceptionpublic static int getConcurrentUsers()
public static boolean isLoginAllowed()
public static String getLoginMessage()
public static void removeInactiveSessions()
public static void updateLastAccessOnSessions()
public static void initSessions()
public void sessionCreated(HttpSessionEvent e)
sessionCreated in interface HttpSessionListenerpublic void sessionDestroyed(HttpSessionEvent e)
sessionDestroyed in interface HttpSessionListenerpublic void attributeAdded(HttpSessionBindingEvent arg0)
attributeAdded in interface HttpSessionAttributeListenerpublic void attributeRemoved(HttpSessionBindingEvent arg0)
attributeRemoved in interface HttpSessionAttributeListenerpublic void attributeReplaced(HttpSessionBindingEvent ev)
attributeReplaced in interface HttpSessionAttributeListener
public static void deleteUserSessions(int days)
throws Exception
Exception
public static boolean addPendingAction(short type,
String id,
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,
String id)
type - either INFO or WARNINGid - the id of the action.
public static boolean addRestartAction()
public static void removePendingAction(short type,
String id)
public static void removePendindActions()
public boolean isActiveSession(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 | ||||||||