public class UserSessionProviderDefaultImpl extends UserSessionAccess.AbstractUserSessionProvider implements MutableUserSession
UserSessionProvider
. It simply delegates to according classes provided
by the springframework.Constructor and Description |
---|
UserSessionProviderDefaultImpl()
The constructor.
|
Modifier and Type | Method and Description |
---|---|
UserSession |
getCurrentSession()
Gets the current
UserSession according to the current environment and client or server context. |
Locale |
getLocale() |
String |
getLogin() |
org.springframework.security.core.Authentication |
getUser() |
boolean |
isFallback()
This method determines if this
UserSession was received or is
currently called outside the scope of a current user session. |
void |
setLocale(Locale locale) |
void |
setUser(Principal user)
Sets the
current user . |
doInitialized
createLogger, doInitialize, getLogger
getInitializationState, initialize
public UserSessionProviderDefaultImpl()
public UserSession getCurrentSession()
UserSessionProvider
UserSession
according to the current environment and client or server context.getCurrentSession
in interface UserSessionProvider
UserSession
.public org.springframework.security.core.Authentication getUser()
getUser
in interface UserSession
null
as fallback
.public void setUser(Principal user)
MutableUserSession
current user
. UserSession
will give you abstracted access on it
throughout the application. Setting the user after successful login is to be done in a single place of the
application and should directly happen via the underlying technology.setUser
in interface MutableUserSession
user
- is the new value of UserSession.getUser()
public String getLogin()
getLogin
in interface UserSession
null
as fallback
.public Locale getLocale()
getLocale
in interface UserSession
Locale
of the current user, or the system default locale
as
fallback
.public void setLocale(Locale locale)
setLocale
in interface MutableUserSession
locale
- is the new value of UserSession.getLocale()
.public boolean isFallback()
UserSession
UserSession
was received
or is
currently called outside the scope of a current user session. On the server side a UserSession
typically
exists in the context of a servlet container or JEE application server. If the context is not available this method
will return true
. This may be because the user is currently not logged in (anonymous access) or the context
is not available for technical reasons (e.g. misconfiguration).isFallback
in interface UserSession
true
if received
or called outside the scope of a current
user session, false
otherwise.Copyright © 2001–2016 mmm-Team. All rights reserved.