Class CookieBasedSessionManager
- java.lang.Object
-
- org.forgerock.openig.session.cookie.CookieBasedSessionManager
-
- All Implemented Interfaces:
AsyncSessionManager
public class CookieBasedSessionManager extends Object implements AsyncSessionManager
An implementation ofAsyncSessionManager
storing sessions in memory.
-
-
Constructor Summary
Constructors Constructor Description CookieBasedSessionManager(org.forgerock.openig.http.protocol.CookieBuilder cookieBuilder, LocalSessionStore sessionStore)
Create a newCookieBasedSessionManager
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Promise<Session,NeverThrowsException>
loadAsync(Request request)
Loads a new Session for the givenRequest
.Promise<Void,IOException>
saveAsync(Session session, Response response)
Saves the session into the provided response.
-
-
-
Constructor Detail
-
CookieBasedSessionManager
public CookieBasedSessionManager(org.forgerock.openig.http.protocol.CookieBuilder cookieBuilder, LocalSessionStore sessionStore)
Create a newCookieBasedSessionManager
instance.- Parameters:
cookieBuilder
- the cookie builder to use to create the session cookie.sessionStore
- the session store to use to store the session content.
-
-
Method Detail
-
loadAsync
public Promise<Session,NeverThrowsException> loadAsync(Request request)
Description copied from interface:AsyncSessionManager
Loads a new Session for the givenRequest
. The implementations are free to keep a reference to theRequest
.The session object is scoped by the
Request
's own lifecycle.- Specified by:
loadAsync
in interfaceAsyncSessionManager
- Parameters:
request
- Request to create a session for.- Returns:
- a new Session promise (never null).
-
saveAsync
public Promise<Void,IOException> saveAsync(Session session, Response response)
Description copied from interface:AsyncSessionManager
Saves the session into the provided response.- Specified by:
saveAsync
in interfaceAsyncSessionManager
- Parameters:
session
- The session to save.response
- The response to save the session to.- Returns:
- a promise completed with null if save operation succeeded, otherwise failed with an
IOException
.
-
-