- All Known Implementing Classes:
DefaultHttpSessionManager
public interface HttpSessionManager
The HttpSessionManager API.
- Author:
- Manfred Riem ([email protected])
-
Method Summary
Modifier and TypeMethodDescription<T extends EventListener>
voidaddListener
(T listener) Add a listener.void
attributeAdded
(jakarta.servlet.http.HttpSession session, String name, Object value) Attribute added.void
attributeRemoved
(jakarta.servlet.http.HttpSession session, String name, Object value) Attribute removed.void
attributeReplaced
(jakarta.servlet.http.HttpSession session, String name, Object oldValue, Object newValue) Attribute replaced.changeSessionId
(jakarta.servlet.http.HttpServletRequest request) Change the session id and return it.jakarta.servlet.http.HttpSession
createSession
(jakarta.servlet.http.HttpServletRequest request) Create a session.void
destroySession
(jakarta.servlet.http.HttpSession session) Destroys a session.encodeRedirectURL
(jakarta.servlet.http.HttpServletResponse response, String url) Encode the redirect URL.Encode the URL.Set<jakarta.servlet.SessionTrackingMode>
Returns the default session tracking modes.Set<jakarta.servlet.SessionTrackingMode>
Returns the effective session tracking modes.jakarta.servlet.http.HttpSession
getSession
(jakarta.servlet.http.HttpServletRequest request, String currentSessionId) Returns the session.jakarta.servlet.SessionCookieConfig
Returns the session cookie config.int
Get the session timeout (in minutes).boolean
hasSession
(String sessionId) Is the session manager handling this session?void
setSessionTimeout
(int timeout) Set the session timeout (in minutes).void
setSessionTrackingModes
(Set<jakarta.servlet.SessionTrackingMode> sessionTrackingModes) Set the session tracking modes.void
setWebApplication
(WebApplication webApplication) Set the web application.
-
Method Details
-
addListener
Add a listener.- Type Parameters:
T
- the type.- Parameters:
listener
- the listener.
-
attributeAdded
Attribute added.- Parameters:
session
- the HTTP session.name
- the name.value
- the value.
-
attributeRemoved
Attribute removed.- Parameters:
session
- the HTTP session.name
- the name.value
- the value.
-
attributeReplaced
void attributeReplaced(jakarta.servlet.http.HttpSession session, String name, Object oldValue, Object newValue) Attribute replaced.- Parameters:
session
- the HTTP session.name
- the name.oldValue
- the old value.newValue
- the new value.
-
changeSessionId
Change the session id and return it.- Parameters:
request
- the request.- Returns:
- the session id.
-
createSession
jakarta.servlet.http.HttpSession createSession(jakarta.servlet.http.HttpServletRequest request) Create a session.- Parameters:
request
- the request.- Returns:
- the session.
-
destroySession
void destroySession(jakarta.servlet.http.HttpSession session) Destroys a session.- Parameters:
session
- the HTTP session.
-
encodeRedirectURL
Encode the redirect URL.- Parameters:
response
- the HTTP servlet response.url
- the URL.- Returns:
- the encode URL.
-
encodeURL
Encode the URL.- Parameters:
response
- the HTTP servlet response.url
- the URL.- Returns:
- the encoded URL.
-
getDefaultSessionTrackingModes
Set<jakarta.servlet.SessionTrackingMode> getDefaultSessionTrackingModes()Returns the default session tracking modes.- Returns:
- the default session tracking modes
-
getEffectiveSessionTrackingModes
Set<jakarta.servlet.SessionTrackingMode> getEffectiveSessionTrackingModes()Returns the effective session tracking modes.- Returns:
- the effective session tracking modes
-
getSession
jakarta.servlet.http.HttpSession getSession(jakarta.servlet.http.HttpServletRequest request, String currentSessionId) Returns the session.- Parameters:
request
- the request.currentSessionId
- the current session id.- Returns:
- the session
-
getSessionCookieConfig
jakarta.servlet.SessionCookieConfig getSessionCookieConfig()Returns the session cookie config.- Returns:
- the session cookie config
-
getSessionTimeout
int getSessionTimeout()Get the session timeout (in minutes).- Returns:
- the session timeout.
-
hasSession
Is the session manager handling this session?- Parameters:
sessionId
- the session id.- Returns:
- true if there is a session with the given session id.
-
setSessionTimeout
void setSessionTimeout(int timeout) Set the session timeout (in minutes).- Parameters:
timeout
- the timeout.
-
setSessionTrackingModes
Set the session tracking modes.- Parameters:
sessionTrackingModes
- the session tracking modes.
-
setWebApplication
Set the web application.- Parameters:
webApplication
- the web application.
-