public class ClusteredSessionStoreImpl extends Object implements SessionStore, ClusteredSessionStore
DEFAULT_SESSIONID_LENGTH| Constructor and Description |
|---|
ClusteredSessionStoreImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear(Handler<AsyncResult<Void>> resultHandler)
Remove all sessions from the store.
|
void |
close()
Close the store
|
Session |
createSession(long timeout)
Create a new session using the default min length.
|
Session |
createSession(long timeout,
int length)
Create a new session.
|
void |
delete(String id,
Handler<AsyncResult<Void>> resultHandler)
Delete the session with the specified ID.
|
void |
get(String id,
Handler<AsyncResult<Session>> resultHandler)
Get the session with the specified ID.
|
SessionStore |
init(Vertx vertx,
JsonObject options)
Initialize this store.
|
void |
put(Session session,
Handler<AsyncResult<Void>> resultHandler)
Add a session with the specified ID.
|
long |
retryTimeout()
The retry timeout value in milli seconds used by the session handler when it retrieves a value from the store.
A non positive value means there is no retry at all.
|
void |
size(Handler<AsyncResult<Integer>> resultHandler)
Get the number of sessions in the store.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreate, create, create, createcreatepublic SessionStore init(Vertx vertx, JsonObject options)
SessionStoreinit in interface SessionStorevertx - the vertx instanceoptions - optional Json with extra configuration optionspublic long retryTimeout()
SessionStoreretryTimeout in interface SessionStorepublic Session createSession(long timeout)
SessionStorecreateSession in interface SessionStoretimeout - - the session timeout, in mspublic Session createSession(long timeout, int length)
SessionStorecreateSession in interface SessionStoretimeout - - the session timeout, in mslength - - the required length for the session idpublic void get(String id, Handler<AsyncResult<Session>> resultHandler)
SessionStoreget in interface SessionStoreid - the unique ID of the sessionresultHandler - will be called with a result holding the session, or a failurepublic void delete(String id, Handler<AsyncResult<Void>> resultHandler)
SessionStoredelete in interface SessionStoreid - the session idresultHandler - will be called with a success or a failurepublic void put(Session session, Handler<AsyncResult<Void>> resultHandler)
SessionStoreput in interface SessionStoresession - the sessionresultHandler - will be called with a success or a failurepublic void clear(Handler<AsyncResult<Void>> resultHandler)
SessionStoreclear in interface SessionStoreresultHandler - will be called with a success or a failurepublic void size(Handler<AsyncResult<Integer>> resultHandler)
SessionStoreBeware of the result which is just an estimate, in particular with distributed session stores.
size in interface SessionStoreresultHandler - will be called with the number, or a failurepublic void close()
SessionStoreclose in interface SessionStoreCopyright © 2020. All rights reserved.