Package org.apache.shiro.web.session.mgt
Class DefaultWebSessionManager
- java.lang.Object
-
- org.apache.shiro.session.mgt.AbstractSessionManager
-
- org.apache.shiro.session.mgt.AbstractNativeSessionManager
-
- org.apache.shiro.session.mgt.AbstractValidatingSessionManager
-
- org.apache.shiro.session.mgt.DefaultSessionManager
-
- org.apache.shiro.web.session.mgt.DefaultWebSessionManager
-
- All Implemented Interfaces:
CacheManagerAware
,EventBusAware
,NativeSessionManager
,SessionManager
,ValidatingSessionManager
,Destroyable
,WebSessionManager
public class DefaultWebSessionManager extends DefaultSessionManager implements WebSessionManager
Web-application capableSessionManager
implementation.- Since:
- 0.9
-
-
Field Summary
-
Fields inherited from class org.apache.shiro.session.mgt.DefaultSessionManager
sessionDAO
-
Fields inherited from class org.apache.shiro.session.mgt.AbstractValidatingSessionManager
DEFAULT_SESSION_VALIDATION_INTERVAL, sessionValidationInterval, sessionValidationScheduler, sessionValidationSchedulerEnabled
-
Fields inherited from class org.apache.shiro.session.mgt.AbstractSessionManager
DEFAULT_GLOBAL_SESSION_TIMEOUT, MILLIS_PER_HOUR, MILLIS_PER_MINUTE, MILLIS_PER_SECOND
-
-
Constructor Summary
Constructors Constructor Description DefaultWebSessionManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Session
createExposedSession(Session session, SessionContext context)
protected Session
createExposedSession(Session session, SessionKey key)
protected Serializable
getSessionId(ServletRequest request, ServletResponse response)
Serializable
getSessionId(SessionKey key)
Cookie
getSessionIdCookie()
boolean
isServletContainerSessions()
This is a native session manager implementation, so this method returnsfalse
always.boolean
isSessionIdCookieEnabled()
boolean
isSessionIdUrlRewritingEnabled()
protected void
onExpiration(Session s, ExpiredSessionException ese, SessionKey key)
protected void
onInvalidation(Session session, InvalidSessionException ise, SessionKey key)
protected void
onStart(Session session, SessionContext context)
Stores the Session's ID, usually as a Cookie, to associate with future requests.protected void
onStop(Session session, SessionKey key)
void
setSessionIdCookie(Cookie sessionIdCookie)
void
setSessionIdCookieEnabled(boolean sessionIdCookieEnabled)
void
setSessionIdUrlRewritingEnabled(boolean sessionIdUrlRewritingEnabled)
-
Methods inherited from class org.apache.shiro.session.mgt.DefaultSessionManager
afterExpired, afterStopped, create, delete, doCreateSession, getActiveSessions, getSessionDAO, getSessionFactory, isDeleteInvalidSessions, newSessionInstance, onChange, onExpiration, onStop, retrieveSession, retrieveSessionFromDataSource, setCacheManager, setDeleteInvalidSessions, setSessionDAO, setSessionFactory
-
Methods inherited from class org.apache.shiro.session.mgt.AbstractValidatingSessionManager
afterSessionValidationEnabled, beforeSessionValidationDisabled, createSession, createSessionValidationScheduler, destroy, disableSessionValidation, doGetSession, doValidate, enableSessionValidation, getSessionValidationInterval, getSessionValidationScheduler, getTimeout, isSessionValidationSchedulerEnabled, setSessionValidationInterval, setSessionValidationScheduler, setSessionValidationSchedulerEnabled, validate, validateSessions
-
Methods inherited from class org.apache.shiro.session.mgt.AbstractNativeSessionManager
applyGlobalSessionTimeout, beforeInvalidNotification, checkValid, getAttribute, getAttributeKeys, getEventBus, getHost, getLastAccessTime, getSession, getSessionListeners, getStartTimestamp, getTimeout, isValid, notifyExpiration, notifyStart, notifyStop, publishEvent, removeAttribute, setAttribute, setEventBus, setSessionListeners, setTimeout, start, stop, touch
-
Methods inherited from class org.apache.shiro.session.mgt.AbstractSessionManager
getGlobalSessionTimeout, setGlobalSessionTimeout
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.shiro.session.mgt.SessionManager
getSession, start
-
-
-
-
Constructor Detail
-
DefaultWebSessionManager
public DefaultWebSessionManager()
-
-
Method Detail
-
getSessionIdCookie
public Cookie getSessionIdCookie()
-
setSessionIdCookie
public void setSessionIdCookie(Cookie sessionIdCookie)
-
isSessionIdCookieEnabled
public boolean isSessionIdCookieEnabled()
-
setSessionIdCookieEnabled
public void setSessionIdCookieEnabled(boolean sessionIdCookieEnabled)
-
isSessionIdUrlRewritingEnabled
public boolean isSessionIdUrlRewritingEnabled()
-
setSessionIdUrlRewritingEnabled
public void setSessionIdUrlRewritingEnabled(boolean sessionIdUrlRewritingEnabled)
-
createExposedSession
protected Session createExposedSession(Session session, SessionContext context)
- Overrides:
createExposedSession
in classAbstractNativeSessionManager
-
createExposedSession
protected Session createExposedSession(Session session, SessionKey key)
- Overrides:
createExposedSession
in classAbstractNativeSessionManager
-
onStart
protected void onStart(Session session, SessionContext context)
Stores the Session's ID, usually as a Cookie, to associate with future requests.- Overrides:
onStart
in classAbstractNativeSessionManager
- Parameters:
session
- the session that was justcreated
.context
- theSessionContext
that was used to start the session.
-
getSessionId
public Serializable getSessionId(SessionKey key)
- Overrides:
getSessionId
in classDefaultSessionManager
-
getSessionId
protected Serializable getSessionId(ServletRequest request, ServletResponse response)
-
onExpiration
protected void onExpiration(Session s, ExpiredSessionException ese, SessionKey key)
- Overrides:
onExpiration
in classAbstractValidatingSessionManager
-
onInvalidation
protected void onInvalidation(Session session, InvalidSessionException ise, SessionKey key)
- Overrides:
onInvalidation
in classAbstractValidatingSessionManager
-
onStop
protected void onStop(Session session, SessionKey key)
- Overrides:
onStop
in classAbstractNativeSessionManager
-
isServletContainerSessions
public boolean isServletContainerSessions()
This is a native session manager implementation, so this method returnsfalse
always.- Specified by:
isServletContainerSessions
in interfaceWebSessionManager
- Returns:
false
always- Since:
- 1.2
-
-