|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.server.session.SessionManager
public final class SessionManager
Manages sessions in a web-webApp.
| Field Summary | |
|---|---|
protected static L10N |
L
|
protected static java.util.logging.Logger |
log
|
| Constructor Summary | |
|---|---|
SessionManager(WebApp webApp)
Creates and initializes a new session manager |
|
| Method Summary | |
|---|---|
void |
addActivationListener(HttpSessionActivationListener listener)
Adds a new HttpSessionActivationListener. |
void |
addAttributeListener(HttpSessionAttributeListener listener)
Adds a new HttpSessionAttributeListener. |
void |
addListener(HttpSessionListener listener)
Adds a new HttpSessionListener. |
void |
close()
Cleans up the sessions when the WebApp shuts down gracefully. |
boolean |
containsSession(java.lang.String id)
Returns true if the session exists in this manager. |
java.lang.String |
createCookieValue()
|
protected java.lang.String |
createCookieValue(java.lang.Object owner)
|
SessionImpl |
createSession(boolean isCreate,
HttpServletRequest request,
java.lang.String sessionId,
long now,
boolean fromCookie)
Finds a session in the session store, creating one if 'create' is true |
SessionImpl |
createSession(java.lang.String oldId,
long now,
HttpServletRequest request,
boolean fromCookie)
Create a new session. |
java.lang.String |
createSessionId(HttpServletRequest request)
Creates a pseudo-random session id. |
java.lang.String |
createSessionId(HttpServletRequest request,
boolean create)
Creates a pseudo-random session id. |
java.lang.String |
createSessionIdImpl(HttpServletRequest request)
|
boolean |
enableSessionCookies()
Returns true if sessions use the cookie header. |
boolean |
enableSessionUrls()
Returns true if sessions can use the session rewriting. |
int |
getActiveSessionCount()
Returns the current number of active sessions. |
SessionManagerMXBean |
getAdmin()
Returns the admin. |
java.lang.String |
getAlternateSessionPrefix()
Returns the alternate session prefix, before the URL for wap. |
java.lang.String |
getCookieDomain()
Returns the default session cookie domain. |
long |
getCookieLength()
Returns the cookie length. |
long |
getCookieMaxAge()
Returns the max-age of the session cookie. |
java.lang.String |
getCookieName()
Returns the default cookie name. |
java.lang.String |
getCookiePort()
Gets the cookie ports. |
boolean |
getCookieSecure()
Returns the secure of the session cookie. |
int |
getCookieVersion()
Returns the cookie version. |
java.util.logging.Logger |
getDebug()
Returns the debug log |
java.lang.String |
getDistributionId()
|
long |
getMaxIdleTime()
Returns the idle time. |
int |
getReuseSessionId()
True if the server should reuse the current session id if the session doesn't exist. |
java.lang.String |
getSaveMode()
Returns the string value of the save-mode. |
SessionImpl |
getSession(java.lang.String key,
long now,
boolean create,
boolean fromCookie)
Returns a session from the session store, returning null if there's no cached session. |
int |
getSessionActiveCount()
Returns the active sessions. |
long |
getSessionCreateCount()
Returns the created sessions. |
long |
getSessionInvalidateCount()
Returns the invalidate sessions. |
int |
getSessionMax()
Returns the maximum number of sessions. |
java.lang.String |
getSessionPrefix()
Returns the session prefix, ie.. |
java.lang.String |
getSessionSerializationDebug(java.lang.String id)
Returns a debug string for the session |
ByteStreamCache |
getSessionStore()
Returns the session store. |
long |
getSessionTimeout()
Returns the default session timeout in milliseconds. |
long |
getSessionTimeoutCount()
Returns the timeout sessions. |
java.lang.String |
getSSLCookieName()
Returns the SSL cookie name. |
void |
handleAlarm(Alarm alarm)
Timeout for reaping old sessions |
void |
init()
|
boolean |
isClosed()
Returns true if the sessions are closed. |
boolean |
isCookieAppendServerIndex()
Sets module session id generation. |
boolean |
isCookieHttpOnly()
Returns the http-only of the session cookie. |
boolean |
isHessianSerialization()
Returns true for Hessian serialization. |
boolean |
isInvalidateAfterListener()
True if the session should be invalidated after the listener. |
boolean |
isOwner(java.lang.String id)
|
boolean |
isPersistenceEnabled()
|
boolean |
isSaveAfterRequest()
True if sessions should be saved after the request. |
boolean |
isSaveBeforeFlush()
True if sessions should be saved before each flush. |
boolean |
isSaveBeforeHeaders()
True if sessions should be saved before the HTTP headers. |
boolean |
isSaveOnlyOnShutdown()
True if sessions should only be saved on shutdown. |
boolean |
isSaveOnShutdown()
True if sessions should be saved on shutdown. |
void |
notifyRemove(java.lang.String id)
Notification from the cluster. |
boolean |
reuseSessionId(boolean fromCookie)
True if the server should reuse the current session id if the session doesn't exist. |
void |
setAlwaysLoadSession(boolean load)
True if sessions should always be loadd. |
void |
setAlwaysSaveSession(boolean save)
True if sessions should always be saved. |
void |
setCookieAppendServerIndex(boolean isAppend)
Sets module session id generation. |
void |
setCookieDomain(java.lang.String domain)
Sets the default session cookie domain. |
void |
setCookieHttpOnly(boolean httpOnly)
Sets the http-only of the session cookie. |
void |
setCookieLength(int cookieLength)
Sets the cookie length |
void |
setCookieMaxAge(Period maxAge)
Sets the max-age of the session cookie. |
void |
setCookieModuloCluster(boolean isModulo)
Sets module session id generation. |
void |
setCookiePort(java.lang.String port)
Sets the cookie ports. |
void |
setCookieSecure(boolean secure)
Sets the secure of the session cookie. |
void |
setCookieVersion(int cookieVersion)
Sets the cookie version. |
void |
setDistributionId(java.lang.String distributionId)
|
void |
setEnableCookies(boolean enableCookies)
Returns true if sessions use the cookie header. |
void |
setEnableUrlRewriting(boolean enableUrls)
Returns true if sessions can use the session rewriting. |
void |
setIgnoreSerializationErrors(boolean ignore)
True if serialization errors should just fail silently. |
void |
setInvalidateAfterListener(boolean inv)
True if the session should be invalidated after the listener. |
void |
setReuseSessionId(java.lang.String reuse)
True if the server should reuse the current session id if the session doesn't exist. |
void |
setSaveMode(java.lang.String mode)
Sets the save-mode: before-flush, before-headers, after-request, on-shutdown |
void |
setSaveOnlyOnShutdown(boolean save)
True if sessions should only be saved on shutdown. |
void |
setSaveOnShutdown(boolean save)
True if sessions should only be saved on shutdown. |
void |
setSerializationType(java.lang.String type)
Sets the serialization type. |
void |
setSessionMax(int max)
Returns the maximum number of sessions. |
void |
setSessionTimeout(long timeout)
Set the default session timeout in minutes |
void |
setUsePersistentStore(boolean enable)
Sets the cluster store. |
void |
start()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static final L10N L
protected static final java.util.logging.Logger log
| Constructor Detail |
|---|
public SessionManager(WebApp webApp)
throws java.lang.Exception
webApp - the web-webApp webApp
java.lang.Exception| Method Detail |
|---|
public SessionManagerMXBean getAdmin()
public java.lang.String getSessionPrefix()
public java.lang.String getAlternateSessionPrefix()
public int getCookieVersion()
public void setCookieVersion(int cookieVersion)
public void setCookiePort(java.lang.String port)
public java.lang.String getCookiePort()
public java.util.logging.Logger getDebug()
public void setAlwaysLoadSession(boolean load)
public void setAlwaysSaveSession(boolean save)
public boolean isSaveOnShutdown()
public boolean isSaveOnlyOnShutdown()
public boolean isSaveBeforeHeaders()
public boolean isSaveBeforeFlush()
public boolean isSaveAfterRequest()
public void setSaveMode(java.lang.String mode)
throws ConfigException
ConfigExceptionpublic java.lang.String getSaveMode()
public void setSaveOnlyOnShutdown(boolean save)
public void setSaveOnShutdown(boolean save)
public void setSerializationType(java.lang.String type)
public boolean isHessianSerialization()
public void setInvalidateAfterListener(boolean inv)
public boolean isInvalidateAfterListener()
public int getActiveSessionCount()
public int getSessionActiveCount()
public long getSessionCreateCount()
public long getSessionTimeoutCount()
public long getSessionInvalidateCount()
public void addListener(HttpSessionListener listener)
public void addActivationListener(HttpSessionActivationListener listener)
public void addAttributeListener(HttpSessionAttributeListener listener)
public void setIgnoreSerializationErrors(boolean ignore)
public int getReuseSessionId()
public boolean reuseSessionId(boolean fromCookie)
public void setReuseSessionId(java.lang.String reuse)
throws ConfigException
ConfigExceptionpublic boolean isClosed()
public void setUsePersistentStore(boolean enable)
throws java.lang.Exception
java.lang.Exceptionpublic boolean isPersistenceEnabled()
public java.lang.String getDistributionId()
public void setDistributionId(java.lang.String distributionId)
public long getSessionTimeout()
public void setSessionTimeout(long timeout)
public long getMaxIdleTime()
public int getSessionMax()
public void setSessionMax(int max)
public boolean enableSessionCookies()
public void setEnableCookies(boolean enableCookies)
public boolean enableSessionUrls()
public void setEnableUrlRewriting(boolean enableUrls)
public java.lang.String getCookieName()
public java.lang.String getSSLCookieName()
public java.lang.String getCookieDomain()
public void setCookieDomain(java.lang.String domain)
public long getCookieMaxAge()
public void setCookieMaxAge(Period maxAge)
public boolean getCookieSecure()
public void setCookieSecure(boolean secure)
public boolean isCookieHttpOnly()
public void setCookieHttpOnly(boolean httpOnly)
public void setCookieLength(int cookieLength)
public long getCookieLength()
public void setCookieModuloCluster(boolean isModulo)
public void setCookieAppendServerIndex(boolean isAppend)
public boolean isCookieAppendServerIndex()
public void init()
public void start()
throws java.lang.Exception
java.lang.Exceptionpublic ByteStreamCache getSessionStore()
public boolean containsSession(java.lang.String id)
public java.lang.String createSessionId(HttpServletRequest request)
sessionGroup - possibly assigned by the web server
public java.lang.String createSessionId(HttpServletRequest request,
boolean create)
sessionGroup - possibly assigned by the web serverpublic java.lang.String createCookieValue()
public java.lang.String createSessionIdImpl(HttpServletRequest request)
public boolean isOwner(java.lang.String id)
protected java.lang.String createCookieValue(java.lang.Object owner)
public SessionImpl createSession(boolean isCreate,
HttpServletRequest request,
java.lang.String sessionId,
long now,
boolean fromCookie)
create - if the session doesn't exist, create itrequestId - the session id from the requestnow - the time in millisecondsfromCookie - true if the session id comes from a cookie
public SessionImpl getSession(java.lang.String key,
long now,
boolean create,
boolean fromCookie)
key - the session idnow - the time in milliseconds
public SessionImpl createSession(java.lang.String oldId,
long now,
HttpServletRequest request,
boolean fromCookie)
oldId - the id passed to the request. Reuse if possible.now - the current datesessionGroup - the srun index for this machinepublic void notifyRemove(java.lang.String id)
public java.lang.String getSessionSerializationDebug(java.lang.String id)
public void handleAlarm(Alarm alarm)
handleAlarm in interface AlarmListenerpublic void close()
public java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||