public class SessionStore extends Object
original
non RX-ified interface using Vert.x codegen.Modifier and Type | Field and Description |
---|---|
static io.vertx.lang.rx.TypeArg<SessionStore> |
__TYPE_ARG |
static int |
DEFAULT_SESSIONID_LENGTH
Default length for a session id.
|
Constructor and Description |
---|
SessionStore(Object delegate) |
SessionStore(SessionStore delegate) |
Modifier and Type | Method and Description |
---|---|
SessionStore |
clear()
Remove all sessions from the store.
|
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.
|
SessionStore |
delete(String id)
Delete the session with the specified ID.
|
SessionStore |
delete(String id,
Handler<AsyncResult<Void>> resultHandler)
Delete the session with the specified ID.
|
boolean |
equals(Object o) |
SessionStore |
get(String cookieValue)
Get the session with the specified ID.
|
SessionStore |
get(String cookieValue,
Handler<AsyncResult<Session>> resultHandler)
Get the session with the specified ID.
|
SessionStore |
getDelegate() |
int |
hashCode() |
SessionStore |
init(Vertx vertx,
JsonObject options)
Initialize this store.
|
static SessionStore |
newInstance(SessionStore arg) |
SessionStore |
put(Session session)
Add a session with the specified ID.
|
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.
|
Single<Void> |
rxClear()
Remove all sessions from the store.
|
Single<Void> |
rxDelete(String id)
Delete the session with the specified ID.
|
Single<Session> |
rxGet(String cookieValue)
Get the session with the specified ID.
|
Single<Void> |
rxPut(Session session)
Add a session with the specified ID.
|
Single<Integer> |
rxSize()
Get the number of sessions in the store.
|
SessionStore |
size()
Get the number of sessions in the store.
|
SessionStore |
size(Handler<AsyncResult<Integer>> resultHandler)
Get the number of sessions in the store.
|
String |
toString() |
public static final io.vertx.lang.rx.TypeArg<SessionStore> __TYPE_ARG
public static final int DEFAULT_SESSIONID_LENGTH
public SessionStore(SessionStore delegate)
public SessionStore(Object delegate)
public SessionStore getDelegate()
public static SessionStore create(Vertx vertx)
vertx
- vertx instancepublic static SessionStore create(Vertx vertx, JsonObject options)
vertx
- vertx instanceoptions
- extra options for initializationpublic SessionStore init(Vertx vertx, JsonObject options)
vertx
- the vertx instanceoptions
- optional Json with extra configuration optionspublic long retryTimeout()
public Session createSession(long timeout)
timeout
- - the session timeout, in mspublic Session createSession(long timeout, int length)
timeout
- - the session timeout, in mslength
- - the required length for the session idpublic 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 failurepublic SessionStore get(String cookieValue)
cookieValue
- the unique ID of the sessionpublic Single<Session> rxGet(String cookieValue)
cookieValue
- the unique ID of the sessionpublic SessionStore delete(String id, Handler<AsyncResult<Void>> resultHandler)
id
- the session idresultHandler
- will be called with a success or a failurepublic SessionStore delete(String id)
id
- the session idpublic Single<Void> rxDelete(String id)
id
- the session idpublic SessionStore put(Session session, Handler<AsyncResult<Void>> resultHandler)
session
- the sessionresultHandler
- will be called with a success or a failurepublic SessionStore put(Session session)
session
- the sessionpublic Single<Void> rxPut(Session session)
session
- the sessionpublic SessionStore clear(Handler<AsyncResult<Void>> resultHandler)
resultHandler
- will be called with a success or a failurepublic SessionStore clear()
public 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 failurepublic SessionStore size()
Beware of the result which is just an estimate, in particular with distributed session stores.
public Single<Integer> rxSize()
Beware of the result which is just an estimate, in particular with distributed session stores.
public void close()
public static SessionStore newInstance(SessionStore arg)
Copyright © 2023 Eclipse. All rights reserved.