Class SessionInfoFactory


  • public class SessionInfoFactory
    extends Object
    Responsible for providing a collection of utility functions for manipulating InternalSessions.
    • Constructor Detail

      • SessionInfoFactory

        public SessionInfoFactory()
    • Method Detail

      • getSessionInfo

        public SessionInfo getSessionInfo​(InternalSession internalSession,
                                          SessionID sessionID)
                                   throws SessionException
        Generates a SessionInfo which is a summary state of the Session used to refresh remote instances of a Session.
        Parameters:
        internalSession - Non null InternalSession to summarise.
        sessionID - SessionID of the caller making the request.
        Returns:
        Non null SessionInfo.
        Throws:
        SessionException - If there was a problem accessing the underlying Session.
      • validateSession

        public void validateSession​(InternalSession internalSession,
                                    SessionID sid)
                             throws SessionException
        Validates the state of an Internal Session against a Session ID. Performs two checks, firstly that the Session matches the SessionID and secondly that the InternalSession is not timed out.
        Parameters:
        internalSession - InternalSession to check.
        sid - SessionID to check with the InternalSession.
        Throws:
        SessionException - If the InternalSession has timed out.
        IllegalArgumentException - If the SessionID of the InternalSession and provided SessionID do not match.
      • makeSessionInfo

        public SessionInfo makeSessionInfo​(InternalSession internalSession,
                                           SessionID sid)
                                    throws SessionException
        Generates a SessionInfo object from the given InternalSession.
        Parameters:
        internalSession - Non null InternalSession to use.
        sid - Session ID for the user performing the action.
        Returns:
        A non null SessionInfo instance if valid.
        Throws:
        SessionException - If there was an error storing the TokenRestriction on the SessionInfo.
        IllegalAccessException - If this method has not been called in-conjunction with SessionInfoFactory#validateSession