Class SessionHolder<T>


  • public class SessionHolder<T>
    extends Object
    A session holder. It is created after successful authentication, and initially retains just the authenticated user name and client context at that time. In later calls during the same session, the service implementations may associate session data with the holder; it is the responsibility of the service implementations to ensure thread safety in manipulating that data.
    Since:
    1.0.0
    Version:
    $Id: SessionHolder.java 17411 2017-04-28 14:50:38Z colin $
    Author:
    tlerios@marketcetera.com
    • Field Detail

      • mUser

        private final String mUser
      • mLastAccess

        private long mLastAccess
      • mSession

        private T mSession
    • Constructor Detail

      • SessionHolder

        public SessionHolder​(String user,
                             StatelessClientContext creationContext)
        Creates a new holder with the given authenticated user name and creation context.
        Parameters:
        user - The user name.
        creationContext - The context.
    • Method Detail

      • getUser

        public String getUser()
        Returns the receiver's user.
        Returns:
        The user.
      • getCreationContext

        public StatelessClientContext getCreationContext()
        Returns the receiver's creation context.
        Returns:
        The context.
      • markAccess

        void markAccess()
        Sets the receiver's most recent access timestamp to the present time.
      • getLastAccess

        long getLastAccess()
        Returns the receiver's most recent access timestamp.
        Returns:
        The timestamp.
      • setSession

        public void setSession​(T session)
        Sets the receiver's session data to the given value.
        Parameters:
        session - The data, which may be null.
      • getSession

        public T getSession()
        Returns the receiver's session data.
        Returns:
        The data, which may be null.