Class SessionStore
- java.lang.Object
-
- io.vertx.mutiny.ext.web.sstore.SessionStore
-
- Direct Known Subclasses:
ClusteredSessionStore,LocalSessionStore
public class SessionStore extends Object
A session store is used to store sessions for an Vert.x-Web web app NOTE: This class has been automatically generated from theoriginalnon Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<SessionStore>__TYPE_ARGstatic intDEFAULT_SESSIONID_LENGTHDefault length for a session id.
-
Constructor Summary
Constructors Constructor Description SessionStore(io.vertx.ext.web.sstore.SessionStore delegate)SessionStore(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description io.smallrye.mutiny.Uni<Void>clear()Remove all sessions from the store.VoidclearAndAwait()Blocking variant ofclear().SessionStoreclearAndForget()Variant ofclear()that ignores the result of the operation.voidclose()static SessionStorecreate(Vertx vertx)static SessionStorecreate(Vertx vertx, io.vertx.core.json.JsonObject options)SessioncreateSession(long timeout)SessioncreateSession(long timeout, int length)io.smallrye.mutiny.Uni<Void>delete(String id)Delete the session with the specified ID.VoiddeleteAndAwait(String id)Blocking variant ofdelete(String).SessionStoredeleteAndForget(String id)Variant ofdelete(String)that ignores the result of the operation.booleanequals(Object o)io.smallrye.mutiny.Uni<Session>get(String cookieValue)Get the session with the specified ID.SessiongetAndAwait(String cookieValue)Blocking variant ofget(String).SessionStoregetAndForget(String cookieValue)Variant ofget(String)that ignores the result of the operation.io.vertx.ext.web.sstore.SessionStoregetDelegate()inthashCode()SessionStoreinit(Vertx vertx, io.vertx.core.json.JsonObject options)static SessionStorenewInstance(io.vertx.ext.web.sstore.SessionStore arg)io.smallrye.mutiny.Uni<Void>put(Session session)Add a session with the specified ID.VoidputAndAwait(Session session)Blocking variant ofput(io.vertx.mutiny.ext.web.Session).SessionStoreputAndForget(Session session)Variant ofput(io.vertx.mutiny.ext.web.Session)that ignores the result of the operation.longretryTimeout()io.smallrye.mutiny.Uni<Integer>size()Get the number of sessions in the store.IntegersizeAndAwait()Blocking variant ofsize().SessionStoresizeAndForget()Variant ofsize()that ignores the result of the operation.StringtoString()
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<SessionStore> __TYPE_ARG
-
DEFAULT_SESSIONID_LENGTH
public static final int DEFAULT_SESSIONID_LENGTH
Default length for a session id. More info: https://www.owasp.org/index.php/Session_Management_Cheat_Sheet- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SessionStore
public SessionStore(io.vertx.ext.web.sstore.SessionStore delegate)
-
SessionStore
public SessionStore(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.web.sstore.SessionStore getDelegate()
-
create
public static SessionStore create(Vertx vertx)
- Parameters:
vertx- vertx instance- Returns:
- the store or runtime exception
-
create
public static SessionStore create(Vertx vertx, io.vertx.core.json.JsonObject options)
- Parameters:
vertx- vertx instanceoptions- extra options for initialization- Returns:
- the store or runtime exception
-
init
public SessionStore init(Vertx vertx, io.vertx.core.json.JsonObject options)
- Parameters:
vertx- the vertx instanceoptions- optional Json with extra configuration options- Returns:
- self
-
retryTimeout
public long retryTimeout()
- Returns:
- the timeout value, in ms
-
createSession
public Session createSession(long timeout)
- Parameters:
timeout- - the session timeout, in ms- Returns:
- the session
-
createSession
public Session createSession(long timeout, int length)
- Parameters:
timeout- - the session timeout, in mslength- - the required length for the session id- Returns:
- the session
-
get
@CheckReturnValue public io.smallrye.mutiny.Uni<Session> get(String cookieValue)
Get the session with the specified ID.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
cookieValue- the unique ID of the session- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
getAndAwait
public Session getAndAwait(String cookieValue)
Blocking variant ofget(String).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
cookieValue- the unique ID of the session- Returns:
- the Session instance produced by the operation.
-
getAndForget
public SessionStore getAndForget(String cookieValue)
Variant ofget(String)that ignores the result of the operation.This method subscribes on the result of
get(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromget(String)but you don't need to compose it with other operations.- Parameters:
cookieValue- the unique ID of the session- Returns:
- the instance of SessionStore to chain method calls.
-
delete
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> delete(String id)
Delete the session with the specified ID.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
id- the session id- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
deleteAndAwait
public Void deleteAndAwait(String id)
Blocking variant ofdelete(String).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
id- the session id- Returns:
- the Void instance produced by the operation.
-
deleteAndForget
public SessionStore deleteAndForget(String id)
Variant ofdelete(String)that ignores the result of the operation.This method subscribes on the result of
delete(String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromdelete(String)but you don't need to compose it with other operations.- Parameters:
id- the session id- Returns:
- the instance of SessionStore to chain method calls.
-
put
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> put(Session session)
Add a session with the specified ID.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Parameters:
session- the session- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
putAndAwait
public Void putAndAwait(Session session)
Blocking variant ofput(io.vertx.mutiny.ext.web.Session).This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Parameters:
session- the session- Returns:
- the Void instance produced by the operation.
-
putAndForget
public SessionStore putAndForget(Session session)
Variant ofput(io.vertx.mutiny.ext.web.Session)that ignores the result of the operation.This method subscribes on the result of
put(io.vertx.mutiny.ext.web.Session), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromput(io.vertx.mutiny.ext.web.Session)but you don't need to compose it with other operations.- Parameters:
session- the session- Returns:
- the instance of SessionStore to chain method calls.
-
clear
@CheckReturnValue public io.smallrye.mutiny.Uni<Void> clear()
Remove all sessions from the store.Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
clearAndAwait
public Void clearAndAwait()
Blocking variant ofclear().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Void instance produced by the operation.
-
clearAndForget
public SessionStore clearAndForget()
Variant ofclear()that ignores the result of the operation.This method subscribes on the result of
clear(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromclear()but you don't need to compose it with other operations.- Returns:
- the instance of SessionStore to chain method calls.
-
size
@CheckReturnValue public io.smallrye.mutiny.Uni<Integer> size()
Get the number of sessions in the store.Beware of the result which is just an estimate, in particular with distributed session stores.
Unlike the bare Vert.x variant, this method returns a
Uni. Don't forget to subscribe on it to trigger the operation.- Returns:
- the
unifiring the result of the operation when completed, or a failure if the operation failed.
-
sizeAndAwait
public Integer sizeAndAwait()
Blocking variant ofsize().This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).
- Returns:
- the Integer instance produced by the operation.
-
sizeAndForget
public SessionStore sizeAndForget()
Variant ofsize()that ignores the result of the operation.This method subscribes on the result of
size(), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation fromsize()but you don't need to compose it with other operations.- Returns:
- the instance of SessionStore to chain method calls.
-
close
public void close()
-
newInstance
public static SessionStore newInstance(io.vertx.ext.web.sstore.SessionStore arg)
-
-