Class StatelessSession

  • All Implemented Interfaces:
    Blacklistable, AMSession

    public class StatelessSession
    extends Session
    The StatelessSession class represents a stateless session. It is a simple overridden version of Session which allows for the addition of extra methods, or overriding of inherited ones.
    • Field Detail

      • RESTRICTED_TOKENS_UNSUPPORTED

        public static final String RESTRICTED_TOKENS_UNSUPPORTED
      • SSOTOKEN_LISTENERS_UNSUPPORTED

        public static final String SSOTOKEN_LISTENERS_UNSUPPORTED
    • Constructor Detail

      • StatelessSession

        public StatelessSession​(SessionID sid,
                                SessionInfo sessionInfo,
                                StatelessSessionManager statelessSessionManager)
                         throws SessionException
        Constructs the stateless session with the given ID, session state and session factory.
        Parameters:
        sid - the initial ID of the session.
        sessionInfo - the initial of the session.
        statelessSessionManager - the factory to use for regenerating the session ID when the state of the session changes.
        Throws:
        SessionException - if an exception occurs.
    • Method Detail

      • dereferenceRestrictedTokenID

        public String dereferenceRestrictedTokenID​(Session session,
                                                   String restrictedId)
                                            throws SessionException
        Description copied from class: Session
        Given a restricted token, returns the SSOTokenID of the master token can only be used if the requester is an app token This functionality is only available in server mode.
        Overrides:
        dereferenceRestrictedTokenID in class Session
        Parameters:
        session - Must be an app token
        restrictedId - The SSOTokenID of the restricted token
        Returns:
        The SSOTokenID string of the master token
        Throws:
        SessionException - If the master token cannot be dereferenced
      • setRestriction

        protected void setRestriction​(TokenRestriction restriction)
        Description copied from class: Session
        Sets a token restriction on this session. Optional operation - specific sub-classes can throw an exception if not supported.
        Overrides:
        setRestriction in class Session
        Parameters:
        restriction - the restriction to apply to this session.
      • maxCachingTimeReached

        public boolean maxCachingTimeReached()
        Description copied from class: Session
        Used to find out if the maximum caching time has reached or not.
        Overrides:
        maxCachingTimeReached in class Session
      • getPropertyNames

        public Set<String> getPropertyNames()
      • getProperty

        public String getProperty​(String name)
                           throws SessionException
        Description copied from class: Session
        Gets the property stored in this session.
        Overrides:
        getProperty in class Session
        Parameters:
        name - The property name.
        Returns:
        The property value in String format.
        Throws:
        SessionException - is thrown if the session reached its maximum session time, or the session was destroyed, or there was an error during communication with session service.
      • setProperty

        public void setProperty​(String name,
                                String value)
                         throws SessionException
        Description copied from class: Session
        Sets a property for this session.
        Overrides:
        setProperty in class Session
        Parameters:
        name - The property name.
        value - The property value.
        Throws:
        SessionException - if the session reached its maximum session time, or the session was destroyed, or there was an error during communication with session service, or if the property name or value was null.
      • getState

        public SessionState getState​(boolean reset)
                              throws SessionException
        Description copied from class: Session
        Returns the state of the session.
        Overrides:
        getState in class Session
        Parameters:
        reset - This parameter indicates that whether the Session Service needs to reset the latest access time on this session.
        Returns:
        The state of the session. The session state is one of the following: INVALID, VALID, INACTIVE, and DESTROYED.
        Throws:
        SessionException - is thrown if the session reached its maximum session time, or the session was destroyed, or there was an error during communication with session service.