Package io.vertx.rxjava3.ext.web.sstore
Class SessionStore
java.lang.Object
io.vertx.rxjava3.ext.web.sstore.SessionStore
- All Implemented Interfaces:
RxDelegate
- Direct Known Subclasses:
ClusteredSessionStore,CookieSessionStore,InfinispanSessionStore,LocalSessionStore,RedisSessionStore
A session store is used to store sessions for an Vert.x-Web web app
NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeArg<SessionStore>static final intDefault length for a session id. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Completableclear()Remove all sessions from the store.voidclose()Close the storestatic SessionStorecreate(io.vertx.rxjava3.core.Vertx vertx) Create a Session store given a backend and configuration JSON.static SessionStorecreate(io.vertx.rxjava3.core.Vertx vertx, JsonObject options) Create a Session store given a backend and configuration JSON.createSession(long timeout) Create a new session using the default min length.createSession(long timeout, int length) Create a new session.io.reactivex.rxjava3.core.CompletableDelete the session with the specified ID.booleanio.reactivex.rxjava3.core.Maybe<Session>Get the session with the specified ID.inthashCode()init(io.vertx.rxjava3.core.Vertx vertx, JsonObject options) Initialize this store.static SessionStorenewInstance(SessionStore arg) io.reactivex.rxjava3.core.CompletableAdd a session with the specified ID.longThe retry timeout value in milli seconds used by the session handler when it retrieves a value from the store.io.reactivex.rxjava3.core.CompletablerxClear()Remove all sessions from the store.io.reactivex.rxjava3.core.CompletableDelete the session with the specified ID.io.reactivex.rxjava3.core.Maybe<Session>Get the session with the specified ID.io.reactivex.rxjava3.core.CompletableAdd a session with the specified ID.io.reactivex.rxjava3.core.Single<Integer>rxSize()Get the number of sessions in the store.io.reactivex.rxjava3.core.Single<Integer>size()Get the number of sessions in the store.toString()
-
Field Details
-
__TYPE_ARG
-
DEFAULT_SESSIONID_LENGTH
public static final int DEFAULT_SESSIONID_LENGTHDefault length for a session id. More info: https://www.owasp.org/index.php/Session_Management_Cheat_Sheet- See Also:
-
-
Constructor Details
-
SessionStore
-
SessionStore
-
-
Method Details
-
toString
-
equals
-
hashCode
public int hashCode() -
getDelegate
- Specified by:
getDelegatein interfaceRxDelegate
-
create
Create a Session store given a backend and configuration JSON.- Parameters:
vertx- vertx instance- Returns:
- the store or runtime exception
-
create
Create a Session store given a backend and configuration JSON.- Parameters:
vertx- vertx instanceoptions- extra options for initialization- Returns:
- the store or runtime exception
-
init
Initialize this store.- Parameters:
vertx- the vertx instanceoptions- optional Json with extra configuration options- Returns:
- self
-
retryTimeout
public 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.- Returns:
- the timeout value, in ms
-
createSession
Create a new session using the default min length.- Parameters:
timeout- - the session timeout, in ms- Returns:
- the session
-
createSession
Create a new session.- Parameters:
timeout- - the session timeout, in mslength- - the required length for the session id- Returns:
- the session
-
get
Get the session with the specified ID.- Parameters:
cookieValue- the unique ID of the session- Returns:
- future that will be called with a result holding the session, or a failure
-
rxGet
Get the session with the specified ID.- Parameters:
cookieValue- the unique ID of the session- Returns:
- future that will be called with a result holding the session, or a failure
-
delete
Delete the session with the specified ID.- Parameters:
id- the session id- Returns:
- future that will be called with a result, or a failure
-
rxDelete
Delete the session with the specified ID.- Parameters:
id- the session id- Returns:
- future that will be called with a result, or a failure
-
put
Add a session with the specified ID.- Parameters:
session- the session- Returns:
- future that will be called with a result, or a failure
-
rxPut
Add a session with the specified ID.- Parameters:
session- the session- Returns:
- future that will be called with a result, or a failure
-
clear
public io.reactivex.rxjava3.core.Completable clear()Remove all sessions from the store.- Returns:
- future that will be called with a result, or a failure
-
rxClear
public io.reactivex.rxjava3.core.Completable rxClear()Remove all sessions from the store.- Returns:
- future that will be called with a result, or a failure
-
size
Get the number of sessions in the store.Beware of the result which is just an estimate, in particular with distributed session stores.
- Returns:
- future that will be called with a result, or a failure
-
rxSize
Get the number of sessions in the store.Beware of the result which is just an estimate, in particular with distributed session stores.
- Returns:
- future that will be called with a result, or a failure
-
close
public void close()Close the store -
newInstance
-