Many operations provide both a blocking and an asynchronous version.
When using the async versions of operations no guarantee is made as to which threads will run listeners registered with this session manger. When using the blocking version the listeners are guaranteed to run in the calling thread.
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: The new session IDGenerate a new session id for this session, and return the new id. |
| public Object | Returns: the object with the specified namea string specifying the name of the object name)Returns the object bound with the specified name in this session, or
|
| public Set | Returns: anSet of
String objects specifying the
names of all the objects bound to
this sessionReturns an |
| public long | Returns: along specifying
when this session was created,
expressed in
milliseconds since 1/1/1970 GMTReturns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT. |
| public String | Returns: a string specifying the identifier assigned to this sessionReturns a string containing the unique identifier assigned to this session. |
| public long | Returns: along
representing the last time
the client sent a request associated
with this session, expressed in
milliseconds since 1/1/1970 GMTReturns the last time the client sent a request associated with this session, as the number of milliseconds since midnight January 1, 1970 GMT, and marked by the time the container received the request. |
| public int | Returns: an integer specifying the number of seconds this session remains open between client requestsReturns the maximum time interval, in seconds, that the servlet container will keep this session open between client accesses. |
| public SessionManager | |
| public void | invalidate(final HttpServerExchange exchange)
Invalidates this session then unbinds any objects bound to it. |
| public Object | removeAttribute(final String
the name of the object to remove from this session name)Removes the object bound with the specified name from this session. |
| public void | requestDone(final HttpServerExchange
The http server exchange for this request serverExchange)Called when a request is done with the session. |
| public Object | Returns: An IOFuture containing the previous valuethe name to which the object is bound;
cannot be null name, Object the object to be bound value)Binds an object to this session, using the name specified. |
| public void | setMaxInactiveInterval(int
An integer specifying the number
of seconds interval)Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. |
| changeSessionId | back to summary |
|---|---|
| public String changeSessionId(final HttpServerExchange exchange, final SessionConfig config) Generate a new session id for this session, and return the new id.
| |
| getAttribute | back to summary |
|---|---|
| public Object getAttribute(String name) Returns the object bound with the specified name in this session, or
| |
| getAttributeNames | back to summary |
|---|---|
| public Set Returns an
| |
| getCreationTime | back to summary |
|---|---|
| public long getCreationTime() Returns the time when this session was created, measured in milliseconds since midnight January 1, 1970 GMT.
| |
| getId | back to summary |
|---|---|
| public String getId() Returns a string containing the unique identifier assigned to this session. The identifier is assigned by the servlet container and is implementation dependent.
| |
| getLastAccessedTime | back to summary |
|---|---|
| public long getLastAccessedTime() Returns the last time the client sent a request associated with this session, as the number of milliseconds since midnight January 1, 1970 GMT, and marked by the time the container received the request.
Actions that your application takes, such as getting or setting a value associated with the session, do not affect the access time.
| |
| getMaxInactiveInterval | back to summary |
|---|---|
| public int getMaxInactiveInterval() Returns the maximum time interval, in seconds, that
the servlet container will keep this session open between
client accesses. After this interval, the servlet container
will invalidate the session. The maximum time interval can be set
with the
| |
| getSessionManager | back to summary |
|---|---|
public SessionManager getSessionManager()
| |
| invalidate | back to summary |
|---|---|
| public void invalidate(final HttpServerExchange exchange) Invalidates this session then unbinds any objects bound to it.
| |
| removeAttribute | back to summary |
|---|---|
| public Object removeAttribute(final String name) Removes the object bound with the specified name from this session. If the session does not have an object bound with the specified name, this method does nothing.
| |
| requestDone | back to summary |
|---|---|
| public void requestDone(final HttpServerExchange serverExchange) Called when a request is done with the session.
| |
| setAttribute | back to summary |
|---|---|
| public Object setAttribute(final String name, Object value) Binds an object to this session, using the name specified. If an object of the same name is already bound to the session, the object is replaced.
If the value passed in is null, this has the same effect as calling
| |
| setMaxInactiveInterval | back to summary |
|---|---|
| public void setMaxInactiveInterval(int interval) Specifies the time, in seconds, between client requests before the servlet container will invalidate this session. A negative time indicates the session should never timeout.
| |