Interface SessionDataStore

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean delete​(java.lang.String id)
      Delete session data.
      boolean exists​(java.lang.String id)
      Test if data exists for a given session id.
      java.util.Set<java.lang.String> getExpired​(java.util.Set<java.lang.String> candidates)
      Called periodically, this method should search the data store for sessions that have been expired for a 'reasonable' amount of time.
      boolean isPassivating()
      True if this type of datastore will passivate session objects.
      SessionData load​(java.lang.String id)
      Read in session data.
      SessionData newSessionData​(java.lang.String id, long createdTime, long accessedTime, long lastAccessedTime, long maxInactiveIntervalMS)
      Create a new SessionData.
      void store​(java.lang.String id, SessionData sessionData)
      Store the session data.
    • Method Detail

      • load

        SessionData load​(java.lang.String id)
                  throws java.lang.Exception
        Read in session data.
        Parameters:
        id - identity of session to load
        Returns:
        the SessionData matching the id
        Throws:
        java.lang.Exception - if unable to load session data
      • store

        void store​(java.lang.String id,
                   SessionData sessionData)
            throws java.lang.Exception
        Store the session data.
        Parameters:
        id - identity of session to store
        sessionData - info of session to store
        Throws:
        java.lang.Exception - if unable to write session data
      • delete

        boolean delete​(java.lang.String id)
                throws java.lang.Exception
        Delete session data.
        Parameters:
        id - identity of session to delete
        Returns:
        true if the session was deleted
        Throws:
        java.lang.Exception - if unable to delete session data
      • exists

        boolean exists​(java.lang.String id)
                throws java.lang.Exception
        Test if data exists for a given session id.
        Parameters:
        id - Identity of session whose existence should be checked
        Returns:
        true if valid, non-expired session exists
        Throws:
        java.lang.Exception - if there is a problem checking the existence with persistence layer
      • newSessionData

        SessionData newSessionData​(java.lang.String id,
                                   long createdTime,
                                   long accessedTime,
                                   long lastAccessedTime,
                                   long maxInactiveIntervalMS)
        Create a new SessionData.
        Parameters:
        id - the id
        createdTime - the timestamp when created
        accessedTime - the timestamp when accessed
        lastAccessedTime - the timestamp when last accessed
        maxInactiveIntervalMS - the max inactive time in milliseconds
        Returns:
        a new SessionData object
      • getExpired

        java.util.Set<java.lang.String> getExpired​(java.util.Set<java.lang.String> candidates)
        Called periodically, this method should search the data store for sessions that have been expired for a 'reasonable' amount of time.
        Parameters:
        candidates - if provided, these are keys of sessions that the SessionDataStore thinks has expired and should be verified by the SessionDataStore
        Returns:
        set of session ids
      • isPassivating

        boolean isPassivating()
        True if this type of datastore will passivate session objects.
        Returns:
        true if this store can passivate sessions; false otherwise