Constructor and Description |
---|
SessionFacade() |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
void |
destroy()
Destroys current session
|
Set<Map.Entry> |
entrySet() |
Object |
get(Object key) |
Object |
get(String name)
Retrieve object from session.
|
<T> T |
get(String name,
Class<T> type)
Convenience method, will do internal check for null and then cast.
|
long |
getCreationTime()
Returns time when session was created.
|
String |
getId()
returns ID of the underlying session
|
String |
id()
Returns a session ID from underlying session.
|
void |
invalidate()
Invalidates current session.
|
boolean |
isEmpty() |
Set<Object> |
keySet() |
String[] |
names()
Returns names of current attributes as a list.
|
Object |
put(Object key,
Object value) |
Object |
put(String name,
Serializable value)
Add object to a session.
|
void |
putAll(Map m) |
Object |
remove(Object key) |
void |
remove(String name)
Removes object from session.
|
void |
setTimeToLive(int seconds)
Sets time to live in seconds.
|
int |
size() |
Collection |
values() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
public String id()
public Object get(String name)
name
- name of object.public <T> T get(String name, Class<T> type)
ClassCastException
only in case the object in session is different type than expected.name
- name of session object.type
- expected typepublic void remove(String name)
name
- name of objectpublic Object put(String name, Serializable value)
name
- name of objectvalue
- object reference.public long getCreationTime()
public void invalidate()
public void setTimeToLive(int seconds)
seconds
- time to live.public String[] names()
public String getId()
public void destroy()
public boolean containsKey(Object key)
containsKey
in interface Map
public boolean containsValue(Object value)
containsValue
in interface Map
public Collection values()
Copyright © 2019 JavaLite. All rights reserved.