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 theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<SessionStore>
__TYPE_ARG
static int
DEFAULT_SESSIONID_LENGTH
Default 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.Void
clearAndAwait()
Blocking variant ofclear()
.void
clearAndForget()
Variant ofclear()
that ignores the result of the operation.void
close()
static SessionStore
create(Vertx vertx)
static SessionStore
create(Vertx vertx, io.vertx.core.json.JsonObject options)
Session
createSession(long timeout)
Session
createSession(long timeout, int length)
io.smallrye.mutiny.Uni<Void>
delete(String id)
Delete the session with the specified ID.Void
deleteAndAwait(String id)
Blocking variant ofdelete(String)
.void
deleteAndForget(String id)
Variant ofdelete(String)
that ignores the result of the operation.boolean
equals(Object o)
io.smallrye.mutiny.Uni<Session>
get(String cookieValue)
Get the session with the specified ID.Session
getAndAwait(String cookieValue)
Blocking variant ofget(String)
.void
getAndForget(String cookieValue)
Variant ofget(String)
that ignores the result of the operation.io.vertx.ext.web.sstore.SessionStore
getDelegate()
int
hashCode()
SessionStore
init(Vertx vertx, io.vertx.core.json.JsonObject options)
static SessionStore
newInstance(io.vertx.ext.web.sstore.SessionStore arg)
io.smallrye.mutiny.Uni<Void>
put(Session session)
Add a session with the specified ID.Void
putAndAwait(Session session)
Blocking variant ofput(io.vertx.mutiny.ext.web.Session)
.void
putAndForget(Session session)
Variant ofput(io.vertx.mutiny.ext.web.Session)
that ignores the result of the operation.long
retryTimeout()
io.smallrye.mutiny.Uni<Integer>
size()
Get the number of sessions in the store.Integer
sizeAndAwait()
Blocking variant ofsize()
.void
sizeAndForget()
Variant ofsize()
that ignores the result of the operation.String
toString()
-
-
-
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
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
uni
firing 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 void 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
-
delete
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
uni
firing 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 void 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
-
put
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
uni
firing 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 void 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
-
clear
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
uni
firing 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 void clearAndForget()
-
size
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
uni
firing 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 void sizeAndForget()
-
close
public void close()
-
newInstance
public static SessionStore newInstance(io.vertx.ext.web.sstore.SessionStore arg)
-
-