DefaultSessionManager

Default business-tier implementation of a {@link ValidatingSessionManager}. All session CRUD operations are delegated to an internal {@link SessionDAO}.

Constructors

this
this()
Undocumented in source.

Members

Functions

afterExpired
void afterExpired(Session session)
Undocumented in source. Be warned that the author may not have intended to support it.
afterStopped
void afterStopped(Session session)
Undocumented in source. Be warned that the author may not have intended to support it.
create
void create(Session session)

Persists the given session instance to an underlying EIS (Enterprise Information System). This implementation delegates and calls <code>this.{@link SessionDAO sessionDAO}.{@link SessionDAO#create(hunt.shiro.session.Session) create}(session);<code>

doCreateSession
Session doCreateSession(SessionContext context)
Undocumented in source. Be warned that the author may not have intended to support it.
getActiveSessions
Session[] getActiveSessions()
Undocumented in source. Be warned that the author may not have intended to support it.
getSessionDAO
SessionDAO getSessionDAO()
Undocumented in source. Be warned that the author may not have intended to support it.
getSessionFactory
SessionFactory getSessionFactory()

Returns the {@code SessionFactory} used to generate new {@link Session} instances. The default instance is a {@link SimpleSessionFactory}.

getSessionId
string getSessionId(SessionKey sessionKey)
Undocumented in source. Be warned that the author may not have intended to support it.
isDeleteInvalidSessions
bool isDeleteInvalidSessions()

Returns {@code true} if sessions should be automatically deleted after they are discovered to be invalid, {@code false} if invalid sessions will be manually deleted by some process external to Shiro's control. The default is {@code true} to ensure no orphans exist in the underlying data store. <h4>Usage</h4> It is ok to set this to {@code false} <b><em>ONLY</em></b> if you have some other process that you manage yourself that periodically deletes invalid sessions from the backing data store over time, such as via a Quartz or Cron job. If you do not do this, the invalid sessions will become 'orphans' and fill up the data store over time. <p/> This property is provided because some systems need the ability to perform querying/reporting against sessions in the data store, even after they have stopped or expired. Setting this attribute to {@code false} will allow such querying, but with the caveat that the application developer/configurer deletes the sessions themselves by some other means (cron, quartz, etc).

newSessionInstance
Session newSessionInstance(SessionContext context)
Undocumented in source. Be warned that the author may not have intended to support it.
onChange
void onChange(Session session)
Undocumented in source. Be warned that the author may not have intended to support it.
onExpiration
void onExpiration(Session session)
Undocumented in source. Be warned that the author may not have intended to support it.
onStop
void onStop(Session session)
Undocumented in source. Be warned that the author may not have intended to support it.
remove
void remove(Session session)
Undocumented in source. Be warned that the author may not have intended to support it.
retrieveSession
Session retrieveSession(SessionKey sessionKey)
Undocumented in source. Be warned that the author may not have intended to support it.
retrieveSessionFromDataSource
Session retrieveSessionFromDataSource(string sessionId)
Undocumented in source. Be warned that the author may not have intended to support it.
setCacheManager
void setCacheManager(CacheManager cacheManager)
Undocumented in source. Be warned that the author may not have intended to support it.
setDeleteInvalidSessions
void setDeleteInvalidSessions(bool deleteInvalidSessions)

Sets whether or not sessions should be automatically deleted after they are discovered to be invalid. Default value is {@code true} to ensure no orphans will exist in the underlying data store. <h4>WARNING</h4> Only set this value to {@code false} if you are manually going to remove sessions yourself by some process (quartz, cron, etc) external to Shiro's control. See the {@link #isDeleteInvalidSessions() isDeleteInvalidSessions()} JavaDoc for more.

setSessionDAO
void setSessionDAO(SessionDAO sessionDAO)
Undocumented in source. Be warned that the author may not have intended to support it.
setSessionFactory
void setSessionFactory(SessionFactory sessionFactory)

Sets the {@code SessionFactory} used to generate new {@link Session} instances. The default instance is a {@link SimpleSessionFactory}.

Variables

sessionDAO
SessionDAO sessionDAO;
Undocumented in source.

Inherited Members

From AbstractValidatingSessionManager

DEFAULT_SESSION_VALIDATION_INTERVAL
enum DEFAULT_SESSION_VALIDATION_INTERVAL;

The default interval at which sessions will be validated (1 hour); This can be overridden by calling {@link #setSessionValidationInterval(long)}

sessionValidationSchedulerEnabled
bool sessionValidationSchedulerEnabled;
Undocumented in source.
sessionValidationScheduler
SessionValidationScheduler sessionValidationScheduler;

Scheduler used to validate sessions on a regular basis.

sessionValidationInterval
long sessionValidationInterval;
Undocumented in source.
isSessionValidationSchedulerEnabled
bool isSessionValidationSchedulerEnabled()
Undocumented in source. Be warned that the author may not have intended to support it.
setSessionValidationSchedulerEnabled
void setSessionValidationSchedulerEnabled(bool sessionValidationSchedulerEnabled)
Undocumented in source. Be warned that the author may not have intended to support it.
setSessionValidationScheduler
void setSessionValidationScheduler(SessionValidationScheduler sessionValidationScheduler)
Undocumented in source. Be warned that the author may not have intended to support it.
getSessionValidationScheduler
SessionValidationScheduler getSessionValidationScheduler()
Undocumented in source. Be warned that the author may not have intended to support it.
setSessionValidationInterval
void setSessionValidationInterval(long sessionValidationInterval)

If using the underlying default <tt>SessionValidationScheduler</tt> (that is, the {@link #setSessionValidationScheduler(SessionValidationScheduler) setSessionValidationScheduler} method is never called) , this method allows one to specify how frequently session should be validated (to check for orphans). The default value is {@link #DEFAULT_SESSION_VALIDATION_INTERVAL}. <p/> If you override the default scheduler, it is assumed that overriding instance 'knows' how often to validate sessions, and this attribute will be ignored. <p/> Unless this method is called, the default value is {@link #DEFAULT_SESSION_VALIDATION_INTERVAL}.

getSessionValidationInterval
long getSessionValidationInterval()
Undocumented in source. Be warned that the author may not have intended to support it.
doGetSession
Session doGetSession(SessionKey key)
Undocumented in source. Be warned that the author may not have intended to support it.
retrieveSession
Session retrieveSession(SessionKey key)

Looks up a session from the underlying data store based on the specified session key.

createSession
Session createSession(SessionContext context)
Undocumented in source. Be warned that the author may not have intended to support it.
doCreateSession
Session doCreateSession(SessionContext initData)
Undocumented in source.
validate
void validate(Session session, SessionKey key)
Undocumented in source. Be warned that the author may not have intended to support it.
onExpiration
void onExpiration(Session s, ExpiredSessionException ese, SessionKey key)
Undocumented in source. Be warned that the author may not have intended to support it.
onExpiration
void onExpiration(Session session)
Undocumented in source. Be warned that the author may not have intended to support it.
afterExpired
void afterExpired(Session session)
Undocumented in source. Be warned that the author may not have intended to support it.
onInvalidation
void onInvalidation(Session s, InvalidSessionException ise, SessionKey key)
Undocumented in source. Be warned that the author may not have intended to support it.
doValidate
void doValidate(Session session)
Undocumented in source. Be warned that the author may not have intended to support it.
getTimeout
long getTimeout(Session session)

Subclass template hook in case per-session timeout is not based on {@link hunt.shiro.session.Session#getTimeout()}. <p/> <p>This implementation merely returns {@link hunt.shiro.session.Session#getTimeout()}</p>

createSessionValidationScheduler
SessionValidationScheduler createSessionValidationScheduler()
Undocumented in source. Be warned that the author may not have intended to support it.
enableSessionValidation
void enableSessionValidation()
Undocumented in source. Be warned that the author may not have intended to support it.
afterSessionValidationEnabled
void afterSessionValidationEnabled()
Undocumented in source. Be warned that the author may not have intended to support it.
disableSessionValidation
void disableSessionValidation()
Undocumented in source. Be warned that the author may not have intended to support it.
beforeSessionValidationDisabled
void beforeSessionValidationDisabled()
Undocumented in source. Be warned that the author may not have intended to support it.
destroy
void destroy()
Undocumented in source. Be warned that the author may not have intended to support it.
validateSessions
void validateSessions()

@see ValidatingSessionManager#validateSessions()

getActiveSessions
Session[] getActiveSessions()
Undocumented in source.

From CacheManagerAware

setCacheManager
void setCacheManager(CacheManager cacheManager)

Sets the available CacheManager instance on this component.

Meta