-
- All Implemented Interfaces:
-
com.hexagonkt.http.server.SessionPort
public final class TestSession implements SessionPort
-
-
Field Summary
Fields Modifier and Type Field Description private Map<String, Object>attributesprivate LongcreationTimeprivate Stringidprivate IntegermaxInactiveIntervalprivate LonglastAccessedTime
-
Method Summary
Modifier and Type Method Description final Map<String, Object>getAttributes()final UnitsetAttributes(Map<String, Object> attributes)final LonggetCreationTime()final UnitsetCreationTime(Long creationTime)final StringgetId()final UnitsetId(String id)final IntegergetMaxInactiveInterval()final UnitsetMaxInactiveInterval(Integer maxInactiveInterval)final LonggetLastAccessedTime()final UnitsetLastAccessedTime(Long lastAccessedTime)Map<String, Object>attributes()Returns a Map of attribute object bound to this session. LongcreationTime()Returns the time when this session was created. ObjectgetAttribute(String name)Returns the attribute object bound to this session by the given name. Stringid()A string containing the unique identifier assigned to this session (Cookie). Unitinvalidate()Invalidates this session then unbinds any objects bound to it. 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. LonglastAccessedTime()Returns the last time the client sent a request associated with this session. IntegermaxInactiveInterval()Returns the maximum time interval in seconds between client accesses after which the session will be invalidated. UnitmaxInactiveInterval(Integer value)Sets the time, in seconds, between client requests before the session is invalidated. UnitremoveAttribute(String name)Removes the bound object from the session attribute with the specified name. UnitsetAttribute(String name, Object value)Sets a attribute object to this session with the given name. -
-
Method Detail
-
getAttributes
final Map<String, Object> getAttributes()
-
setAttributes
final Unit setAttributes(Map<String, Object> attributes)
-
getCreationTime
final Long getCreationTime()
-
setCreationTime
final Unit setCreationTime(Long creationTime)
-
getMaxInactiveInterval
final Integer getMaxInactiveInterval()
-
setMaxInactiveInterval
final Unit setMaxInactiveInterval(Integer maxInactiveInterval)
-
getLastAccessedTime
final Long getLastAccessedTime()
-
setLastAccessedTime
final Unit setLastAccessedTime(Long lastAccessedTime)
-
attributes
Map<String, Object> attributes()
Returns a Map of attribute object bound to this session.
-
creationTime
Long creationTime()
Returns the time when this session was created.
-
getAttribute
Object getAttribute(String name)
Returns the attribute object bound to this session by the given name.
- Parameters:
name- String specifying the name of the object.
-
invalidate
Unit invalidate()
Invalidates this session then unbinds any objects bound to it.
-
isNew
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.
-
lastAccessedTime
Long lastAccessedTime()
Returns the last time the client sent a request associated with this session.
-
maxInactiveInterval
Integer maxInactiveInterval()
Returns the maximum time interval in seconds between client accesses after which the session will be invalidated.
-
maxInactiveInterval
Unit maxInactiveInterval(Integer value)
Sets the time, in seconds, between client requests before the session is invalidated.
- Parameters:
value- Maximum inactive time interval in seconds.
-
removeAttribute
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.
-
setAttribute
Unit setAttribute(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.
-
-
-
-