Package com.oorian

Interface OorianHttpSession

All Known Implementing Classes:
JakartaHttpSession, MockOorianHttpSession, TestHttpSession

public interface OorianHttpSession
Abstraction layer for HTTP session access, decoupling framework code from servlet API specifics.

This interface wraps the subset of HTTP session methods used by the Oorian framework.

Since:
2.1
Version:
1.0
Author:
Marvin P. Warble Jr.
  • Method Details

    • getId

      String getId()
      Returns the unique session identifier.
      Returns:
      the session ID
    • getCreationTime

      long getCreationTime()
      Returns the time the session was created.
      Returns:
      the creation time in milliseconds since epoch
    • getLastAccessedTime

      long getLastAccessedTime()
      Returns the time of last client access.
      Returns:
      the last access time in milliseconds since epoch
    • setMaxInactiveInterval

      void setMaxInactiveInterval(int interval)
      Sets the maximum time interval between requests before the session expires.
      Parameters:
      interval - the interval in seconds
    • getMaxInactiveInterval

      int getMaxInactiveInterval()
      Returns the maximum inactive interval for this session.
      Returns:
      the interval in seconds
    • getAttribute

      Object getAttribute(String name)
      Returns the session attribute with the specified name.
      Parameters:
      name - the attribute name
      Returns:
      the attribute value, or null if not found
    • getAttributeNames

      Enumeration<String> getAttributeNames()
      Returns an enumeration of all attribute names in this session.
      Returns:
      enumeration of attribute names
    • setAttribute

      void setAttribute(String name, Object value)
      Sets a session attribute.
      Parameters:
      name - the attribute name
      value - the attribute value
    • removeAttribute

      void removeAttribute(String name)
      Removes a session attribute.
      Parameters:
      name - the attribute name to remove
    • invalidate

      void invalidate()
      Invalidates this session.
    • isNew

      boolean isNew()
      Checks if the session was newly created.
      Returns:
      true if the session is new