Class SessionHandler
- All Implemented Interfaces:
Handler, HandlerContainer, SessionConfig, SessionConfig.Mutable, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classCookieConfig Implementation of the javax.servlet.SessionCookieConfig.classNested classes/interfaces inherited from class AbstractHandler
AbstractHandler.ErrorDispatchHandlerNested classes/interfaces inherited from class AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface Container
Container.InheritedListener, Container.ListenerNested classes/interfaces inherited from interface Dumpable
Dumpable.DumpableContainerNested classes/interfaces inherited from interface LifeCycle
LifeCycle.ListenerNested classes/interfaces inherited from interface SessionConfig
SessionConfig.Mutable -
Field Summary
FieldsFields inherited from class ScopedHandler
_nextScope, _outerScopeFields inherited from class HandlerWrapper
_handler -
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()Starts the managed lifecycle beans in the order they were added.Set<javax.servlet.SessionTrackingMode> Set<javax.servlet.SessionTrackingMode> intintintprotected List<javax.servlet.http.HttpSessionAttributeListener> javax.servlet.SessionCookieConfigprotected List<javax.servlet.http.HttpSessionIdListener> protected List<javax.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<javax.servlet.SessionTrackingMode> sessionTrackingModes) voidsetUsingCookies(boolean value) voidsetUsingUriParameters(boolean value) Methods inherited from class ScopedHandler
handle, nextHandle, nextScopeMethods inherited from class HandlerWrapper
destroy, expandChildren, getHandler, getHandlers, getTail, insertHandler, setAsParent, setHandlerMethods inherited from class AbstractHandlerContainer
expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass, setServerMethods inherited from class AbstractHandler
doError, doStop, getServerMethods inherited from class 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 AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Container
getCachedBeans, getEventListenersMethods inherited from interface Dumpable.DumpableContainer
isDumpableMethods inherited from interface LifeCycle
isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop
-
Field Details
-
DEFAULT_SESSION_TRACKING_MODES
-
-
Constructor Details
-
SessionHandler
public SessionHandler()
-
-
Method Details
-
getSessionManager
-
getSessionListeners
-
getSessionAttributeListeners
-
getSessionIdListeners
-
setSessionCache
- Specified by:
setSessionCachein interfaceSessionConfig.Mutable
-
getSessionCache
-
setSessionIdManager
- Specified by:
setSessionIdManagerin interfaceSessionConfig.Mutable
-
getSessionIdManager
-
configureCookies
protected void configureCookies() -
doStart
Description copied from class:ContainerLifeCycleStarts the managed lifecycle beans in the order they were added.- Overrides:
doStartin classScopedHandler- Throws:
Exception- If there was a problem starting. Will cause a transition to FAILED state
-
addEventListener
Adds an event listener for session-related events.- Specified by:
addEventListenerin interfaceContainer- Specified by:
addEventListenerin interfaceLifeCycle- Overrides:
addEventListenerin classContainerLifeCycle- 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
Description copied from interface:ContainerRemove an event listener.- Specified by:
removeEventListenerin interfaceContainer- Specified by:
removeEventListenerin interfaceLifeCycle- Overrides:
removeEventListenerin classContainerLifeCycle- Parameters:
listener- the listener to remove- Returns:
- true if the listener was removed
- See Also:
-
getSessionCookieConfig
public javax.servlet.SessionCookieConfig getSessionCookieConfig() -
getDefaultSessionTrackingModes
-
getEffectiveSessionTrackingModes
-
setSessionTrackingModes
-
getMaxCookieAge
public int getMaxCookieAge()- Specified by:
getMaxCookieAgein interfaceSessionConfig
-
getMaxInactiveInterval
public int getMaxInactiveInterval()- Specified by:
getMaxInactiveIntervalin interfaceSessionConfig
-
getRefreshCookieAge
public int getRefreshCookieAge()- Specified by:
getRefreshCookieAgein interfaceSessionConfig
-
getSameSite
- Specified by:
getSameSitein interfaceSessionConfig
-
getSessionComment
- Specified by:
getSessionCommentin interfaceSessionConfig
-
getSessionCookie
- Specified by:
getSessionCookiein interfaceSessionConfig
-
getSessionDomain
- Specified by:
getSessionDomainin interfaceSessionConfig
-
getSessionIdPathParameterName
- Specified by:
getSessionIdPathParameterNamein interfaceSessionConfig
-
getSessionIdPathParameterNamePrefix
- Specified by:
getSessionIdPathParameterNamePrefixin interfaceSessionConfig
-
getSessionPath
- Specified by:
getSessionPathin interfaceSessionConfig
-
isCheckingRemoteSessionIdEncoding
public boolean isCheckingRemoteSessionIdEncoding()- Specified by:
isCheckingRemoteSessionIdEncodingin interfaceSessionConfig
-
isHttpOnly
public boolean isHttpOnly()- Specified by:
isHttpOnlyin interfaceSessionConfig
-
isPartitioned
public boolean isPartitioned()- Specified by:
isPartitionedin interfaceSessionConfig
-
isSecureCookies
public boolean isSecureCookies()- Specified by:
isSecureCookiesin interfaceSessionConfig
-
isSecureRequestOnly
public boolean isSecureRequestOnly()- Specified by:
isSecureRequestOnlyin interfaceSessionConfig
-
isUsingCookies
public boolean isUsingCookies()- Specified by:
isUsingCookiesin interfaceSessionConfig
-
isUsingUriParameters
public boolean isUsingUriParameters()- Specified by:
isUsingUriParametersin interfaceSessionConfig
-
setCheckingRemoteSessionIdEncoding
public void setCheckingRemoteSessionIdEncoding(boolean value) - Specified by:
setCheckingRemoteSessionIdEncodingin interfaceSessionConfig.Mutable
-
setHttpOnly
public void setHttpOnly(boolean value) - Specified by:
setHttpOnlyin interfaceSessionConfig.Mutable
-
setPartitioned
public void setPartitioned(boolean value) - Specified by:
setPartitionedin interfaceSessionConfig.Mutable
-
setMaxCookieAge
public void setMaxCookieAge(int value) - Specified by:
setMaxCookieAgein interfaceSessionConfig.Mutable
-
setMaxInactiveInterval
public void setMaxInactiveInterval(int value) - Specified by:
setMaxInactiveIntervalin interfaceSessionConfig.Mutable
-
setRefreshCookieAge
public void setRefreshCookieAge(int value) - Specified by:
setRefreshCookieAgein interfaceSessionConfig.Mutable
-
setSameSite
- Specified by:
setSameSitein interfaceSessionConfig.Mutable
-
setSecureCookies
public void setSecureCookies(boolean value) - Specified by:
setSecureCookiesin interfaceSessionConfig.Mutable
-
setSecureRequestOnly
public void setSecureRequestOnly(boolean value) - Specified by:
setSecureRequestOnlyin interfaceSessionConfig.Mutable
-
setSessionComment
- Specified by:
setSessionCommentin interfaceSessionConfig.Mutable
-
setSessionCookie
- Specified by:
setSessionCookiein interfaceSessionConfig.Mutable
-
setSessionDomain
- Specified by:
setSessionDomainin interfaceSessionConfig.Mutable
-
setSessionIdPathParameterName
- Specified by:
setSessionIdPathParameterNamein interfaceSessionConfig.Mutable
-
setSessionPath
- Specified by:
setSessionPathin interfaceSessionConfig.Mutable
-
setUsingCookies
public void setUsingCookies(boolean value) - Specified by:
setUsingCookiesin interfaceSessionConfig.Mutable
-
setUsingUriParameters
public void setUsingUriParameters(boolean value) - Specified by:
setUsingUriParametersin interfaceSessionConfig.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
-