org.eclipse.jetty.server
接口 SessionManager

所有超级接口:
LifeCycle
所有已知实现类:
AbstractSessionManager, HashSessionManager, JDBCSessionManager

public interface SessionManager
extends LifeCycle


嵌套类摘要
 
从接口 org.eclipse.jetty.util.component.LifeCycle 继承的嵌套类/接口
LifeCycle.Listener
 
字段摘要
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.
 
方法摘要
 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()
          已过时。 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)
           
 
从接口 org.eclipse.jetty.util.component.LifeCycle 继承的方法
addLifeCycleListener, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, removeLifeCycleListener, start, stop
 

字段详细信息

__SessionCookieProperty

static final String __SessionCookieProperty
Session cookie name. Defaults to JSESSIONID, but can be set with the org.eclipse.jetty.servlet.SessionCookie context init parameter.

另请参见:
常量字段值

__DefaultSessionCookie

static final String __DefaultSessionCookie
另请参见:
常量字段值

__SessionIdPathParameterNameProperty

static final String __SessionIdPathParameterNameProperty
Session id path parameter name. Defaults to 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.

另请参见:
常量字段值

__DefaultSessionIdPathParameterName

static final String __DefaultSessionIdPathParameterName
另请参见:
常量字段值

__CheckRemoteSessionEncoding

static final String __CheckRemoteSessionEncoding
另请参见:
常量字段值

__SessionDomainProperty

static final String __SessionDomainProperty
Session Domain. If this property is set as a ServletContext InitParam, then it is used as the domain for session cookies. If it is not set, then no domain is specified for the session cookie.

另请参见:
常量字段值

__DefaultSessionDomain

static final String __DefaultSessionDomain

__SessionPathProperty

static final String __SessionPathProperty
Session Path. If this property is set as a ServletContext InitParam, then it is used as the path for the session cookie. If it is not set, then the context path is used as the path for the cookie.

另请参见:
常量字段值

__MaxAgeProperty

static final String __MaxAgeProperty
Session Max Age. If this property is set as a ServletContext InitParam, then it is used as the max age for the session cookie. If it is not set, then a max age of -1 is used.

另请参见:
常量字段值
方法详细信息

getHttpSession

HttpSession getHttpSession(String id)
Returns the HttpSession with the given session id

参数:
id - the session id
返回:
the HttpSession with the corresponding id or null if no session with the given id exists

newHttpSession

HttpSession newHttpSession(HttpServletRequest request)
Creates a new HttpSession.

参数:
request - the HttpServletRequest containing the requested session id
返回:
the new HttpSession

getHttpOnly

boolean getHttpOnly()
返回:
true if session cookies should be HTTP-only (Microsoft extension)
另请参见:
HttpCookie.isHttpOnly()

getMaxInactiveInterval

int getMaxInactiveInterval()
返回:
the max period of inactivity, after which the session is invalidated, in seconds.
另请参见:
setMaxInactiveInterval(int)

setMaxInactiveInterval

void setMaxInactiveInterval(int seconds)
Sets the max period of inactivity, after which the session is invalidated, in seconds.

参数:
seconds - the max inactivity period, in seconds.
另请参见:
getMaxInactiveInterval()

setSessionHandler

void setSessionHandler(SessionHandler handler)
Sets the SessionHandler.

参数:
handler - the SessionHandler object

addEventListener

void addEventListener(EventListener listener)
Adds an event listener for session-related events.

参数:
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)

removeEventListener

void removeEventListener(EventListener listener)
Removes an event listener for for session-related events.

参数:
listener - the session event listener to remove
另请参见:
addEventListener(EventListener)

clearEventListeners

void clearEventListeners()
Removes all event listeners for session-related events.

另请参见:
removeEventListener(EventListener)

getSessionCookie

HttpCookie getSessionCookie(HttpSession session,
                            String contextPath,
                            boolean requestIsSecure)
Gets a Cookie for a session.

参数:
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).
返回:
if this 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.

getSessionIdManager

SessionIdManager getSessionIdManager()
返回:
the cross context session id manager.
另请参见:
setSessionIdManager(SessionIdManager)

getMetaManager

@Deprecated
SessionIdManager getMetaManager()
已过时。 use getSessionIdManager()

返回:
the cross context session id manager.

setSessionIdManager

void setSessionIdManager(SessionIdManager idManager)
Sets the cross context session id manager

参数:
idManager - the cross context session id manager.
另请参见:
getSessionIdManager()

isValid

boolean isValid(HttpSession session)
参数:
session - the session to test for validity
返回:
whether the given session is valid, that is, it has not been invalidated.

getNodeId

String getNodeId(HttpSession session)
参数:
session - the session object
返回:
the unique id of the session within the cluster, extended with an optional node id.
另请参见:
getClusterId(HttpSession)

getClusterId

String getClusterId(HttpSession session)
参数:
session - the session object
返回:
the unique id of the session within the cluster (without a node id extension)
另请参见:
getNodeId(HttpSession)

access

HttpCookie access(HttpSession session,
                  boolean secure)
Called by the SessionHandler when a session is first accessed by a request.

参数:
session - the session object
secure - whether the request is secure or not
返回:
the session cookie. If not null, this cookie should be set on the response to either migrate the session or to refresh a session cookie that may expire.
另请参见:
complete(HttpSession)

complete

void complete(HttpSession session)
Called by the SessionHandler when a session is last accessed by a request.

参数:
session - the session object
另请参见:
access(HttpSession, boolean)

setSessionIdPathParameterName

void setSessionIdPathParameterName(String parameterName)
Sets the session id URL path parameter name.

参数:
parameterName - the URL path parameter name for session id URL rewriting (null or "none" for no rewriting).
另请参见:
getSessionIdPathParameterName(), getSessionIdPathParameterNamePrefix()

getSessionIdPathParameterName

String getSessionIdPathParameterName()
返回:
the URL path parameter name for session id URL rewriting, by default "jsessionid".
另请参见:
setSessionIdPathParameterName(String)

getSessionIdPathParameterNamePrefix

String getSessionIdPathParameterNamePrefix()
返回:
a formatted version of getSessionIdPathParameterName(), by default ";" + sessionIdParameterName + "=", for easier lookup in URL strings.
另请参见:
getSessionIdPathParameterName()

isUsingCookies

boolean isUsingCookies()
返回:
whether the session management is handled via cookies.

isUsingURLs

boolean isUsingURLs()
返回:
whether the session management is handled via URLs.

getDefaultSessionTrackingModes

Set<SessionTrackingMode> getDefaultSessionTrackingModes()

getEffectiveSessionTrackingModes

Set<SessionTrackingMode> getEffectiveSessionTrackingModes()

setSessionTrackingModes

void setSessionTrackingModes(Set<SessionTrackingMode> sessionTrackingModes)

getSessionCookieConfig

SessionCookieConfig getSessionCookieConfig()

isCheckingRemoteSessionIdEncoding

boolean isCheckingRemoteSessionIdEncoding()
返回:
True if absolute URLs are check for remoteness before being session encoded.

setCheckingRemoteSessionIdEncoding

void setCheckingRemoteSessionIdEncoding(boolean remote)
参数:
remote - True if absolute URLs are check for remoteness before being session encoded.


Copyright © 2013. All Rights Reserved.