Interface SessionStore
- All Known Subinterfaces:
ClusteredSessionStore, CookieSessionStore, InfinispanSessionStore, LocalSessionStore, RedisSessionStore
public interface SessionStore
A session store is used to store sessions for an Vert.x-Web web app
- Author:
- Tim Fox, Paulo Lopes
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault length for a session id. -
Method Summary
Modifier and TypeMethodDescriptionclear()Remove all sessions from the store.voidclose()Close the storestatic SessionStoreCreate a Session store given a backend and configuration JSON.static SessionStorecreate(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.Delete the session with the specified ID.Get the session with the specified ID.init(Vertx vertx, JsonObject options) Initialize this store.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.size()Get the number of sessions in the store.
-
Field Details
-
DEFAULT_SESSIONID_LENGTH
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:
-
-
Method Details
-
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
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
-
delete
-
put
-
clear
-
size
-
close
void close()Close the store
-