Class SessionHandler
- All Implemented Interfaces:
- Handler, HandlerContainer, SessionConfig, SessionConfig.Mutable, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionfinal classCookieConfig Implementation of the jakarta.servlet.SessionCookieConfig.classNested classes/interfaces inherited from class AbstractHandlerAbstractHandler.ErrorDispatchHandlerNested classes/interfaces inherited from class AbstractLifeCycleAbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface ContainerContainer.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface DumpableDumpable.DumpableContainerNested classes/interfaces inherited from interface LifeCycleLifeCycle.ListenerNested classes/interfaces inherited from interface SessionConfigSessionConfig.Mutable
- 
Field SummaryFieldsFields inherited from class ScopedHandler_nextScope, _outerScopeFields inherited from class HandlerWrapper_handler
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanaddEventListener(EventListener listener) Adds an event listener for session-related events.protected voidvoiddoHandle(String target, Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Do the handler work within the scope.voiddoScope(String target, Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) Scope the handlerprotected voiddoStart()Starts the managed lifecycle beans in the order they were added.Set<jakarta.servlet.SessionTrackingMode> Set<jakarta.servlet.SessionTrackingMode> intintintprotected List<jakarta.servlet.http.HttpSessionAttributeListener> jakarta.servlet.SessionCookieConfigprotected List<jakarta.servlet.http.HttpSessionIdListener> protected List<jakarta.servlet.http.HttpSessionListener> booleanbooleanbooleanbooleanbooleanbooleanbooleanbooleanremoveEventListener(EventListener listener) Remove an event listener.voidsetCheckingRemoteSessionIdEncoding(boolean value) voidsetHttpOnly(boolean value) voidsetMaxCookieAge(int value) voidsetMaxInactiveInterval(int value) voidsetPartitioned(boolean value) voidsetRefreshCookieAge(int value) voidsetSameSite(HttpCookie.SameSite sameSite) voidsetSecureCookies(boolean value) voidsetSecureRequestOnly(boolean value) voidsetSessionCache(SessionCache cache) voidsetSessionComment(String sessionComment) voidsetSessionCookie(String value) voidsetSessionDomain(String value) voidsetSessionIdManager(SessionIdManager sessionIdManager) voidvoidsetSessionPath(String value) voidsetSessionTrackingModes(Set<jakarta.servlet.SessionTrackingMode> sessionTrackingModes) voidsetUsingCookies(boolean value) voidsetUsingUriParameters(boolean value) Methods inherited from class ScopedHandlerhandle, nextHandle, nextScopeMethods inherited from class HandlerWrapperdestroy, expandChildren, getHandler, getHandlers, getTail, insertHandler, setAsParent, setHandlerMethods inherited from class AbstractHandlerContainerexpandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass, setServerMethods inherited from class AbstractHandlerdoError, doStop, getServerMethods inherited from class ContainerLifeCycleaddBean, 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 AbstractLifeCyclegetEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ContainergetCachedBeans, getEventListenersMethods inherited from interface Dumpable.DumpableContainerisDumpableMethods inherited from interface LifeCycleisFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop
- 
Field Details- 
DEFAULT_SESSION_TRACKING_MODES
 
- 
- 
Constructor Details- 
SessionHandlerpublic SessionHandler()
 
- 
- 
Method Details- 
getSessionManager
- 
getSessionListeners
- 
getSessionAttributeListeners
- 
getSessionIdListeners
- 
setSessionCache- Specified by:
- setSessionCachein interface- SessionConfig.Mutable
 
- 
getSessionCache
- 
setSessionIdManager- Specified by:
- setSessionIdManagerin interface- SessionConfig.Mutable
 
- 
getSessionIdManager
- 
configureCookiesprotected void configureCookies()
- 
doStartDescription copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
- doStartin class- ScopedHandler
- Throws:
- Exception- If there was a problem starting. Will cause a transition to FAILED state
 
- 
addEventListenerAdds an event listener for session-related events.- Specified by:
- addEventListenerin interface- Container
- Specified by:
- addEventListenerin interface- LifeCycle
- Overrides:
- addEventListenerin class- 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:
 
- 
removeEventListenerDescription copied from interface:ContainerRemove an event listener.- Specified by:
- removeEventListenerin interface- Container
- Specified by:
- removeEventListenerin interface- LifeCycle
- Overrides:
- removeEventListenerin class- ContainerLifeCycle
- Parameters:
- listener- the listener to remove
- Returns:
- true if the listener was removed
- See Also:
 
- 
getSessionCookieConfigpublic jakarta.servlet.SessionCookieConfig getSessionCookieConfig()
- 
getDefaultSessionTrackingModes
- 
getEffectiveSessionTrackingModes
- 
setSessionTrackingModes
- 
getMaxCookieAgepublic int getMaxCookieAge()- Specified by:
- getMaxCookieAgein interface- SessionConfig
 
- 
getMaxInactiveIntervalpublic int getMaxInactiveInterval()- Specified by:
- getMaxInactiveIntervalin interface- SessionConfig
 
- 
getRefreshCookieAgepublic int getRefreshCookieAge()- Specified by:
- getRefreshCookieAgein interface- SessionConfig
 
- 
getSameSite- Specified by:
- getSameSitein interface- SessionConfig
 
- 
getSessionComment- Specified by:
- getSessionCommentin interface- SessionConfig
 
- 
getSessionCookie- Specified by:
- getSessionCookiein interface- SessionConfig
 
- 
getSessionDomain- Specified by:
- getSessionDomainin interface- SessionConfig
 
- 
getSessionIdPathParameterName- Specified by:
- getSessionIdPathParameterNamein interface- SessionConfig
 
- 
getSessionIdPathParameterNamePrefix- Specified by:
- getSessionIdPathParameterNamePrefixin interface- SessionConfig
 
- 
getSessionPath- Specified by:
- getSessionPathin interface- SessionConfig
 
- 
isCheckingRemoteSessionIdEncodingpublic boolean isCheckingRemoteSessionIdEncoding()- Specified by:
- isCheckingRemoteSessionIdEncodingin interface- SessionConfig
 
- 
isHttpOnlypublic boolean isHttpOnly()- Specified by:
- isHttpOnlyin interface- SessionConfig
 
- 
isPartitionedpublic boolean isPartitioned()- Specified by:
- isPartitionedin interface- SessionConfig
 
- 
isSecureCookiespublic boolean isSecureCookies()- Specified by:
- isSecureCookiesin interface- SessionConfig
 
- 
isSecureRequestOnlypublic boolean isSecureRequestOnly()- Specified by:
- isSecureRequestOnlyin interface- SessionConfig
 
- 
isUsingCookiespublic boolean isUsingCookies()- Specified by:
- isUsingCookiesin interface- SessionConfig
 
- 
isUsingUriParameterspublic boolean isUsingUriParameters()- Specified by:
- isUsingUriParametersin interface- SessionConfig
 
- 
setCheckingRemoteSessionIdEncodingpublic void setCheckingRemoteSessionIdEncoding(boolean value) - Specified by:
- setCheckingRemoteSessionIdEncodingin interface- SessionConfig.Mutable
 
- 
setHttpOnlypublic void setHttpOnly(boolean value) - Specified by:
- setHttpOnlyin interface- SessionConfig.Mutable
 
- 
setPartitionedpublic void setPartitioned(boolean value) - Specified by:
- setPartitionedin interface- SessionConfig.Mutable
 
- 
setMaxCookieAgepublic void setMaxCookieAge(int value) - Specified by:
- setMaxCookieAgein interface- SessionConfig.Mutable
 
- 
setMaxInactiveIntervalpublic void setMaxInactiveInterval(int value) - Specified by:
- setMaxInactiveIntervalin interface- SessionConfig.Mutable
 
- 
setRefreshCookieAgepublic void setRefreshCookieAge(int value) - Specified by:
- setRefreshCookieAgein interface- SessionConfig.Mutable
 
- 
setSameSite- Specified by:
- setSameSitein interface- SessionConfig.Mutable
 
- 
setSecureCookiespublic void setSecureCookies(boolean value) - Specified by:
- setSecureCookiesin interface- SessionConfig.Mutable
 
- 
setSecureRequestOnlypublic void setSecureRequestOnly(boolean value) - Specified by:
- setSecureRequestOnlyin interface- SessionConfig.Mutable
 
- 
setSessionComment- Specified by:
- setSessionCommentin interface- SessionConfig.Mutable
 
- 
setSessionCookie- Specified by:
- setSessionCookiein interface- SessionConfig.Mutable
 
- 
setSessionDomain- Specified by:
- setSessionDomainin interface- SessionConfig.Mutable
 
- 
setSessionIdPathParameterName- Specified by:
- setSessionIdPathParameterNamein interface- SessionConfig.Mutable
 
- 
setSessionPath- Specified by:
- setSessionPathin interface- SessionConfig.Mutable
 
- 
setUsingCookiespublic void setUsingCookies(boolean value) - Specified by:
- setUsingCookiesin interface- SessionConfig.Mutable
 
- 
setUsingUriParameterspublic void setUsingUriParameters(boolean value) - Specified by:
- setUsingUriParametersin interface- SessionConfig.Mutable
 
- 
doScopepublic void doScope(String target, Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.servlet.ServletException Description copied from class:ScopedHandlerScope the handlerDerived implementations should call ScopedHandler.nextScope(String, Request, HttpServletRequest, HttpServletResponse)- Overrides:
- doScopein 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- Requestobject or a wrapper of that request.
- response- The response as the- Responseobject or a wrapper of that request.
- Throws:
- IOException- if unable to handle the request or response processing
- jakarta.servlet.ServletException- if unable to handle the request or response due to underlying servlet issue
 
- 
doHandlepublic void doHandle(String target, Request baseRequest, jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response) throws IOException, jakarta.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 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- Requestobject or a wrapper of that request.
- response- The response as the- Responseobject or a wrapper of that request.
- Throws:
- IOException- if unable to handle the request or response processing
- jakarta.servlet.ServletException- if unable to handle the request or response due to underlying servlet issue
 
 
-