public class SessionForRequest
extends java.lang.Object
Constructor and Description |
---|
SessionForRequest() |
Modifier and Type | Method and Description |
---|---|
static Session |
create(SessionStore sessionStore,
HttpRequest<?> request)
Creates a session and stores it in the request attributes.
|
static java.util.Optional<Session> |
find(HttpRequest<?> request)
Finds a session.
|
static Session |
findOrCreate(HttpRequest<?> request,
SessionStore sessionStore)
Finds a session or creates a new one and stores it in the request attributes.
|
public static Session create(SessionStore sessionStore, HttpRequest<?> request)
sessionStore
- the session storerequest
- the Http Requestpublic static java.util.Optional<Session> find(HttpRequest<?> request)
request
- the Http Requestpublic static Session findOrCreate(HttpRequest<?> request, SessionStore sessionStore)
request
- The Http RequestsessionStore
- The session store to create the session if not found