Package org.nuxeo.ecm.webengine.session
Class UserSession
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<String,
Object>
Used to store user session. This object is cached in a the HTTP session Principal, subject and credentials are
immutable per user session
- Author:
- Bogdan Stefanescu
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Field Summary
Modifier and TypeFieldDescriptionprotected Map<Class<?>,
ComponentMap<?>> protected javax.servlet.http.HttpServletRequest
-
Constructor Summary
ModifierConstructorDescriptionprotected
UserSession
(javax.servlet.http.HttpServletRequest request) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addRequestCleanupHandler
(javax.servlet.http.HttpServletRequest request, RequestCleanupHandler handler) Register a cleanup handler that will be invoked when HTTP request terminate.<T extends Component>
TfindComponent
(Class<T> type, String name) Finds an existing component.<T extends Component>
TgetComponent
(Class<T> type) <T extends Component>
TgetComponent
(Class<T> type, String name) Gets a component given its class and an optional name.<T extends Component>
TgetComponent
(String id) Gets component by ID.<T extends Component>
TgetComponent
(String typeName, String name) static UserSession
getCurrentSession
(javax.servlet.http.HttpServletRequest request) Methods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Field Details
-
comps
-
request
protected javax.servlet.http.HttpServletRequest request
-
-
Constructor Details
-
UserSession
protected UserSession(javax.servlet.http.HttpServletRequest request)
-
-
Method Details
-
getCurrentSession
-
getPrincipal
-
addRequestCleanupHandler
public static void addRequestCleanupHandler(javax.servlet.http.HttpServletRequest request, RequestCleanupHandler handler) Register a cleanup handler that will be invoked when HTTP request terminate. This method is not thread safe. -
findComponent
Finds an existing component.The component state will not be modified before being returned as in
getComponent(Class, String)
.If the component was not found in that session, returns null.
-
getComponent
Gets a component given its class and an optional name.If the component was not yet created in this session, it will be created and registered against the session.
- Throws:
SessionException
-
getComponent
- Throws:
SessionException
-
getComponent
- Throws:
SessionException
-
getComponent
Gets component by ID.The ID is of the form
type#name
for non-null names andtype
for null names.- Throws:
SessionException
-