java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.ee8.nested.AbstractHandler
org.eclipse.jetty.ee8.nested.AbstractHandlerContainer
org.eclipse.jetty.ee8.nested.HandlerWrapper
org.eclipse.jetty.ee8.nested.ScopedHandler
org.eclipse.jetty.ee8.nested.SessionHandler
- 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classCookieConfig Implementation of the javax.servlet.SessionCookieConfig.classNested classes/interfaces inherited from class org.eclipse.jetty.ee8.nested.AbstractHandler
AbstractHandler.ErrorDispatchHandlerNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.session.SessionConfig
org.eclipse.jetty.session.SessionConfig.Mutable -
Field Summary
FieldsFields inherited from class org.eclipse.jetty.ee8.nested.ScopedHandler
_nextScope, _outerScopeFields inherited from class org.eclipse.jetty.ee8.nested.HandlerWrapper
_handlerFields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEYFields inherited from interface org.eclipse.jetty.session.SessionConfig
__CheckRemoteSessionEncodingProperty, __DefaultSessionCookie, __DefaultSessionDomain, __DefaultSessionIdPathParameterName, __MaxAgeProperty, __SessionCookieProperty, __SessionDomainProperty, __SessionIdPathParameterNameProperty, __SessionPathProperty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddEventListener(EventListener listener) Adds an event listener for session-related events.protected voidvoiddoHandle(String target, Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Do the handler work within the scope.voiddoScope(String target, Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Scope the handlerprotected voiddoStart()Set<javax.servlet.SessionTrackingMode> Set<javax.servlet.SessionTrackingMode> intintintorg.eclipse.jetty.http.HttpCookie.SameSiteprotected List<javax.servlet.http.HttpSessionAttributeListener> org.eclipse.jetty.session.SessionCachejavax.servlet.SessionCookieConfigprotected List<javax.servlet.http.HttpSessionIdListener> org.eclipse.jetty.session.SessionIdManagerprotected List<javax.servlet.http.HttpSessionListener> org.eclipse.jetty.session.SessionManagerbooleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanremoveEventListener(EventListener listener) voidsetCheckingRemoteSessionIdEncoding(boolean value) voidsetHttpOnly(boolean value) voidsetMaxCookieAge(int value) voidsetMaxInactiveInterval(int value) voidsetPartitioned(boolean value) voidsetRefreshCookieAge(int value) voidsetSameSite(org.eclipse.jetty.http.HttpCookie.SameSite sameSite) voidsetSecureCookies(boolean value) voidsetSecureRequestOnly(boolean value) voidsetSessionCache(org.eclipse.jetty.session.SessionCache cache) voidsetSessionComment(String sessionComment) voidsetSessionCookie(String value) voidsetSessionDomain(String value) voidsetSessionIdManager(org.eclipse.jetty.session.SessionIdManager sessionIdManager) voidvoidsetSessionPath(String value) voidsetSessionTrackingModes(Set<javax.servlet.SessionTrackingMode> sessionTrackingModes) voidsetUsingCookies(boolean value) voidsetUsingUriParameters(boolean value) Methods inherited from class org.eclipse.jetty.ee8.nested.ScopedHandler
handle, nextHandle, nextScopeMethods inherited from class org.eclipse.jetty.ee8.nested.HandlerWrapper
destroy, expandChildren, getHandler, getHandlers, getTail, insertHandler, setAsParent, setHandlerMethods inherited from class org.eclipse.jetty.ee8.nested.AbstractHandlerContainer
expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass, setServerMethods inherited from class org.eclipse.jetty.ee8.nested.AbstractHandler
doError, doStop, getServerMethods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addManaged, contains, dump, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.util.component.LifeCycle
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop
-
Field Details
-
DEFAULT_SESSION_TRACKING_MODES
-
-
Constructor Details
-
SessionHandler
public SessionHandler()
-
-
Method Details
-
getSessionManager
public org.eclipse.jetty.session.SessionManager getSessionManager() -
getSessionListeners
-
getSessionAttributeListeners
-
getSessionIdListeners
-
setSessionCache
public void setSessionCache(org.eclipse.jetty.session.SessionCache cache) - Specified by:
setSessionCachein interfaceorg.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:
setSessionIdManagerin interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
getSessionIdManager
public org.eclipse.jetty.session.SessionIdManager getSessionIdManager() -
configureCookies
protected void configureCookies() -
doStart
- Overrides:
doStartin classScopedHandler- Throws:
Exception
-
addEventListener
Adds an event listener for session-related events.- Specified by:
addEventListenerin interfaceorg.eclipse.jetty.util.component.Container- Specified by:
addEventListenerin interfaceorg.eclipse.jetty.util.component.LifeCycle- Overrides:
addEventListenerin classorg.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
- Specified by:
removeEventListenerin interfaceorg.eclipse.jetty.util.component.Container- Specified by:
removeEventListenerin interfaceorg.eclipse.jetty.util.component.LifeCycle- Overrides:
removeEventListenerin classorg.eclipse.jetty.util.component.ContainerLifeCycle
-
getSessionCookieConfig
public javax.servlet.SessionCookieConfig getSessionCookieConfig() -
getDefaultSessionTrackingModes
-
getEffectiveSessionTrackingModes
-
setSessionTrackingModes
-
getMaxCookieAge
public int getMaxCookieAge()- Specified by:
getMaxCookieAgein interfaceorg.eclipse.jetty.session.SessionConfig
-
getMaxInactiveInterval
public int getMaxInactiveInterval()- Specified by:
getMaxInactiveIntervalin interfaceorg.eclipse.jetty.session.SessionConfig
-
getRefreshCookieAge
public int getRefreshCookieAge()- Specified by:
getRefreshCookieAgein interfaceorg.eclipse.jetty.session.SessionConfig
-
getSameSite
public org.eclipse.jetty.http.HttpCookie.SameSite getSameSite()- Specified by:
getSameSitein interfaceorg.eclipse.jetty.session.SessionConfig
-
getSessionComment
- Specified by:
getSessionCommentin interfaceorg.eclipse.jetty.session.SessionConfig
-
getSessionCookie
- Specified by:
getSessionCookiein interfaceorg.eclipse.jetty.session.SessionConfig
-
getSessionDomain
- Specified by:
getSessionDomainin interfaceorg.eclipse.jetty.session.SessionConfig
-
getSessionIdPathParameterName
- Specified by:
getSessionIdPathParameterNamein interfaceorg.eclipse.jetty.session.SessionConfig
-
getSessionIdPathParameterNamePrefix
- Specified by:
getSessionIdPathParameterNamePrefixin interfaceorg.eclipse.jetty.session.SessionConfig
-
getSessionPath
- Specified by:
getSessionPathin interfaceorg.eclipse.jetty.session.SessionConfig
-
isCheckingRemoteSessionIdEncoding
public boolean isCheckingRemoteSessionIdEncoding()- Specified by:
isCheckingRemoteSessionIdEncodingin interfaceorg.eclipse.jetty.session.SessionConfig
-
isHttpOnly
public boolean isHttpOnly()- Specified by:
isHttpOnlyin interfaceorg.eclipse.jetty.session.SessionConfig
-
isPartitioned
public boolean isPartitioned()- Specified by:
isPartitionedin interfaceorg.eclipse.jetty.session.SessionConfig
-
isSecureCookies
public boolean isSecureCookies()- Specified by:
isSecureCookiesin interfaceorg.eclipse.jetty.session.SessionConfig
-
isSecureRequestOnly
public boolean isSecureRequestOnly()- Specified by:
isSecureRequestOnlyin interfaceorg.eclipse.jetty.session.SessionConfig
-
isUsingCookies
public boolean isUsingCookies()- Specified by:
isUsingCookiesin interfaceorg.eclipse.jetty.session.SessionConfig
-
isUsingUriParameters
public boolean isUsingUriParameters()- Specified by:
isUsingUriParametersin interfaceorg.eclipse.jetty.session.SessionConfig
-
setCheckingRemoteSessionIdEncoding
public void setCheckingRemoteSessionIdEncoding(boolean value) - Specified by:
setCheckingRemoteSessionIdEncodingin interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
setHttpOnly
public void setHttpOnly(boolean value) - Specified by:
setHttpOnlyin interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
setPartitioned
public void setPartitioned(boolean value) - Specified by:
setPartitionedin interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
setMaxCookieAge
public void setMaxCookieAge(int value) - Specified by:
setMaxCookieAgein interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
setMaxInactiveInterval
public void setMaxInactiveInterval(int value) - Specified by:
setMaxInactiveIntervalin interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
setRefreshCookieAge
public void setRefreshCookieAge(int value) - Specified by:
setRefreshCookieAgein interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
setSameSite
public void setSameSite(org.eclipse.jetty.http.HttpCookie.SameSite sameSite) - Specified by:
setSameSitein interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
setSecureCookies
public void setSecureCookies(boolean value) - Specified by:
setSecureCookiesin interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
setSecureRequestOnly
public void setSecureRequestOnly(boolean value) - Specified by:
setSecureRequestOnlyin interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
setSessionComment
- Specified by:
setSessionCommentin interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
setSessionCookie
- Specified by:
setSessionCookiein interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
setSessionDomain
- Specified by:
setSessionDomainin interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
setSessionIdPathParameterName
- Specified by:
setSessionIdPathParameterNamein interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
setSessionPath
- Specified by:
setSessionPathin interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
setUsingCookies
public void setUsingCookies(boolean value) - Specified by:
setUsingCookiesin interfaceorg.eclipse.jetty.session.SessionConfig.Mutable
-
setUsingUriParameters
public void setUsingUriParameters(boolean value) - Specified by:
setUsingUriParametersin interfaceorg.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:ScopedHandlerScope the handlerDerived implementations should call
ScopedHandler.nextScope(String, Request, HttpServletRequest, HttpServletResponse)- Overrides:
doScopein classScopedHandler- Parameters:
target- The target of the request - either a URI or a name.baseRequest- The original unwrapped request object.request- The request either as theRequestobject or a wrapper of that request.response- The response as theResponseobject or a wrapper of that request.- Throws:
IOException- if unable to handle the request or response processingjavax.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:ScopedHandlerDo the handler work within the scope.Derived implementations should call
ScopedHandler.nextHandle(String, Request, HttpServletRequest, HttpServletResponse)- Specified by:
doHandlein classScopedHandler- Parameters:
target- The target of the request - either a URI or a name.baseRequest- The original unwrapped request object.request- The request either as theRequestobject or a wrapper of that request.response- The response as theResponseobject or a wrapper of that request.- Throws:
IOException- if unable to handle the request or response processingjavax.servlet.ServletException- if unable to handle the request or response due to underlying servlet issue
-