|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.olat.core.util.UserSession
public class UserSession
Description:
the httpsession contains an instance of this class. the
UserSession is either authenticated or not; and if it is, then it also
contains things like the Identity, the locale etc. of the current user.
| Field Summary | |
|---|---|
static OLATResourceable |
ORES_USERSESSION
|
static java.lang.String |
STORE_KEY_KILLED_EXISTING_SESSION
|
| Method Summary | |
|---|---|
void |
event(Event event)
only for SignOffEvents - Usersession keeps book about usernames - WindowManager responsible to dispose controller chain |
static java.util.Set |
getAuthenticatedUserSessions()
|
java.lang.Object |
getEntry(java.lang.String key)
|
Preferences |
getGuiPreferences()
|
Identity |
getIdentity()
|
IdentityEnvironment |
getIdentityEnvironment()
|
java.util.Locale |
getLocale()
|
Roles |
getRoles()
|
java.lang.Object |
getServiceInstance(java.lang.Class serviceInterfaceName)
|
SessionInfo |
getSessionInfo()
may be null |
static Identity |
getSignedOnIdentity(java.lang.String userName)
|
EventBus |
getSingleUserEventCenter()
This is the olatsystembus to broadcast event amongst controllers of a single user only (the one whom this usersession belongs to) |
static UserSession |
getUserSession(javax.servlet.http.HttpServletRequest hreq)
|
static UserSession |
getUserSession(javax.servlet.http.HttpSession session)
|
static UserSession |
getUserSessionIfAlreadySet(javax.servlet.http.HttpServletRequest hreq)
Return the UserSession of the given request if it is already set or null otherwise |
static int |
getUserSessionsCnt()
|
static int |
invalidateAllSessions()
Invalidate all sessions except admin-sessions. |
static int |
invalidateOldestSessions(int nbrSessions)
Invalidate a given number of oldest (last-click-time) sessions except admin-sessions. |
boolean |
isAuthenticated()
|
void |
putEntry(java.lang.String key,
java.lang.Object o)
|
void |
putEntryInNonClearedStore(java.lang.Object key,
java.lang.Object o)
put an entry in the usersession that even survives login/logouts from the users. |
java.lang.Object |
removeEntry(java.lang.Object key)
|
java.lang.Object |
removeEntryFromNonClearedStore(java.lang.Object key)
|
static void |
setGlobalSessionTimeout(int sessionTimeoutInSec)
set session timeout on http session - |
void |
setIdentity(Identity identity)
Sets the identity. |
void |
setLocale(java.util.Locale locale)
Sets the locale. |
void |
setRoles(Roles roles)
Sets the roles. |
void |
setSessionInfo(SessionInfo sessionInfo)
|
void |
signOffAndClear()
called to make sure the current authenticated user (if there is one at all) is cleared and signed off. |
void |
signOn()
prior to calling this method, all instance vars must be set. |
java.lang.String |
toString()
|
void |
valueBound(javax.servlet.http.HttpSessionBindingEvent be)
|
void |
valueUnbound(javax.servlet.http.HttpSessionBindingEvent be)
called when the session is invalidated either by app. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final OLATResourceable ORES_USERSESSION
public static final java.lang.String STORE_KEY_KILLED_EXISTING_SESSION
| Method Detail |
|---|
public java.lang.Object getServiceInstance(java.lang.Class serviceInterfaceName)
serviceInterfaceName -
public static UserSession getUserSession(javax.servlet.http.HttpSession session)
session -
public static UserSession getUserSession(javax.servlet.http.HttpServletRequest hreq)
hreq -
public static UserSession getUserSessionIfAlreadySet(javax.servlet.http.HttpServletRequest hreq)
hreq -
public boolean isAuthenticated()
public void putEntry(java.lang.String key,
java.lang.Object o)
key - o - public java.lang.Object getEntry(java.lang.String key)
key -
public java.lang.Object removeEntry(java.lang.Object key)
key -
public void putEntryInNonClearedStore(java.lang.Object key,
java.lang.Object o)
key - o - public java.lang.Object removeEntryFromNonClearedStore(java.lang.Object key)
key -
public java.util.Locale getLocale()
public Identity getIdentity()
public void setLocale(java.util.Locale locale)
locale - The locale to setpublic void setIdentity(Identity identity)
identity - The identity to setpublic Roles getRoles()
public void setRoles(Roles roles)
roles - The roles to setpublic void valueBound(javax.servlet.http.HttpSessionBindingEvent be)
valueBound in interface javax.servlet.http.HttpSessionBindingListenerHttpSessionBindingListener.valueBound(javax.servlet.http.HttpSessionBindingEvent)public void valueUnbound(javax.servlet.http.HttpSessionBindingEvent be)
valueUnbound in interface javax.servlet.http.HttpSessionBindingListenerHttpSessionBindingListener.valueUnbound(javax.servlet.http.HttpSessionBindingEvent)public void signOffAndClear()
public void signOn()
public static Identity getSignedOnIdentity(java.lang.String userName)
userName -
public static java.util.Set getAuthenticatedUserSessions()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public IdentityEnvironment getIdentityEnvironment()
public SessionInfo getSessionInfo()
public void setSessionInfo(SessionInfo sessionInfo)
sessionInfo - public static int getUserSessionsCnt()
public Preferences getGuiPreferences()
public EventBus getSingleUserEventCenter()
public void event(Event event)
event in interface GenericEventListenerGenericEventListener.event(org.olat.core.gui.control.Event)public static int invalidateAllSessions()
public static int invalidateOldestSessions(int nbrSessions)
nbrSessions - number of sessions whisch will be invalidated
public static void setGlobalSessionTimeout(int sessionTimeoutInSec)
sessionTimeoutInSec -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||