Class SessionStore
- All Implemented Interfaces:
MutinyDelegate
- Direct Known Subclasses:
ClusteredSessionStore
,CookieSessionStore
,InfinispanSessionStore
,LocalSessionStore
,RedisSessionStore
original
non Mutiny-ified interface using Vert.x codegen.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeArg<SessionStore>
static final int
Default length for a session id. -
Constructor Summary
ConstructorsConstructorDescriptionSessionStore
(io.vertx.ext.web.sstore.SessionStore delegate) SessionStore
(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Void>
clear()
Remove all sessions from the store.Blocking variant ofclear()
.Variant ofclear()
that ignores the result of the operation.void
close()
static SessionStore
static SessionStore
createSession
(long timeout) createSession
(long timeout, int length) io.smallrye.mutiny.Uni<Void>
Delete the session with the specified ID.deleteAndAwait
(String id) Blocking variant ofdelete(String)
.Variant ofdelete(String)
that ignores the result of the operation.boolean
io.smallrye.mutiny.Uni<Session>
Get the session with the specified ID.getAndAwait
(String cookieValue) Blocking variant ofget(String)
.getAndForget
(String cookieValue) Variant ofget(String)
that ignores the result of the operation.io.vertx.ext.web.sstore.SessionStore
int
hashCode()
static SessionStore
newInstance
(io.vertx.ext.web.sstore.SessionStore arg) io.smallrye.mutiny.Uni<Void>
Add a session with the specified ID.putAndAwait
(Session session) Blocking variant ofput(io.vertx.mutiny.ext.web.Session)
.putAndForget
(Session session) Variant ofput(io.vertx.mutiny.ext.web.Session)
that ignores the result of the operation.long
io.smallrye.mutiny.Uni<Integer>
size()
Get the number of sessions in the store.Blocking variant ofsize()
.Variant ofsize()
that ignores the result of the operation.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
public SessionStore(io.vertx.ext.web.sstore.SessionStore delegate) -
SessionStore
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.sstore.SessionStore getDelegate()- Specified by:
getDelegate
in interfaceMutinyDelegate
- Returns:
- the delegate used by this Mutiny object of generated type
-
toString
-
equals
-
hashCode
public int hashCode() -
create
- Parameters:
vertx
- vertx instance- Returns:
- the store or runtime exception
-
create
- Parameters:
vertx
- vertx instanceoptions
- extra options for initialization- Returns:
- the store or runtime exception
-
init
- Parameters:
vertx
- the vertx instanceoptions
- optional Json with extra configuration options- Returns:
- self
-
retryTimeout
public long retryTimeout()- Returns:
- the timeout value, in ms
-
createSession
- Parameters:
timeout
- - the session timeout, in ms- Returns:
- the session
-
createSession
- 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.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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
-