cloud.piranha.api.HttpSessionManager
, javax.servlet.SessionCookieConfig
public class DefaultHttpSessionManager
extends java.lang.Object
implements cloud.piranha.api.HttpSessionManager, javax.servlet.SessionCookieConfig
Modifier and Type | Field | Description |
---|---|---|
protected java.util.ArrayList<javax.servlet.http.HttpSessionAttributeListener> |
attributeListeners |
Stores the session listeners.
|
protected java.lang.String |
comment |
Stores the comment.
|
protected java.util.Set<javax.servlet.SessionTrackingMode> |
defaultSessionTrackingModes |
Stores the default session tracking modes.
|
protected java.lang.String |
domain |
Stores the domain.
|
protected boolean |
httpOnly |
Stores the HTTP only flag.
|
protected java.util.ArrayList<javax.servlet.http.HttpSessionIdListener> |
idListeners |
Stores the session id listeners.
|
protected int |
maxAge |
Stores the max age.
|
protected java.lang.String |
name |
Stores the name.
|
protected java.lang.String |
path |
Stores the path.
|
protected boolean |
secure |
Stores the secure flag.
|
protected java.util.ArrayList<javax.servlet.http.HttpSessionListener> |
sessionListeners |
Stores the session listeners.
|
protected java.util.Map<java.lang.String,javax.servlet.http.HttpSession> |
sessions |
Stores the sessions.
|
protected int |
sessionTimeout |
Stores the session timeout (in minutes).
|
protected java.util.Set<javax.servlet.SessionTrackingMode> |
sessionTrackingModes |
Stores the session tracking modes.
|
protected cloud.piranha.api.WebApplication |
webApplication |
Stores the web application.
|
Constructor | Description |
---|---|
DefaultHttpSessionManager() |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
<T extends java.util.EventListener> |
addListener(T listener) |
Add a listener.
|
void |
attributeAdded(javax.servlet.http.HttpSession session,
java.lang.String name,
java.lang.Object value) |
Attribute added.
|
void |
attributeRemoved(javax.servlet.http.HttpSession session,
java.lang.String name) |
Attributed removed.
|
void |
attributeReplaced(javax.servlet.http.HttpSession session,
java.lang.String name,
java.lang.Object value) |
Attribute removed.
|
java.lang.String |
changeSessionId(javax.servlet.http.HttpServletRequest request) |
Change the session id.
|
javax.servlet.http.HttpSession |
createSession(cloud.piranha.api.WebApplication webApplication,
javax.servlet.http.HttpServletRequest request) |
Create the session.
|
void |
destroySession(javax.servlet.http.HttpSession session) |
Destroy the session.
|
java.lang.String |
encodeRedirectURL(javax.servlet.http.HttpServletResponse response,
java.lang.String url) |
Encode the redirect URL.
|
java.lang.String |
encodeURL(javax.servlet.http.HttpServletResponse response,
java.lang.String url) |
Encode the URL.
|
java.lang.String |
getComment() |
Get the comment.
|
java.util.Set<javax.servlet.SessionTrackingMode> |
getDefaultSessionTrackingModes() |
Get the default session tracking modes.
|
java.lang.String |
getDomain() |
Get the domain.
|
java.util.Set<javax.servlet.SessionTrackingMode> |
getEffectiveSessionTrackingModes() |
Get the effective session tracking modes.
|
int |
getMaxAge() |
Get the max age.
|
java.lang.String |
getName() |
Get the name.
|
java.lang.String |
getPath() |
Get the path.
|
javax.servlet.http.HttpSession |
getSession(cloud.piranha.api.WebApplication webApplication,
javax.servlet.http.HttpServletRequest request,
java.lang.String currentSessionId) |
Get the session.
|
javax.servlet.SessionCookieConfig |
getSessionCookieConfig() |
Get the session cookie config.
|
int |
getSessionTimeout() |
Get the session timeout (in minutes).
|
boolean |
hasSession(java.lang.String sessionId) |
Has a session with the given id.
|
boolean |
isHttpOnly() |
Is HTTP only?
|
boolean |
isSecure() |
Is secure.
|
void |
setComment(java.lang.String comment) |
Set the comment.
|
void |
setDomain(java.lang.String domain) |
Set the domain.
|
void |
setHttpOnly(boolean httpOnly) |
Set the HTTP only flag.
|
void |
setMaxAge(int maxAge) |
Set the max age.
|
void |
setName(java.lang.String name) |
Set the name.
|
void |
setPath(java.lang.String path) |
Set the path.
|
void |
setSecure(boolean secure) |
Set the secure flag.
|
void |
setSessionTimeout(int sessionTimeout) |
Set the session timeout.
|
void |
setSessionTrackingModes(java.util.Set<javax.servlet.SessionTrackingMode> sessionTrackingModes) |
Set the session tracking modes.
|
protected final java.util.ArrayList<javax.servlet.http.HttpSessionAttributeListener> attributeListeners
protected java.lang.String comment
protected final java.util.Set<javax.servlet.SessionTrackingMode> defaultSessionTrackingModes
protected java.lang.String domain
protected boolean httpOnly
protected final java.util.ArrayList<javax.servlet.http.HttpSessionIdListener> idListeners
protected int maxAge
protected java.lang.String name
protected java.lang.String path
protected boolean secure
protected final java.util.ArrayList<javax.servlet.http.HttpSessionListener> sessionListeners
protected int sessionTimeout
protected java.util.Set<javax.servlet.SessionTrackingMode> sessionTrackingModes
protected java.util.Map<java.lang.String,javax.servlet.http.HttpSession> sessions
protected cloud.piranha.api.WebApplication webApplication
public javax.servlet.http.HttpSession createSession(cloud.piranha.api.WebApplication webApplication, javax.servlet.http.HttpServletRequest request)
createSession
in interface cloud.piranha.api.HttpSessionManager
webApplication
- the web application.request
- the request.public javax.servlet.http.HttpSession getSession(cloud.piranha.api.WebApplication webApplication, javax.servlet.http.HttpServletRequest request, java.lang.String currentSessionId)
getSession
in interface cloud.piranha.api.HttpSessionManager
webApplication
- the web application.request
- the request.currentSessionId
- the current session id.public java.lang.String changeSessionId(javax.servlet.http.HttpServletRequest request)
changeSessionId
in interface cloud.piranha.api.HttpSessionManager
request
- the request.public <T extends java.util.EventListener> void addListener(T listener)
addListener
in interface cloud.piranha.api.HttpSessionManager
T
- the type.listener
- the listener.public void attributeAdded(javax.servlet.http.HttpSession session, java.lang.String name, java.lang.Object value)
attributeAdded
in interface cloud.piranha.api.HttpSessionManager
session
- the HTTP session.name
- the name.value
- the value.public void attributeReplaced(javax.servlet.http.HttpSession session, java.lang.String name, java.lang.Object value)
attributeReplaced
in interface cloud.piranha.api.HttpSessionManager
session
- the HTTP session.name
- the name.value
- the value.public void attributeRemoved(javax.servlet.http.HttpSession session, java.lang.String name)
attributeRemoved
in interface cloud.piranha.api.HttpSessionManager
session
- the HTTP session.name
- the name.public void destroySession(javax.servlet.http.HttpSession session)
destroySession
in interface cloud.piranha.api.HttpSessionManager
session
- the session.public java.lang.String encodeRedirectURL(javax.servlet.http.HttpServletResponse response, java.lang.String url)
encodeRedirectURL
in interface cloud.piranha.api.HttpSessionManager
response
- the response.url
- the redirect url.public java.lang.String encodeURL(javax.servlet.http.HttpServletResponse response, java.lang.String url)
encodeURL
in interface cloud.piranha.api.HttpSessionManager
response
- the response.url
- the url.public java.lang.String getComment()
getComment
in interface javax.servlet.SessionCookieConfig
public java.util.Set<javax.servlet.SessionTrackingMode> getDefaultSessionTrackingModes()
getDefaultSessionTrackingModes
in interface cloud.piranha.api.HttpSessionManager
public java.lang.String getDomain()
getDomain
in interface javax.servlet.SessionCookieConfig
public java.util.Set<javax.servlet.SessionTrackingMode> getEffectiveSessionTrackingModes()
getEffectiveSessionTrackingModes
in interface cloud.piranha.api.HttpSessionManager
public int getMaxAge()
getMaxAge
in interface javax.servlet.SessionCookieConfig
public java.lang.String getName()
getName
in interface javax.servlet.SessionCookieConfig
public java.lang.String getPath()
getPath
in interface javax.servlet.SessionCookieConfig
public javax.servlet.SessionCookieConfig getSessionCookieConfig()
getSessionCookieConfig
in interface cloud.piranha.api.HttpSessionManager
public int getSessionTimeout()
getSessionTimeout
in interface cloud.piranha.api.HttpSessionManager
public boolean hasSession(java.lang.String sessionId)
hasSession
in interface cloud.piranha.api.HttpSessionManager
sessionId
- the session id.public boolean isHttpOnly()
isHttpOnly
in interface javax.servlet.SessionCookieConfig
public boolean isSecure()
isSecure
in interface javax.servlet.SessionCookieConfig
public void setComment(java.lang.String comment)
setComment
in interface javax.servlet.SessionCookieConfig
comment
- the comment.public void setDomain(java.lang.String domain)
setDomain
in interface javax.servlet.SessionCookieConfig
domain
- the domainpublic void setHttpOnly(boolean httpOnly)
setHttpOnly
in interface javax.servlet.SessionCookieConfig
httpOnly
- the HTTP only flag.public void setMaxAge(int maxAge)
setMaxAge
in interface javax.servlet.SessionCookieConfig
maxAge
- the max age.public void setName(java.lang.String name)
setName
in interface javax.servlet.SessionCookieConfig
name
- the name.public void setPath(java.lang.String path)
setPath
in interface javax.servlet.SessionCookieConfig
path
- the path.public void setSecure(boolean secure)
setSecure
in interface javax.servlet.SessionCookieConfig
secure
- the secure flag.public void setSessionTimeout(int sessionTimeout)
setSessionTimeout
in interface cloud.piranha.api.HttpSessionManager
sessionTimeout
- the session timeout.public void setSessionTrackingModes(java.util.Set<javax.servlet.SessionTrackingMode> sessionTrackingModes)
setSessionTrackingModes
in interface cloud.piranha.api.HttpSessionManager
sessionTrackingModes
- the session tracking modes.Copyright © 2020 Piranha Cloud. All rights reserved.