Class CrestSessionService

    • Method Detail

      • builder

        public static CrestSessionService.Builder builder​(RequestHandler sessionInfoRequestHandler,
                                                          RequestHandler logoutRequestHandler,
                                                          Clock clock)
        Returns a new CrestSessionService.Builder for creating a new CrestSessionService instance.
        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: SessionService
        Returns a promise that will be completed with an optional SessionInfo or with an SessionException in case of errors. The optional SessionInfo will be empty only when the given ssoToken is invalid or expired.
        Specified by:
        getSessionInfo in interface SessionService
        Parameters:
        context - The request context.
        ssoToken - The ssoToken used to retrieve the session information about.
        Returns:
        a promise that will be completed with SessionInfo or with an SessionException in case of errors.
      • logout

        public Promise<Void,​SessionException> logout​(Context context,
                                                           String ssoToken)
        Description copied from interface: SessionService
        Returns a promise that will be completed with a Void or with an SessionException in case of errors.
        Specified by:
        logout in interface SessionService
        Parameters:
        context - The request context.
        ssoToken - The ssoToken to logout.
        Returns:
        a promise that will be completed with a Void or with an SessionException in case of errors.