Package org.eclipse.jetty.ee8.nested
Class SessionHandler
- All Implemented Interfaces:
Handler
,HandlerContainer
,SessionConfig
,SessionConfig.Mutable
,Container
,Destroyable
,Dumpable
,Dumpable.DumpableContainer
,LifeCycle
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal class
CookieConfig Implementation of the javax.servlet.SessionCookieConfig.class
Nested classes/interfaces inherited from class org.eclipse.jetty.ee8.nested.AbstractHandler
AbstractHandler.ErrorDispatchHandler
Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
AbstractLifeCycle.AbstractLifeCycleListener, AbstractLifeCycle.StopException
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
Container.InheritedListener, Container.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
LifeCycle.Listener
Nested classes/interfaces inherited from interface org.eclipse.jetty.session.SessionConfig
SessionConfig.Mutable
-
Field Summary
FieldsFields inherited from class org.eclipse.jetty.ee8.nested.ScopedHandler
_nextScope, _outerScope
Fields inherited from class org.eclipse.jetty.ee8.nested.HandlerWrapper
_handler
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPING
Fields inherited from interface org.eclipse.jetty.session.SessionConfig
__CheckRemoteSessionEncodingProperty, __DefaultSessionCookie, __DefaultSessionDomain, __DefaultSessionIdPathParameterName, __MaxAgeProperty, __SessionCookieProperty, __SessionDomainProperty, __SessionIdPathParameterNameProperty, __SessionPathProperty
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
addEventListener
(EventListener listener) Adds an event listener for session-related events.protected void
void
doHandle
(String target, Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Do the handler work within the scope.void
doScope
(String target, Request baseRequest, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Scope the handlerprotected void
doStart()
Starts the managed lifecycle beans in the order they were added.Set
<javax.servlet.SessionTrackingMode> Set
<javax.servlet.SessionTrackingMode> int
int
int
protected List
<javax.servlet.http.HttpSessionAttributeListener> javax.servlet.SessionCookieConfig
protected List
<javax.servlet.http.HttpSessionIdListener> protected List
<javax.servlet.http.HttpSessionListener> boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
removeEventListener
(EventListener listener) Remove an event listener.void
setCheckingRemoteSessionIdEncoding
(boolean value) void
setHttpOnly
(boolean value) void
setMaxCookieAge
(int value) void
setMaxInactiveInterval
(int value) void
setPartitioned
(boolean value) void
setRefreshCookieAge
(int value) void
setSameSite
(HttpCookie.SameSite sameSite) void
setSecureCookies
(boolean value) void
setSecureRequestOnly
(boolean value) void
setSessionCache
(SessionCache cache) void
setSessionComment
(String sessionComment) void
setSessionCookie
(String value) void
setSessionDomain
(String value) void
setSessionIdManager
(SessionIdManager sessionIdManager) void
void
setSessionPath
(String value) void
setSessionTrackingModes
(Set<javax.servlet.SessionTrackingMode> sessionTrackingModes) void
setUsingCookies
(boolean value) void
setUsingUriParameters
(boolean value) Methods inherited from class org.eclipse.jetty.ee8.nested.ScopedHandler
handle, nextHandle, nextScope
Methods inherited from class org.eclipse.jetty.ee8.nested.HandlerWrapper
destroy, expandChildren, getHandler, getHandlers, getTail, insertHandler, setAsParent, setHandler
Methods inherited from class org.eclipse.jetty.ee8.nested.AbstractHandlerContainer
expandHandler, findContainerOf, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass, setServer
Methods inherited from class org.eclipse.jetty.ee8.nested.AbstractHandler
doError, doStop, getServer
Methods 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, updateBeans
Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListeners
Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpable
Methods 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
-
getSessionListeners
-
getSessionAttributeListeners
-
getSessionIdListeners
-
setSessionCache
- Specified by:
setSessionCache
in interfaceSessionConfig.Mutable
-
getSessionCache
-
setSessionIdManager
- Specified by:
setSessionIdManager
in interfaceSessionConfig.Mutable
-
getSessionIdManager
-
configureCookies
protected void configureCookies() -
doStart
Description copied from class:ContainerLifeCycle
Starts the managed lifecycle beans in the order they were added.- Overrides:
doStart
in 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:
addEventListener
in interfaceContainer
- Specified by:
addEventListener
in interfaceLifeCycle
- Overrides:
addEventListener
in 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:Container
Remove an event listener.- Specified by:
removeEventListener
in interfaceContainer
- Specified by:
removeEventListener
in interfaceLifeCycle
- Overrides:
removeEventListener
in 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:
getMaxCookieAge
in interfaceSessionConfig
-
getMaxInactiveInterval
public int getMaxInactiveInterval()- Specified by:
getMaxInactiveInterval
in interfaceSessionConfig
-
getRefreshCookieAge
public int getRefreshCookieAge()- Specified by:
getRefreshCookieAge
in interfaceSessionConfig
-
getSameSite
- Specified by:
getSameSite
in interfaceSessionConfig
-
getSessionComment
- Specified by:
getSessionComment
in interfaceSessionConfig
-
getSessionCookie
- Specified by:
getSessionCookie
in interfaceSessionConfig
-
getSessionDomain
- Specified by:
getSessionDomain
in interfaceSessionConfig
-
getSessionIdPathParameterName
- Specified by:
getSessionIdPathParameterName
in interfaceSessionConfig
-
getSessionIdPathParameterNamePrefix
- Specified by:
getSessionIdPathParameterNamePrefix
in interfaceSessionConfig
-
getSessionPath
- Specified by:
getSessionPath
in interfaceSessionConfig
-
isCheckingRemoteSessionIdEncoding
public boolean isCheckingRemoteSessionIdEncoding()- Specified by:
isCheckingRemoteSessionIdEncoding
in interfaceSessionConfig
-
isHttpOnly
public boolean isHttpOnly()- Specified by:
isHttpOnly
in interfaceSessionConfig
-
isPartitioned
public boolean isPartitioned()- Specified by:
isPartitioned
in interfaceSessionConfig
-
isSecureCookies
public boolean isSecureCookies()- Specified by:
isSecureCookies
in interfaceSessionConfig
-
isSecureRequestOnly
public boolean isSecureRequestOnly()- Specified by:
isSecureRequestOnly
in interfaceSessionConfig
-
isUsingCookies
public boolean isUsingCookies()- Specified by:
isUsingCookies
in interfaceSessionConfig
-
isUsingUriParameters
public boolean isUsingUriParameters()- Specified by:
isUsingUriParameters
in interfaceSessionConfig
-
setCheckingRemoteSessionIdEncoding
public void setCheckingRemoteSessionIdEncoding(boolean value) - Specified by:
setCheckingRemoteSessionIdEncoding
in interfaceSessionConfig.Mutable
-
setHttpOnly
public void setHttpOnly(boolean value) - Specified by:
setHttpOnly
in interfaceSessionConfig.Mutable
-
setPartitioned
public void setPartitioned(boolean value) - Specified by:
setPartitioned
in interfaceSessionConfig.Mutable
-
setMaxCookieAge
public void setMaxCookieAge(int value) - Specified by:
setMaxCookieAge
in interfaceSessionConfig.Mutable
-
setMaxInactiveInterval
public void setMaxInactiveInterval(int value) - Specified by:
setMaxInactiveInterval
in interfaceSessionConfig.Mutable
-
setRefreshCookieAge
public void setRefreshCookieAge(int value) - Specified by:
setRefreshCookieAge
in interfaceSessionConfig.Mutable
-
setSameSite
- Specified by:
setSameSite
in interfaceSessionConfig.Mutable
-
setSecureCookies
public void setSecureCookies(boolean value) - Specified by:
setSecureCookies
in interfaceSessionConfig.Mutable
-
setSecureRequestOnly
public void setSecureRequestOnly(boolean value) - Specified by:
setSecureRequestOnly
in interfaceSessionConfig.Mutable
-
setSessionComment
- Specified by:
setSessionComment
in interfaceSessionConfig.Mutable
-
setSessionCookie
- Specified by:
setSessionCookie
in interfaceSessionConfig.Mutable
-
setSessionDomain
- Specified by:
setSessionDomain
in interfaceSessionConfig.Mutable
-
setSessionIdPathParameterName
- Specified by:
setSessionIdPathParameterName
in interfaceSessionConfig.Mutable
-
setSessionPath
- Specified by:
setSessionPath
in interfaceSessionConfig.Mutable
-
setUsingCookies
public void setUsingCookies(boolean value) - Specified by:
setUsingCookies
in interfaceSessionConfig.Mutable
-
setUsingUriParameters
public void setUsingUriParameters(boolean value) - Specified by:
setUsingUriParameters
in 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:ScopedHandler
Scope the handlerDerived implementations should call
ScopedHandler.nextScope(String, Request, HttpServletRequest, HttpServletResponse)
- Overrides:
doScope
in 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 theRequest
object or a wrapper of that request.response
- The response as theResponse
object 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:ScopedHandler
Do the handler work within the scope.Derived implementations should call
ScopedHandler.nextHandle(String, Request, HttpServletRequest, HttpServletResponse)
- Specified by:
doHandle
in 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 theRequest
object or a wrapper of that request.response
- The response as theResponse
object 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
-