Uses of Interface
org.apache.shiro.session.Session
-
Packages that use Session Package Description org.apache.shiro.mgt Provides the masterSecurityManager
interface and a default implementation hierarchy for managing all aspects of Shiro's functionality in an application.org.apache.shiro.session Components related to managing sessions, the time-based data contexts in which a Subject interacts with an application.org.apache.shiro.session.mgt SessionManager
components supporting enterprise session management.org.apache.shiro.session.mgt.eis EIS (Enterprise Information System)-tier components that can perform CRUD operations for sessions using any EIS API.org.apache.shiro.subject Components supporting theSubject
interface, the most important concept in Shiro's API.org.apache.shiro.subject.support Concrete support implementations of most of theorg.apache.shiro.subject
interfaces. -
-
Uses of Session in org.apache.shiro.mgt
Methods in org.apache.shiro.mgt that return Session Modifier and Type Method Description Session
SessionsSecurityManager. getSession(SessionKey key)
protected Session
DefaultSecurityManager. resolveContextSession(SubjectContext context)
Session
SessionsSecurityManager. start(SessionContext context)
Methods in org.apache.shiro.mgt with parameters of type Session Modifier and Type Method Description protected Subject
DefaultSubjectFactory. newSubjectInstance(PrincipalCollection principals, boolean authenticated, String host, Session session, SecurityManager securityManager)
Deprecated.since 1.2 - overrideDefaultSubjectFactory.createSubject(org.apache.shiro.subject.SubjectContext)
directly if you need to instantiate a customSubject
class. -
Uses of Session in org.apache.shiro.session
Classes in org.apache.shiro.session that implement Session Modifier and Type Class Description class
ProxiedSession
SimpleSession
implementation that immediately delegates all corresponding calls to an underlying proxied session instance.Fields in org.apache.shiro.session declared as Session Modifier and Type Field Description protected Session
ProxiedSession. delegate
The proxied instanceMethods in org.apache.shiro.session with parameters of type Session Modifier and Type Method Description void
SessionListener. onExpiration(Session session)
Notification callback that occurs when the corresponding Session has expired.void
SessionListenerAdapter. onExpiration(Session session)
Adapter no-op implementation - does nothing and returns immediately.void
SessionListener. onStart(Session session)
Notification callback that occurs when the corresponding Session has started.void
SessionListenerAdapter. onStart(Session session)
Adapter no-op implementation - does nothing and returns immediately.void
SessionListener. onStop(Session session)
Notification callback that occurs when the corresponding Session has stopped, either programmatically viastop()
or automatically upon a subject logging out.void
SessionListenerAdapter. onStop(Session session)
Adapter no-op implementation - does nothing and returns immediately.Constructors in org.apache.shiro.session with parameters of type Session Constructor Description ProxiedSession(Session target)
Constructs an instance that proxies the specifiedtarget
. -
Uses of Session in org.apache.shiro.session.mgt
Subinterfaces of Session in org.apache.shiro.session.mgt Modifier and Type Interface Description interface
ValidatingSession
AValidatingSession
is aSession
that is capable of determining it is valid or not and is able to validate itself if necessary.Classes in org.apache.shiro.session.mgt that implement Session Modifier and Type Class Description class
DelegatingSession
A DelegatingSession is a client-tier representation of a server sideSession
.class
ImmutableProxiedSession
Implementation of theSession
interface that proxies anotherSession
, but does not allow any 'write' operations to the underlying session.class
SimpleSession
SimpleSession
JavaBeans-compatible POJO implementation, intended to be used on the business/server tier.Methods in org.apache.shiro.session.mgt that return Session Modifier and Type Method Description protected Session
AbstractNativeSessionManager. beforeInvalidNotification(Session session)
Returns the session instance to use to pass to registeredSessionListener
s for notification that the session has been invalidated (stopped or expired).protected Session
AbstractNativeSessionManager. createExposedSession(Session session, SessionContext context)
protected Session
AbstractNativeSessionManager. createExposedSession(Session session, SessionKey key)
protected abstract Session
AbstractNativeSessionManager. createSession(SessionContext context)
Creates a newSession Session
instance based on the specified (possiblynull
) initialization data.protected Session
AbstractValidatingSessionManager. createSession(SessionContext context)
Session
SessionFactory. createSession(SessionContext initData)
Creates a newSession
instance based on the specified contextual initialization data.Session
SimpleSessionFactory. createSession(SessionContext initData)
Creates a newSimpleSession
instance retaining the context'shost
if one can be found.protected abstract Session
AbstractValidatingSessionManager. doCreateSession(SessionContext initData)
protected Session
DefaultSessionManager. doCreateSession(SessionContext context)
protected abstract Session
AbstractNativeSessionManager. doGetSession(SessionKey key)
protected Session
AbstractValidatingSessionManager. doGetSession(SessionKey key)
Session
AbstractNativeSessionManager. getSession(SessionKey key)
Session
SessionManager. getSession(SessionKey key)
Retrieves the session corresponding to the specified contextual data (such as a session ID if applicable), ornull
if no Session could be found.protected Session
DefaultSessionManager. newSessionInstance(SessionContext context)
protected abstract Session
AbstractValidatingSessionManager. retrieveSession(SessionKey key)
Looks up a session from the underlying data store based on the specified session key.protected Session
DefaultSessionManager. retrieveSession(SessionKey sessionKey)
protected Session
DefaultSessionManager. retrieveSessionFromDataSource(Serializable sessionId)
Session
AbstractNativeSessionManager. start(SessionContext context)
Session
SessionManager. start(SessionContext context)
Starts a new session based on the specified contextual initialization data, which can be used by the underlying implementation to determine how exactly to create the internal Session instance.Methods in org.apache.shiro.session.mgt that return types with arguments of type Session Modifier and Type Method Description protected abstract Collection<Session>
AbstractValidatingSessionManager. getActiveSessions()
protected Collection<Session>
DefaultSessionManager. getActiveSessions()
Methods in org.apache.shiro.session.mgt with parameters of type Session Modifier and Type Method Description protected void
AbstractValidatingSessionManager. afterExpired(Session session)
protected void
DefaultSessionManager. afterExpired(Session session)
protected void
AbstractNativeSessionManager. afterStopped(Session session)
protected void
DefaultSessionManager. afterStopped(Session session)
protected void
AbstractNativeSessionManager. applyGlobalSessionTimeout(Session session)
protected Session
AbstractNativeSessionManager. beforeInvalidNotification(Session session)
Returns the session instance to use to pass to registeredSessionListener
s for notification that the session has been invalidated (stopped or expired).protected void
DefaultSessionManager. create(Session session)
Persists the given session instance to an underlying EIS (Enterprise Information System).protected Session
AbstractNativeSessionManager. createExposedSession(Session session, SessionContext context)
protected Session
AbstractNativeSessionManager. createExposedSession(Session session, SessionKey key)
protected void
DefaultSessionManager. delete(Session session)
protected void
AbstractValidatingSessionManager. doValidate(Session session)
protected long
AbstractValidatingSessionManager. getTimeout(Session session)
Subclass template hook in case per-session timeout is not based ongetTimeout()
.protected void
AbstractNativeSessionManager. notifyExpiration(Session session)
protected void
AbstractNativeSessionManager. notifyStart(Session session)
Notifies any interestedSessionListener
s that a Session has started.protected void
AbstractNativeSessionManager. notifyStop(Session session)
protected void
AbstractNativeSessionManager. onChange(Session s)
protected void
DefaultSessionManager. onChange(Session session)
protected void
AbstractValidatingSessionManager. onExpiration(Session session)
protected void
AbstractValidatingSessionManager. onExpiration(Session s, ExpiredSessionException ese, SessionKey key)
protected void
DefaultSessionManager. onExpiration(Session session)
protected void
AbstractValidatingSessionManager. onInvalidation(Session s, InvalidSessionException ise, SessionKey key)
protected void
AbstractNativeSessionManager. onStart(Session session, SessionContext context)
Template method that allows subclasses to react to a new session being created.protected void
AbstractNativeSessionManager. onStop(Session session)
protected void
AbstractNativeSessionManager. onStop(Session session, SessionKey key)
protected void
DefaultSessionManager. onStop(Session session)
protected void
AbstractValidatingSessionManager. validate(Session session, SessionKey key)
Constructors in org.apache.shiro.session.mgt with parameters of type Session Constructor Description ImmutableProxiedSession(Session target)
Constructs a new instance of this class proxying the specifiedSession
. -
Uses of Session in org.apache.shiro.session.mgt.eis
Methods in org.apache.shiro.session.mgt.eis that return Session Modifier and Type Method Description protected abstract Session
AbstractSessionDAO. doReadSession(Serializable sessionId)
Subclass implementation hook that retrieves the Session object from the underlying EIS ornull
if a session with that ID could not be found.protected Session
EnterpriseCacheSessionDAO. doReadSession(Serializable sessionId)
protected Session
MemorySessionDAO. doReadSession(Serializable sessionId)
protected Session
CachingSessionDAO. getCachedSession(Serializable sessionId)
Returns the cached session with the correspondingsessionId
ornull
if there is no session cached under that id (or if there is no Cache).protected Session
CachingSessionDAO. getCachedSession(Serializable sessionId, org.apache.shiro.cache.Cache<Serializable,Session> cache)
Returns the Session with the specified id from the specified cache.Session
AbstractSessionDAO. readSession(Serializable sessionId)
Retrieves the Session object from the underlying EIS identified by sessionId by delegating to theAbstractSessionDAO.doReadSession(java.io.Serializable)
method.Session
CachingSessionDAO. readSession(Serializable sessionId)
Attempts to acquire the Session from the cache first using the session ID as the cache key.Session
SessionDAO. readSession(Serializable sessionId)
Retrieves the session from the EIS uniquely identified by the specifiedsessionId
.protected Session
MemorySessionDAO. storeSession(Serializable id, Session session)
Methods in org.apache.shiro.session.mgt.eis that return types with arguments of type Session Modifier and Type Method Description protected org.apache.shiro.cache.Cache<Serializable,Session>
CachingSessionDAO. createActiveSessionsCache()
Creates a cache instance used to store active sessions.Collection<Session>
CachingSessionDAO. getActiveSessions()
Returns all active sessions in the system.Collection<Session>
MemorySessionDAO. getActiveSessions()
Collection<Session>
SessionDAO. getActiveSessions()
Returns all sessions in the EIS that are considered active, meaning all sessions that haven't been stopped/expired.org.apache.shiro.cache.Cache<Serializable,Session>
CachingSessionDAO. getActiveSessionsCache()
Returns the cache instance to use for storing active sessions.Methods in org.apache.shiro.session.mgt.eis with parameters of type Session Modifier and Type Method Description protected void
AbstractSessionDAO. assignSessionId(Session session, Serializable sessionId)
Utility method available to subclasses that wish to assign a generated session ID to the session instance directly.protected void
CachingSessionDAO. cache(Session session, Serializable sessionId)
Caches the specified session under the cache entry key ofsessionId
.protected void
CachingSessionDAO. cache(Session session, Serializable sessionId, org.apache.shiro.cache.Cache<Serializable,Session> cache)
Caches the specified session in the given cache under the key ofsessionId
.Serializable
AbstractSessionDAO. create(Session session)
Creates the session by delegating EIS creation to subclasses via theAbstractSessionDAO.doCreate(org.apache.shiro.session.Session)
method, and then asserting that the returned sessionId is not null.Serializable
CachingSessionDAO. create(Session session)
Callssuper.create(session)
, then caches the session keyed by the returnedsessionId
, and then returns thissessionId
.Serializable
SessionDAO. create(Session session)
Inserts a new Session record into the underling EIS (e.g.void
CachingSessionDAO. delete(Session session)
Removes the specified session from any cache and then permanently deletes the session from the EIS by delegating toCachingSessionDAO.doDelete(org.apache.shiro.session.Session)
.void
MemorySessionDAO. delete(Session session)
void
SessionDAO. delete(Session session)
Deletes the associated EIS record of the specifiedsession
.protected abstract Serializable
AbstractSessionDAO. doCreate(Session session)
Subclass hook to actually persist the given Session instance to the underlying EIS.protected Serializable
EnterpriseCacheSessionDAO. doCreate(Session session)
protected Serializable
MemorySessionDAO. doCreate(Session session)
protected abstract void
CachingSessionDAO. doDelete(Session session)
Subclass implementation hook to permanently delete the given Session from the underlying EIS.protected void
EnterpriseCacheSessionDAO. doDelete(Session session)
protected abstract void
CachingSessionDAO. doUpdate(Session session)
Subclass implementation hook to actually persist theSession
's state to the underlying EIS.protected void
EnterpriseCacheSessionDAO. doUpdate(Session session)
Serializable
JavaUuidSessionIdGenerator. generateId(Session session)
Serializable
RandomSessionIdGenerator. generateId(Session session)
Returns the String value of the configuredRandom
'snextLong()
invocation.Serializable
SessionIdGenerator. generateId(Session session)
Generates a new ID to be applied to the specifiedSession
instance.protected Serializable
AbstractSessionDAO. generateSessionId(Session session)
Generates a new ID to be applied to the specifiedsession
instance.protected Session
MemorySessionDAO. storeSession(Serializable id, Session session)
protected void
CachingSessionDAO. uncache(Session session)
Removes the specified Session from the cache.void
CachingSessionDAO. update(Session session)
Updates the state of the given session to the EIS by first delegating toCachingSessionDAO.doUpdate(org.apache.shiro.session.Session)
.void
MemorySessionDAO. update(Session session)
void
SessionDAO. update(Session session)
Updates (persists) data from a previously created Session instance in the EIS identified by{@link Session#getId() session.getId()}
.Method parameters in org.apache.shiro.session.mgt.eis with type arguments of type Session Modifier and Type Method Description protected void
CachingSessionDAO. cache(Session session, Serializable sessionId, org.apache.shiro.cache.Cache<Serializable,Session> cache)
Caches the specified session in the given cache under the key ofsessionId
.protected Session
CachingSessionDAO. getCachedSession(Serializable sessionId, org.apache.shiro.cache.Cache<Serializable,Session> cache)
Returns the Session with the specified id from the specified cache.void
CachingSessionDAO. setActiveSessionsCache(org.apache.shiro.cache.Cache<Serializable,Session> cache)
Sets the cache instance to use for storing active sessions. -
Uses of Session in org.apache.shiro.subject
Methods in org.apache.shiro.subject that return Session Modifier and Type Method Description Session
Subject. getSession()
Returns the applicationSession
associated with this Subject.Session
Subject. getSession(boolean create)
Returns the applicationSession
associated with this Subject.Session
SubjectContext. getSession()
Returns theSession
to use when building theSubject
instance.Session
SubjectContext. resolveSession()
Methods in org.apache.shiro.subject with parameters of type Session Modifier and Type Method Description Subject.Builder
Subject.Builder. session(Session session)
Ensures theSubject
being built will use the specifiedSession
instance.void
SubjectContext. setSession(Session session)
Sets theSession
to use when building theSubject
instance. -
Uses of Session in org.apache.shiro.subject.support
Fields in org.apache.shiro.subject.support declared as Session Modifier and Type Field Description protected Session
DelegatingSubject. session
Methods in org.apache.shiro.subject.support that return Session Modifier and Type Method Description protected Session
DelegatingSubject. decorate(Session session)
Session
DefaultSubjectContext. getSession()
Session
DelegatingSubject. getSession()
Session
DelegatingSubject. getSession(boolean create)
Session
DefaultSubjectContext. resolveSession()
Methods in org.apache.shiro.subject.support with parameters of type Session Modifier and Type Method Description protected Session
DelegatingSubject. decorate(Session session)
void
DefaultSubjectContext. setSession(Session session)
Constructors in org.apache.shiro.subject.support with parameters of type Session Constructor Description DelegatingSubject(PrincipalCollection principals, boolean authenticated, String host, Session session, boolean sessionCreationEnabled, SecurityManager securityManager)
DelegatingSubject(PrincipalCollection principals, boolean authenticated, String host, Session session, SecurityManager securityManager)
-