public interface SessionStore
| Modifier and Type | Field and Description | 
|---|---|
static int | 
DEFAULT_SESSIONID_LENGTH
Default length for a session id. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
clear(Handler<AsyncResult<Void>> resultHandler)
Remove all sessions from the store. 
 | 
void | 
close()
Close the store 
 | 
static SessionStore | 
create(Vertx vertx)
Create a Session store given a backend and configuration JSON. 
 | 
static SessionStore | 
create(Vertx vertx,
      JsonObject options)
Create a Session store given a backend and configuration JSON. 
 | 
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 cookieValue,
   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. 
 | 
static final int DEFAULT_SESSIONID_LENGTH
static SessionStore create(Vertx vertx)
vertx - vertx instancestatic SessionStore create(Vertx vertx, JsonObject options)
vertx - vertx instanceoptions - extra options for initializationSessionStore init(Vertx vertx, JsonObject options)
vertx - the vertx instanceoptions - optional Json with extra configuration optionslong retryTimeout()
Session createSession(long timeout)
timeout - - the session timeout, in msSession createSession(long timeout, int length)
timeout - - the session timeout, in mslength - - the required length for the session idvoid get(String cookieValue, Handler<AsyncResult<Session>> resultHandler)
cookieValue - the unique ID of the sessionresultHandler - will be called with a result holding the session, or a failurevoid delete(String id, Handler<AsyncResult<Void>> resultHandler)
id - the session idresultHandler - will be called with a success or a failurevoid put(Session session, Handler<AsyncResult<Void>> resultHandler)
session - the sessionresultHandler - will be called with a success or a failurevoid clear(Handler<AsyncResult<Void>> resultHandler)
resultHandler - will be called with a success or a failurevoid size(Handler<AsyncResult<Integer>> resultHandler)
Beware of the result which is just an estimate, in particular with distributed session stores.
resultHandler - will be called with the number, or a failurevoid close()
Copyright © 2020 Eclipse. All rights reserved.