org.apache.shiro.web.session.mgt
Class DefaultWebSessionManager

java.lang.Object
  extended by org.apache.shiro.session.mgt.AbstractSessionManager
      extended by org.apache.shiro.session.mgt.AbstractNativeSessionManager
          extended by org.apache.shiro.session.mgt.AbstractValidatingSessionManager
              extended by org.apache.shiro.session.mgt.DefaultSessionManager
                  extended by org.apache.shiro.web.session.mgt.DefaultWebSessionManager
All Implemented Interfaces:
CacheManagerAware, NativeSessionManager, SessionManager, ValidatingSessionManager, Destroyable, WebSessionManager

public class DefaultWebSessionManager
extends DefaultSessionManager
implements WebSessionManager

Web-application capable SessionManager 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
DefaultWebSessionManager()
           
 
Method Summary
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 returns false always.
 boolean isSessionIdCookieEnabled()
           
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)
           
 
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, getHost, getLastAccessTime, getSession, getSessionListeners, getStartTimestamp, getTimeout, isValid, notifyExpiration, notifyStart, notifyStop, removeAttribute, setAttribute, 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)

createExposedSession

protected Session createExposedSession(Session session,
                                       SessionContext context)
Overrides:
createExposedSession in class AbstractNativeSessionManager

createExposedSession

protected Session createExposedSession(Session session,
                                       SessionKey key)
Overrides:
createExposedSession in class AbstractNativeSessionManager

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 class AbstractNativeSessionManager
Parameters:
session - the session that was just created.
context - the SessionContext that was used to start the session.

getSessionId

public Serializable getSessionId(SessionKey key)
Overrides:
getSessionId in class DefaultSessionManager

getSessionId

protected Serializable getSessionId(ServletRequest request,
                                    ServletResponse response)

onExpiration

protected void onExpiration(Session s,
                            ExpiredSessionException ese,
                            SessionKey key)
Overrides:
onExpiration in class AbstractValidatingSessionManager

onInvalidation

protected void onInvalidation(Session session,
                              InvalidSessionException ise,
                              SessionKey key)
Overrides:
onInvalidation in class AbstractValidatingSessionManager

onStop

protected void onStop(Session session,
                      SessionKey key)
Overrides:
onStop in class AbstractNativeSessionManager

isServletContainerSessions

public boolean isServletContainerSessions()
This is a native session manager implementation, so this method returns false always.

Specified by:
isServletContainerSessions in interface WebSessionManager
Returns:
false always
Since:
1.2


Copyright © 2004-2014 The Apache Software Foundation. All Rights Reserved.