Class SessionHandler

java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
All Implemented Interfaces:
Handler, HandlerContainer, org.eclipse.jetty.session.SessionConfig, org.eclipse.jetty.session.SessionConfig.Mutable, org.eclipse.jetty.util.component.Container, org.eclipse.jetty.util.component.Destroyable, org.eclipse.jetty.util.component.Dumpable, org.eclipse.jetty.util.component.Dumpable.DumpableContainer, org.eclipse.jetty.util.component.LifeCycle

public class SessionHandler extends ScopedHandler implements org.eclipse.jetty.session.SessionConfig.Mutable
  • Field Details

    • DEFAULT_SESSION_TRACKING_MODES

      public static final EnumSet<javax.servlet.SessionTrackingMode> DEFAULT_SESSION_TRACKING_MODES
  • Constructor Details

    • SessionHandler

      public SessionHandler()
  • Method Details

    • getSessionManager

      public org.eclipse.jetty.session.SessionManager getSessionManager()
    • getSessionListeners

      protected List<javax.servlet.http.HttpSessionListener> getSessionListeners()
    • getSessionAttributeListeners

      protected List<javax.servlet.http.HttpSessionAttributeListener> getSessionAttributeListeners()
    • getSessionIdListeners

      protected List<javax.servlet.http.HttpSessionIdListener> getSessionIdListeners()
    • setSessionCache

      public void setSessionCache(org.eclipse.jetty.session.SessionCache cache)
      Specified by:
      setSessionCache in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • getSessionCache

      public org.eclipse.jetty.session.SessionCache getSessionCache()
    • setSessionIdManager

      public void setSessionIdManager(org.eclipse.jetty.session.SessionIdManager sessionIdManager)
      Specified by:
      setSessionIdManager in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • getSessionIdManager

      public org.eclipse.jetty.session.SessionIdManager getSessionIdManager()
    • configureCookies

      protected void configureCookies()
    • doStart

      protected void doStart() throws Exception
      Overrides:
      doStart in class ScopedHandler
      Throws:
      Exception
    • addEventListener

      public boolean addEventListener(EventListener listener)
      Adds an event listener for session-related events.
      Specified by:
      addEventListener in interface org.eclipse.jetty.util.component.Container
      Specified by:
      addEventListener in interface org.eclipse.jetty.util.component.LifeCycle
      Overrides:
      addEventListener in class org.eclipse.jetty.util.component.ContainerLifeCycle
      Parameters:
      listener - the session event listener to add Individual SessionManagers implementations may accept arbitrary listener types, but they are expected to at least handle HttpSessionActivationListener, HttpSessionAttributeListener, HttpSessionBindingListener and HttpSessionListener.
      Returns:
      true if the listener was added
      See Also:
    • removeEventListener

      public boolean removeEventListener(EventListener listener)
      Specified by:
      removeEventListener in interface org.eclipse.jetty.util.component.Container
      Specified by:
      removeEventListener in interface org.eclipse.jetty.util.component.LifeCycle
      Overrides:
      removeEventListener in class org.eclipse.jetty.util.component.ContainerLifeCycle
    • getSessionCookieConfig

      public javax.servlet.SessionCookieConfig getSessionCookieConfig()
    • getDefaultSessionTrackingModes

      public Set<javax.servlet.SessionTrackingMode> getDefaultSessionTrackingModes()
    • getEffectiveSessionTrackingModes

      public Set<javax.servlet.SessionTrackingMode> getEffectiveSessionTrackingModes()
    • setSessionTrackingModes

      public void setSessionTrackingModes(Set<javax.servlet.SessionTrackingMode> sessionTrackingModes)
    • getMaxCookieAge

      public int getMaxCookieAge()
      Specified by:
      getMaxCookieAge in interface org.eclipse.jetty.session.SessionConfig
    • getMaxInactiveInterval

      public int getMaxInactiveInterval()
      Specified by:
      getMaxInactiveInterval in interface org.eclipse.jetty.session.SessionConfig
    • getRefreshCookieAge

      public int getRefreshCookieAge()
      Specified by:
      getRefreshCookieAge in interface org.eclipse.jetty.session.SessionConfig
    • getSameSite

      public org.eclipse.jetty.http.HttpCookie.SameSite getSameSite()
      Specified by:
      getSameSite in interface org.eclipse.jetty.session.SessionConfig
    • getSessionComment

      public String getSessionComment()
      Specified by:
      getSessionComment in interface org.eclipse.jetty.session.SessionConfig
    • getSessionCookie

      public String getSessionCookie()
      Specified by:
      getSessionCookie in interface org.eclipse.jetty.session.SessionConfig
    • getSessionDomain

      public String getSessionDomain()
      Specified by:
      getSessionDomain in interface org.eclipse.jetty.session.SessionConfig
    • getSessionIdPathParameterName

      public String getSessionIdPathParameterName()
      Specified by:
      getSessionIdPathParameterName in interface org.eclipse.jetty.session.SessionConfig
    • getSessionIdPathParameterNamePrefix

      public String getSessionIdPathParameterNamePrefix()
      Specified by:
      getSessionIdPathParameterNamePrefix in interface org.eclipse.jetty.session.SessionConfig
    • getSessionPath

      public String getSessionPath()
      Specified by:
      getSessionPath in interface org.eclipse.jetty.session.SessionConfig
    • isCheckingRemoteSessionIdEncoding

      public boolean isCheckingRemoteSessionIdEncoding()
      Specified by:
      isCheckingRemoteSessionIdEncoding in interface org.eclipse.jetty.session.SessionConfig
    • isHttpOnly

      public boolean isHttpOnly()
      Specified by:
      isHttpOnly in interface org.eclipse.jetty.session.SessionConfig
    • isPartitioned

      public boolean isPartitioned()
      Specified by:
      isPartitioned in interface org.eclipse.jetty.session.SessionConfig
    • isSecureCookies

      public boolean isSecureCookies()
      Specified by:
      isSecureCookies in interface org.eclipse.jetty.session.SessionConfig
    • isSecureRequestOnly

      public boolean isSecureRequestOnly()
      Specified by:
      isSecureRequestOnly in interface org.eclipse.jetty.session.SessionConfig
    • isUsingCookies

      public boolean isUsingCookies()
      Specified by:
      isUsingCookies in interface org.eclipse.jetty.session.SessionConfig
    • isUsingUriParameters

      public boolean isUsingUriParameters()
      Specified by:
      isUsingUriParameters in interface org.eclipse.jetty.session.SessionConfig
    • setCheckingRemoteSessionIdEncoding

      public void setCheckingRemoteSessionIdEncoding(boolean value)
      Specified by:
      setCheckingRemoteSessionIdEncoding in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • setHttpOnly

      public void setHttpOnly(boolean value)
      Specified by:
      setHttpOnly in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • setPartitioned

      public void setPartitioned(boolean value)
      Specified by:
      setPartitioned in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • setMaxCookieAge

      public void setMaxCookieAge(int value)
      Specified by:
      setMaxCookieAge in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • setMaxInactiveInterval

      public void setMaxInactiveInterval(int value)
      Specified by:
      setMaxInactiveInterval in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • setRefreshCookieAge

      public void setRefreshCookieAge(int value)
      Specified by:
      setRefreshCookieAge in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • setSameSite

      public void setSameSite(org.eclipse.jetty.http.HttpCookie.SameSite sameSite)
      Specified by:
      setSameSite in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • setSecureCookies

      public void setSecureCookies(boolean value)
      Specified by:
      setSecureCookies in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • setSecureRequestOnly

      public void setSecureRequestOnly(boolean value)
      Specified by:
      setSecureRequestOnly in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • setSessionComment

      public void setSessionComment(String sessionComment)
      Specified by:
      setSessionComment in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • setSessionCookie

      public void setSessionCookie(String value)
      Specified by:
      setSessionCookie in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • setSessionDomain

      public void setSessionDomain(String value)
      Specified by:
      setSessionDomain in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • setSessionIdPathParameterName

      public void setSessionIdPathParameterName(String value)
      Specified by:
      setSessionIdPathParameterName in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • setSessionPath

      public void setSessionPath(String value)
      Specified by:
      setSessionPath in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • setUsingCookies

      public void setUsingCookies(boolean value)
      Specified by:
      setUsingCookies in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • setUsingUriParameters

      public void setUsingUriParameters(boolean value)
      Specified by:
      setUsingUriParameters in interface org.eclipse.jetty.session.SessionConfig.Mutable
    • doScope

      public void doScope(String target, Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
      Description copied from class: ScopedHandler
      Scope the handler

      Derived implementations should call ScopedHandler.nextScope(String, Request, HttpServletRequest, HttpServletResponse)

      Overrides:
      doScope in class ScopedHandler
      Parameters:
      target - The target of the request - either a URI or a name.
      baseRequest - The original unwrapped request object.
      request - The request either as the Request object or a wrapper of that request.
      response - The response as the Response object or a wrapper of that request.
      Throws:
      IOException - if unable to handle the request or response processing
      javax.servlet.ServletException - if unable to handle the request or response due to underlying servlet issue
    • doHandle

      public void doHandle(String target, Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException
      Description copied from class: ScopedHandler
      Do the handler work within the scope.

      Derived implementations should call ScopedHandler.nextHandle(String, Request, HttpServletRequest, HttpServletResponse)

      Specified by:
      doHandle in class ScopedHandler
      Parameters:
      target - The target of the request - either a URI or a name.
      baseRequest - The original unwrapped request object.
      request - The request either as the Request object or a wrapper of that request.
      response - The response as the Response object or a wrapper of that request.
      Throws:
      IOException - if unable to handle the request or response processing
      javax.servlet.ServletException - if unable to handle the request or response due to underlying servlet issue