Class CrestSessionService
java.lang.Object
org.forgerock.openig.tools.session.CrestSessionService
- All Implemented Interfaces:
SessionService
The
CrestSessionService is responsible for performing interactions with the AM sessions endpoint.-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic CrestSessionService.Builderbuilder(RequestHandler sessionInfoRequestHandler, RequestHandler logoutRequestHandler, Clock clock) Returns a newCrestSessionService.Builderfor creating a newCrestSessionServiceinstance.getSessionInfo(Context context, String ssoToken) Returns a promise that will be completed with an optionalSessionInfoor with anSessionExceptionin case of errors.Returns a promise that will be completed with aVoidor with anSessionExceptionin case of errors.
-
Method Details
-
builder
public static CrestSessionService.Builder builder(RequestHandler sessionInfoRequestHandler, RequestHandler logoutRequestHandler, Clock clock) Returns a newCrestSessionService.Builderfor creating a newCrestSessionServiceinstance.- Parameters:
sessionInfoRequestHandler- The sessionInfoRequestHandler used when interacting with the AM session info endpoint.logoutRequestHandler- The logoutRequestHandler used when interacting with the AM session logout endpoint.clock- The clock to use for any time-based functions.- Returns:
- a new builder
-
getSessionInfo
public Promise<Optional<SessionInfo>,SessionException> getSessionInfo(Context context, String ssoToken) Description copied from interface:SessionServiceReturns a promise that will be completed with an optionalSessionInfoor with anSessionExceptionin case of errors. The optionalSessionInfowill be empty only when the givenssoTokenis invalid or expired.- Specified by:
getSessionInfoin interfaceSessionService- Parameters:
context- The request context.ssoToken- The ssoToken used to retrieve the session information about.- Returns:
- a promise that will be completed with
SessionInfoor with anSessionExceptionin case of errors.
-
logout
Description copied from interface:SessionServiceReturns a promise that will be completed with aVoidor with anSessionExceptionin case of errors.- Specified by:
logoutin interfaceSessionService- Parameters:
context- The request context.ssoToken- The ssoToken to logout.- Returns:
- a promise that will be completed with a
Voidor with anSessionExceptionin case of errors.
-