|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SessionManager
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle |
---|
LifeCycle.Listener |
Field Summary | |
---|---|
static String |
__CheckRemoteSessionEncoding
|
static String |
__DefaultSessionCookie
|
static String |
__DefaultSessionDomain
|
static String |
__DefaultSessionIdPathParameterName
|
static String |
__MaxAgeProperty
Session Max Age. |
static String |
__SessionCookieProperty
Session cookie name. |
static String |
__SessionDomainProperty
Session Domain. |
static String |
__SessionIdPathParameterNameProperty
Session id path parameter name. |
static String |
__SessionPathProperty
Session Path. |
Method Summary | |
---|---|
HttpCookie |
access(HttpSession session,
boolean secure)
Called by the SessionHandler when a session is first accessed by a request. |
void |
addEventListener(EventListener listener)
Adds an event listener for session-related events. |
void |
clearEventListeners()
Removes all event listeners for session-related events. |
void |
complete(HttpSession session)
Called by the SessionHandler when a session is last accessed by a request. |
String |
getClusterId(HttpSession session)
|
Set<SessionTrackingMode> |
getDefaultSessionTrackingModes()
|
Set<SessionTrackingMode> |
getEffectiveSessionTrackingModes()
|
boolean |
getHttpOnly()
|
HttpSession |
getHttpSession(String id)
Returns the HttpSession with the given session id |
int |
getMaxInactiveInterval()
|
SessionIdManager |
getMetaManager()
Deprecated. use getSessionIdManager() |
String |
getNodeId(HttpSession session)
|
HttpCookie |
getSessionCookie(HttpSession session,
String contextPath,
boolean requestIsSecure)
Gets a Cookie for a session. |
SessionCookieConfig |
getSessionCookieConfig()
|
SessionIdManager |
getSessionIdManager()
|
String |
getSessionIdPathParameterName()
|
String |
getSessionIdPathParameterNamePrefix()
|
boolean |
isCheckingRemoteSessionIdEncoding()
|
boolean |
isUsingCookies()
|
boolean |
isUsingURLs()
|
boolean |
isValid(HttpSession session)
|
HttpSession |
newHttpSession(HttpServletRequest request)
Creates a new HttpSession . |
void |
removeEventListener(EventListener listener)
Removes an event listener for for session-related events. |
void |
setCheckingRemoteSessionIdEncoding(boolean remote)
|
void |
setMaxInactiveInterval(int seconds)
Sets the max period of inactivity, after which the session is invalidated, in seconds. |
void |
setSessionHandler(SessionHandler handler)
Sets the SessionHandler . |
void |
setSessionIdManager(SessionIdManager idManager)
Sets the cross context session id manager |
void |
setSessionIdPathParameterName(String parameterName)
Sets the session id URL path parameter name. |
void |
setSessionTrackingModes(Set<SessionTrackingMode> sessionTrackingModes)
|
Methods inherited from interface org.eclipse.jetty.util.component.LifeCycle |
---|
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop |
Field Detail |
---|
static final String __SessionCookieProperty
JSESSIONID
, but can be set with the
org.eclipse.jetty.servlet.SessionCookie
context init parameter.
static final String __DefaultSessionCookie
static final String __SessionIdPathParameterNameProperty
jsessionid
, but can be set with the
org.eclipse.jetty.servlet.SessionIdPathParameterName
context init parameter.
If set to null or "none" no URL rewriting will be done.
static final String __DefaultSessionIdPathParameterName
static final String __CheckRemoteSessionEncoding
static final String __SessionDomainProperty
static final String __DefaultSessionDomain
static final String __SessionPathProperty
static final String __MaxAgeProperty
Method Detail |
---|
HttpSession getHttpSession(String id)
HttpSession
with the given session id
id
- the session id
HttpSession
with the corresponding id or null if no session with the given id existsHttpSession newHttpSession(HttpServletRequest request)
HttpSession
.
request
- the HttpServletRequest containing the requested session id
HttpSession
boolean getHttpOnly()
HttpCookie.isHttpOnly()
int getMaxInactiveInterval()
setMaxInactiveInterval(int)
void setMaxInactiveInterval(int seconds)
seconds
- the max inactivity period, in seconds.getMaxInactiveInterval()
void setSessionHandler(SessionHandler handler)
SessionHandler
.
handler
- the SessionHandler
objectvoid addEventListener(EventListener listener)
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.removeEventListener(EventListener)
void removeEventListener(EventListener listener)
listener
- the session event listener to removeaddEventListener(EventListener)
void clearEventListeners()
removeEventListener(EventListener)
HttpCookie getSessionCookie(HttpSession session, String contextPath, boolean requestIsSecure)
session
- the session to which the cookie should refer.contextPath
- the context to which the cookie should be linked.
The client will only send the cookie value when requesting resources under this path.requestIsSecure
- whether the client is accessing the server over a secure protocol (i.e. HTTPS).
SessionManager
uses cookies, then this method will return a new
cookie object
that should be set on the client in order to link future HTTP requests
with the session
. If cookies are not in use, this method returns null
.SessionIdManager getSessionIdManager()
setSessionIdManager(SessionIdManager)
@Deprecated SessionIdManager getMetaManager()
getSessionIdManager()
void setSessionIdManager(SessionIdManager idManager)
idManager
- the cross context session id manager.getSessionIdManager()
boolean isValid(HttpSession session)
session
- the session to test for validity
String getNodeId(HttpSession session)
session
- the session object
getClusterId(HttpSession)
String getClusterId(HttpSession session)
session
- the session object
getNodeId(HttpSession)
HttpCookie access(HttpSession session, boolean secure)
SessionHandler
when a session is first accessed by a request.
session
- the session objectsecure
- whether the request is secure or not
complete(HttpSession)
void complete(HttpSession session)
SessionHandler
when a session is last accessed by a request.
session
- the session objectaccess(HttpSession, boolean)
void setSessionIdPathParameterName(String parameterName)
parameterName
- the URL path parameter name for session id URL rewriting (null or "none" for no rewriting).getSessionIdPathParameterName()
,
getSessionIdPathParameterNamePrefix()
String getSessionIdPathParameterName()
setSessionIdPathParameterName(String)
String getSessionIdPathParameterNamePrefix()
getSessionIdPathParameterName()
, by default
";" + sessionIdParameterName + "=", for easier lookup in URL strings.getSessionIdPathParameterName()
boolean isUsingCookies()
boolean isUsingURLs()
Set<SessionTrackingMode> getDefaultSessionTrackingModes()
Set<SessionTrackingMode> getEffectiveSessionTrackingModes()
void setSessionTrackingModes(Set<SessionTrackingMode> sessionTrackingModes)
SessionCookieConfig getSessionCookieConfig()
boolean isCheckingRemoteSessionIdEncoding()
void setCheckingRemoteSessionIdEncoding(boolean remote)
remote
- True if absolute URLs are check for remoteness before being session encoded.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |