Interface SessionTracker

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean addGlobalSession​(long id, int to)
      Add a global session to those being tracked.
      boolean addSession​(long id, int to)
      Add a session to those being tracked.
      void checkGlobalSession​(long sessionId, java.lang.Object owner)
      Strictly check that a given session is a global session or not
      void checkSession​(long sessionId, java.lang.Object owner)
      Checks whether the SessionTracker is aware of this session, the session is still active, and the owner matches.
      long createSession​(int sessionTimeout)  
      void dumpSessions​(java.io.PrintWriter pwriter)
      Text dump of session information, suitable for debugging.
      java.util.Map<java.lang.Long,​java.util.Set<java.lang.Long>> getSessionExpiryMap()
      Returns a mapping of time to session IDs that expire at that time.
      boolean isTrackingSession​(long sessionId)  
      void removeSession​(long sessionId)  
      void setOwner​(long id, java.lang.Object owner)  
      void setSessionClosing​(long sessionId)
      Mark that the session is in the process of closing.
      void shutdown()  
      boolean touchSession​(long sessionId, int sessionTimeout)  
    • Method Detail

      • createSession

        long createSession​(int sessionTimeout)
      • addGlobalSession

        boolean addGlobalSession​(long id,
                                 int to)
        Add a global session to those being tracked.
        Parameters:
        id - sessionId
        to - sessionTimeout
        Returns:
        whether the session was newly added (if false, already existed)
      • addSession

        boolean addSession​(long id,
                           int to)
        Add a session to those being tracked. The session is added as a local session if they are enabled, otherwise as global.
        Parameters:
        id - sessionId
        to - sessionTimeout
        Returns:
        whether the session was newly added (if false, already existed)
      • touchSession

        boolean touchSession​(long sessionId,
                             int sessionTimeout)
        Parameters:
        sessionId -
        sessionTimeout -
        Returns:
        false if session is no longer active
      • setSessionClosing

        void setSessionClosing​(long sessionId)
        Mark that the session is in the process of closing.
        Parameters:
        sessionId -
      • shutdown

        void shutdown()
      • removeSession

        void removeSession​(long sessionId)
        Parameters:
        sessionId -
      • isTrackingSession

        boolean isTrackingSession​(long sessionId)
        Parameters:
        sessionId -
        Returns:
        whether or not the SessionTracker is aware of this session
      • dumpSessions

        void dumpSessions​(java.io.PrintWriter pwriter)
        Text dump of session information, suitable for debugging.
        Parameters:
        pwriter - the output writer
      • getSessionExpiryMap

        java.util.Map<java.lang.Long,​java.util.Set<java.lang.Long>> getSessionExpiryMap()
        Returns a mapping of time to session IDs that expire at that time.