Class CookiePersistentManager

    • Constructor Detail

      • CookiePersistentManager

        public CookiePersistentManager()
    • Method Detail

      • setCookieName

        public void setCookieName​(String cookieName)
      • add

        public void add​(Session session)
        Description copied from class: ManagerBase
        Add this Session to the set of active Sessions for this Manager.
        Specified by:
        add in interface Manager
        Overrides:
        add in class ManagerBase
        Parameters:
        session - Session to be added
      • findSession

        public Session findSession​(String id,
                                   jakarta.servlet.http.HttpServletRequest request)
                            throws IOException
        Description copied from interface: Manager
        Gets the session with the given id from the given request.
        Specified by:
        findSession in interface Manager
        Overrides:
        findSession in class ManagerBase
        Parameters:
        id - the session id
        request - the request containing the requested session information
        Returns:
        the requested session, or null if not found
        Throws:
        IOException
      • clearSessions

        public void clearSessions()
        Description copied from class: ManagerBase
        clear out the sessions cache HERCULES:added
        Overrides:
        clearSessions in class ManagerBase
      • findSessions

        public List<Session> findSessions()
        Description copied from interface: Manager
        Return the set of active Sessions associated with this Manager. If this Manager has no active Sessions, a empty list is returned.
        Specified by:
        findSessions in interface Manager
        Overrides:
        findSessions in class ManagerBase
        Returns:
        associated sessions
      • remove

        public void remove​(Session session)
        Description copied from class: ManagerBase
        Remove this Session from the active Sessions for this Manager.
        Specified by:
        remove in interface Manager
        Overrides:
        remove in class ManagerBase
        Parameters:
        session - Session to be removed
      • toCookie

        public jakarta.servlet.http.Cookie toCookie​(Session session)
                                             throws IOException
        Description copied from interface: Manager
        Converts the given session into a cookie as a way of persisting it.
        Specified by:
        toCookie in interface Manager
        Overrides:
        toCookie in class ManagerBase
        Parameters:
        session - the session to convert
        Returns:
        the cookie representation of the given session
        Throws:
        IOException
      • checkSessionAttribute

        public void checkSessionAttribute​(String name,
                                          Object value)
        Description copied from interface: Manager
        Checks the given session attribute name and value to make sure they comply with any restrictions set forth by this session manager. For example, in the case of cookie-based persistence, session attribute values must be of type String.
        Specified by:
        checkSessionAttribute in interface Manager
        Overrides:
        checkSessionAttribute in class ManagerBase
        Parameters:
        name - the session attribute name
        value - the session attribute value