-
- All Implemented Interfaces:
public final class SessionProvides session information.
-
-
Field Summary
Fields Modifier and Type Field Description private final LongcreationTimeprivate final LonglastAccessedTimeprivate final Stringidprivate IntegermaxInactiveIntervalprivate final Map<String, Object>attributesprivate final SessionPortadapter
-
Constructor Summary
Constructors Constructor Description Session(SessionPort adapter)
-
Method Summary
Modifier and Type Method Description final LonggetCreationTime()The time when this session was created. final LonggetLastAccessedTime()The last time the client sent a request associated with this session. final StringgetId()A string containing the unique identifier assigned to this session (Cookie). final IntegergetMaxInactiveInterval()final UnitsetMaxInactiveInterval(Integer maxInactiveInterval)final Map<String, Object>getAttributes()Map of attribute objects bound to the session. final SessionPortgetAdapter()final Objectget(String name)Returns the attribute object bound to this session by the given name. final Unitset(String name, Object value)Sets a attribute object to this session with the given name. final Unitremove(String name)Removes the bound object from the session attribute with the specified name. final UnitremoveAttribute(String name)Removes the bound object from the session attribute with the specified name. final BooleanisNew()Returns <code>true</code> if the client does not yet know about the session or if the client chooses not to join the session. final Unitinvalidate()Invalidates this session then unbinds any objects bound to it. -
-
Constructor Detail
-
Session
Session(SessionPort adapter)
-
-
Method Detail
-
getCreationTime
final Long getCreationTime()
The time when this session was created.
-
getLastAccessedTime
final Long getLastAccessedTime()
The last time the client sent a request associated with this session.
-
getId
final String getId()
A string containing the unique identifier assigned to this session (Cookie).
-
getMaxInactiveInterval
final Integer getMaxInactiveInterval()
-
setMaxInactiveInterval
final Unit setMaxInactiveInterval(Integer maxInactiveInterval)
-
getAttributes
final Map<String, Object> getAttributes()
Map of attribute objects bound to the session.
-
getAdapter
final SessionPort getAdapter()
-
get
final Object get(String name)
Returns the attribute object bound to this session by the given name.
- Parameters:
name- String specifying the name of the object.
-
set
final Unit set(String name, Object value)
Sets a attribute object to this session with the given name.
- Parameters:
name- String specifying the name of the object.value- The object to be bound.
-
remove
final Unit remove(String name)
Removes the bound object from the session attribute with the specified name.
- Parameters:
name- String specifying the name of the object.
-
removeAttribute
final Unit removeAttribute(String name)
Removes the bound object from the session attribute with the specified name.
- Parameters:
name- String specifying the name of the object.
-
isNew
final Boolean isNew()
Returns <code>true</code> if the client does not yet know about the session or if the client chooses not to join the session.
-
invalidate
final Unit invalidate()
Invalidates this session then unbinds any objects bound to it.
-
-
-
-