Class SessionStore
- All Implemented Interfaces:
MutinyDelegate
- Direct Known Subclasses:
ClusteredSessionStore,LocalSessionStore
NOTE: This class has been automatically generated from the original non Mutiny-ified interface.
- Author:
- Tim Fox, Paulo Lopes
- See Also:
-
SessionStore
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TypeArg<SessionStore>static final intDefault length for a session id. -
Constructor Summary
ConstructorsConstructorDescriptionSessionStore(io.vertx.ext.web.sstore.SessionStore delegate) Create a new instance ofSessionStoredelegating to the given (non-null) instance ofSessionStore.SessionStore(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionio.smallrye.mutiny.Uni<Void>clear()Remove all sessions from the store.voidRemove all sessions from the store.Remove all sessions from the store.voidclose()Close the storestatic SessionStoreCreate a Session store given a backend and configuration JSON.static SessionStoreCreate 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.smallrye.mutiny.Uni<Void>Delete the session with the specified ID.voiddeleteAndAwait(String id) Delete the session with the specified ID.Delete the session with the specified ID.booleanio.smallrye.mutiny.Uni<Session>Get the session with the specified ID.getAndAwait(String cookieValue) Get the session with the specified ID.getAndForget(String cookieValue) Get the session with the specified ID.io.vertx.ext.web.sstore.SessionStoreGet the delegate instance.inthashCode()Initialize this store.static SessionStorenewInstance(io.vertx.ext.web.sstore.SessionStore delegate) Creates a new instance of theSessionStore.io.smallrye.mutiny.Uni<Void>Add a session with the specified ID.voidputAndAwait(Session session) Add a session with the specified ID.putAndForget(Session session) Add 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.smallrye.mutiny.Uni<Integer>size()Get the number of sessions in the store.Get the number of sessions in the store.Get the number of sessions in the store.toString()
-
Field Details
-
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:
-
__TYPE_ARG
-
-
Constructor Details
-
SessionStore
public SessionStore(io.vertx.ext.web.sstore.SessionStore delegate) Create a new instance ofSessionStoredelegating to the given (non-null) instance ofSessionStore. -
SessionStore
-
-
Method Details
-
getDelegate
public io.vertx.ext.web.sstore.SessionStore getDelegate()Get the delegate instance.This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.
- Specified by:
getDelegatein interfaceMutinyDelegate- Returns:
- the delegate instance
-
get
Get the session with the specified ID.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
cookieValue- the unique ID of the session- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SessionStore.get(String)
-
getAndAwait
Get the session with the specified ID.Unlike the bare Vert.x variant, this method returns a
Session. This method awaits indefinitely 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 aRuntimeException).- Parameters:
cookieValue- the unique ID of the session- Returns:
- The operation result
- See Also:
-
SessionStore.get(String)
-
getAndForget
Get the session with the specified ID.Unlike the bare Vert.x variant, this method ignores the
Sessionresult or any failure.- Parameters:
cookieValue- the unique ID of the session- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SessionStore.get(String)
-
delete
Delete the session with the specified ID.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
id- the session id- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SessionStore.delete(String)
-
deleteAndAwait
Delete the session with the specified ID.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
id- the session id- See Also:
-
SessionStore.delete(String)
-
deleteAndForget
Delete the session with the specified ID.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
id- the session id- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SessionStore.delete(String)
-
put
Add a session with the specified ID.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Parameters:
session- the session- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
io.vertx.ext.web.sstore.SessionStore#put(Session)
-
putAndAwait
Add a session with the specified ID.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- Parameters:
session- the session- See Also:
-
io.vertx.ext.web.sstore.SessionStore#put(Session)
-
putAndForget
Add a session with the specified ID.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Parameters:
session- the session- Returns:
- The current instance to chain operations if needed.
- See Also:
-
io.vertx.ext.web.sstore.SessionStore#put(Session)
-
clear
Remove all sessions from the store.Unlike the bare Vert.x variant, this method returns a
Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SessionStore.clear()
-
clearAndAwait
public void clearAndAwait()Remove all sessions from the store.Unlike the bare Vert.x variant, this method returns a
Void. This method awaits indefinitely 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 aRuntimeException).- See Also:
-
SessionStore.clear()
-
clearAndForget
Remove all sessions from the store.Unlike the bare Vert.x variant, this method ignores the
Voidresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SessionStore.clear()
-
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. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.Don't forget to subscribe on it to trigger the operation.
- Returns:
- A
Unirepresenting the asynchronous result of this operation. - See Also:
-
SessionStore.size()
-
sizeAndAwait
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
Integer. This method awaits indefinitely 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 aRuntimeException).- Returns:
- The operation result
- See Also:
-
SessionStore.size()
-
sizeAndForget
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 ignores the
Integerresult or any failure.- Returns:
- The current instance to chain operations if needed.
- See Also:
-
SessionStore.size()
-
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
-
close
public void close()Close the store -
newInstance
Creates a new instance of theSessionStore. -
hashCode
public int hashCode() -
equals
-
toString
-