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(io.vertx.core.Handler<io.vertx.core.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,
io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler)
Delete the session with the specified ID
|
void |
get(String id,
io.vertx.core.Handler<io.vertx.core.AsyncResult<Session>> resultHandler)
Get the session with the specified ID
|
void |
put(Session session,
io.vertx.core.Handler<io.vertx.core.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(io.vertx.core.Handler<io.vertx.core.AsyncResult<Integer>> resultHandler)
Get the number of sessions in the store
|
static final int DEFAULT_SESSIONID_LENGTH
long 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 id, io.vertx.core.Handler<io.vertx.core.AsyncResult<Session>> resultHandler)
id
- the unique ID of the sessionresultHandler
- will be called with a result holding the session, or a failurevoid delete(String id, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler)
id
- the unique ID of the sessionresultHandler
- will be called with a success or a failurevoid put(Session session, io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler)
session
- the sessionresultHandler
- will be called with a success or a failurevoid clear(io.vertx.core.Handler<io.vertx.core.AsyncResult<Void>> resultHandler)
resultHandler
- will be called with a success or a failurevoid size(io.vertx.core.Handler<io.vertx.core.AsyncResult<Integer>> resultHandler)
resultHandler
- will be called with the number, or a failurevoid close()
Copyright © 2018 Eclipse. All rights reserved.