Class JakartaHttpSession

java.lang.Object
com.oorian.jakarta.JakartaHttpSession
All Implemented Interfaces:
OorianHttpSession

public class JakartaHttpSession extends Object implements OorianHttpSession
Adapter that wraps a HttpSession to implement the framework-agnostic OorianHttpSession interface.

This class is used by the thin Jakarta library to bridge between the servlet container and the Oorian common library.

Since:
2.1
Version:
1.0
Author:
Oorian Framework
See Also:
  • Constructor Details

    • JakartaHttpSession

      public JakartaHttpSession(jakarta.servlet.http.HttpSession session)
      Creates a new adapter wrapping the given HTTP session.
      Parameters:
      session - The Jakarta HTTP session to wrap.
  • Method Details

    • getId

      public String getId()
      Description copied from interface: OorianHttpSession
      Returns the unique session identifier.
      Specified by:
      getId in interface OorianHttpSession
      Returns:
      the session ID
    • getCreationTime

      public long getCreationTime()
      Description copied from interface: OorianHttpSession
      Returns the time the session was created.
      Specified by:
      getCreationTime in interface OorianHttpSession
      Returns:
      the creation time in milliseconds since epoch
    • getLastAccessedTime

      public long getLastAccessedTime()
      Description copied from interface: OorianHttpSession
      Returns the time of last client access.
      Specified by:
      getLastAccessedTime in interface OorianHttpSession
      Returns:
      the last access time in milliseconds since epoch
    • setMaxInactiveInterval

      public void setMaxInactiveInterval(int interval)
      Description copied from interface: OorianHttpSession
      Sets the maximum time interval between requests before the session expires.
      Specified by:
      setMaxInactiveInterval in interface OorianHttpSession
      Parameters:
      interval - the interval in seconds
    • getMaxInactiveInterval

      public int getMaxInactiveInterval()
      Description copied from interface: OorianHttpSession
      Returns the maximum inactive interval for this session.
      Specified by:
      getMaxInactiveInterval in interface OorianHttpSession
      Returns:
      the interval in seconds
    • getAttribute

      public Object getAttribute(String name)
      Description copied from interface: OorianHttpSession
      Returns the session attribute with the specified name.
      Specified by:
      getAttribute in interface OorianHttpSession
      Parameters:
      name - the attribute name
      Returns:
      the attribute value, or null if not found
    • getAttributeNames

      public Enumeration<String> getAttributeNames()
      Description copied from interface: OorianHttpSession
      Returns an enumeration of all attribute names in this session.
      Specified by:
      getAttributeNames in interface OorianHttpSession
      Returns:
      enumeration of attribute names
    • setAttribute

      public void setAttribute(String name, Object value)
      Description copied from interface: OorianHttpSession
      Sets a session attribute.
      Specified by:
      setAttribute in interface OorianHttpSession
      Parameters:
      name - the attribute name
      value - the attribute value
    • removeAttribute

      public void removeAttribute(String name)
      Description copied from interface: OorianHttpSession
      Removes a session attribute.
      Specified by:
      removeAttribute in interface OorianHttpSession
      Parameters:
      name - the attribute name to remove
    • invalidate

      public void invalidate()
      Description copied from interface: OorianHttpSession
      Invalidates this session.
      Specified by:
      invalidate in interface OorianHttpSession
    • isNew

      public boolean isNew()
      Description copied from interface: OorianHttpSession
      Checks if the session was newly created.
      Specified by:
      isNew in interface OorianHttpSession
      Returns:
      true if the session is new
    • getDelegate

      public jakarta.servlet.http.HttpSession getDelegate()
      Returns the underlying Jakarta HTTP session.
      Returns:
      The wrapped HttpSession.