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 |
---|---|
Future<Void> |
clear() |
default SessionStore |
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.
|
Future<Void> |
delete(String cookieValue) |
default SessionStore |
delete(String id,
Handler<AsyncResult<Void>> resultHandler)
Delete the session with the specified ID.
|
Future<Session> |
get(String cookieValue) |
default SessionStore |
get(String cookieValue,
Handler<AsyncResult<Session>> resultHandler)
Get the session with the specified ID.
|
SessionStore |
init(Vertx vertx,
JsonObject options)
Initialize this store.
|
Future<Void> |
put(Session session) |
default SessionStore |
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.
|
Future<Integer> |
size() |
default SessionStore |
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 iddefault SessionStore 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 failureFuture<Session> get(String cookieValue)
cookieValue
- the unique ID of the sessionget(String, Handler)
default SessionStore delete(String id, Handler<AsyncResult<Void>> resultHandler)
id
- the session idresultHandler
- will be called with a success or a failureFuture<Void> delete(String cookieValue)
cookieValue
- the unique ID of the sessiondelete(String, Handler)
default SessionStore put(Session session, Handler<AsyncResult<Void>> resultHandler)
session
- the sessionresultHandler
- will be called with a success or a failureFuture<Void> put(Session session)
session
- the sessionput(Session, Handler)
default SessionStore clear(Handler<AsyncResult<Void>> resultHandler)
resultHandler
- will be called with a success or a failureFuture<Void> clear()
clear(Handler)
default SessionStore 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 failureFuture<Integer> size()
size(Handler)
void close()
Copyright © 2024 Eclipse. All rights reserved.