info.magnolia.context
Class UserContextImpl
java.lang.Object
info.magnolia.context.AbstractContext
info.magnolia.context.UserContextImpl
- All Implemented Interfaces:
- UserContext, Serializable, Map, org.apache.commons.chain.Context
- Direct Known Subclasses:
- WebContextImpl
public class UserContextImpl
- extends AbstractContext
- implements UserContext
User aware context implementation able to release and discard all kept info upon user logout. Also changes the locale
from default one to the one preferred by the logged in user. Sets the Subject for the logged in user in session for
subsequent requests to pick up. When no user has logged in this class returns the anonymous user.
- Version:
- $Id$
- See Also:
- Serialized Form
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Fields inherited from interface info.magnolia.context.Context |
APPLICATION_SCOPE, ATTRIBUTE_COMMENT, ATTRIBUTE_EXCEPTION, ATTRIBUTE_MESSAGE, ATTRIBUTE_PATH, ATTRIBUTE_POSSIBLE_CSRF, ATTRIBUTE_RECURSIVE, ATTRIBUTE_REPOSITORY, ATTRIBUTE_UUID, ATTRIBUTE_VERSION, ATTRIBUTE_VERSION_MAP, LOCAL_SCOPE, SESSION_SCOPE |
Methods inherited from class info.magnolia.context.AbstractContext |
clear, containsKey, containsValue, entrySet, get, getAccessManager, getAttribute, getAttribute, getAttributes, getAttributes, getAttributeStrategy, getHierarchyManager, getJCRSession, getMessages, getMessages, getQueryManager, getRepositoryStrategy, isEmpty, keySet, put, putAll, release, remove, removeAttribute, setAttribute, setAttributeStrategy, setLocale, setRepositoryStrategy, size, values |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface info.magnolia.context.Context |
getAccessManager, getAttribute, getAttribute, getAttributes, getAttributes, getHierarchyManager, getJCRSession, getMessages, getMessages, getQueryManager, release, removeAttribute, setAttribute, setLocale |
Methods inherited from interface java.util.Map |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
UserContextImpl
public UserContextImpl()
getLocale
public Locale getLocale()
- Description copied from class:
AbstractContext
- If not yet set try to get the locale of the user. Else use the locale of the system context.
- Overrides:
getLocale
in class AbstractContext
- See Also:
Context.getLocale()
getUser
public User getUser()
- Description copied from interface:
Context
- If this is not a UserContext this method will very likely return the system user.
- Overrides:
getUser
in class AbstractContext
getSubject
public Subject getSubject()
- Overrides:
getSubject
in class AbstractContext
login
public void login(Subject subject)
- Specified by:
login
in interface UserContext
logout
public void logout()
- Specified by:
logout
in interface UserContext
setLocaleFor
protected void setLocaleFor(User user)
Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.