Class SessionMap
- java.lang.Object
-
- org.openidentityplatform.openam.click.util.SessionMap
-
public class SessionMap extends Object implements Map<String,Object>
Provides a Map adaptor for HttpSession objects. A SessionMap instance is available in each Velocity page using the name "session". For example suppose we have a User object in the session with the attribute name "user" when a user is logged on. We can display the users name in the page when the are logged onto the system.#if ($session.user) $session.user.fullname you are logged on. #else You are not logged on. #end
The ClickServlet adds a SessionMap instance to the Velocity Context before it is merged with the page template. The SessionMap supportsFlashAttribute
which when accessed viaget(Object)
are removed from the session.
-
-
Field Summary
Fields Modifier and Type Field Description protected jakarta.servlet.http.HttpSession
session
The internal session attribute.
-
Constructor Summary
Constructors Constructor Description SessionMap(jakarta.servlet.http.HttpSession value)
Create a HttpSession Map adaptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
boolean
containsKey(Object key)
boolean
containsValue(Object value)
This method is not supported and will throw UnsupportedOperationException if invoked.Set<Map.Entry<String,Object>>
entrySet()
Object
get(Object key)
If the stored object is a FlashObject this method will return the FlashObject value and then remove it from the session.boolean
isEmpty()
Set<String>
keySet()
Object
put(String key, Object value)
void
putAll(Map<? extends String,?> map)
Object
remove(Object key)
int
size()
Collection<Object>
values()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
-
-
Method Detail
-
size
public int size()
- Specified by:
size
in interfaceMap<String,Object>
- See Also:
Map.size()
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceMap<String,Object>
- See Also:
Map.isEmpty()
-
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey
in interfaceMap<String,Object>
- See Also:
Map.containsKey(Object)
-
containsValue
public boolean containsValue(Object value)
This method is not supported and will throw UnsupportedOperationException if invoked.- Specified by:
containsValue
in interfaceMap<String,Object>
- See Also:
Map.containsValue(Object)
-
get
public Object get(Object key)
If the stored object is a FlashObject this method will return the FlashObject value and then remove it from the session.- Specified by:
get
in interfaceMap<String,Object>
- See Also:
Map.get(Object)
-
put
public Object put(String key, Object value)
- Specified by:
put
in interfaceMap<String,Object>
- See Also:
Map.put(Object, Object)
-
remove
public Object remove(Object key)
- Specified by:
remove
in interfaceMap<String,Object>
- See Also:
Map.remove(Object)
-
putAll
public void putAll(Map<? extends String,?> map)
- Specified by:
putAll
in interfaceMap<String,Object>
- See Also:
Map.putAll(Map)
-
clear
public void clear()
- Specified by:
clear
in interfaceMap<String,Object>
- See Also:
Map.clear()
-
keySet
public Set<String> keySet()
- Specified by:
keySet
in interfaceMap<String,Object>
- See Also:
Map.keySet()
-
values
public Collection<Object> values()
- Specified by:
values
in interfaceMap<String,Object>
- See Also:
Map.values()
-
-