Uses of Interface
org.apache.shiro.session.Session
Packages that use Session
Package
Description
Provides the master
SecurityManager interface and a default implementation
hierarchy for managing all aspects of Shiro's functionality in an application.Components related to managing sessions, the time-based data contexts in which a Subject
interacts with an application.
SessionManager components supporting enterprise session management.EIS (Enterprise Information System)-tier components that can perform CRUD operations for sessions
using any EIS API.
Components supporting the
Subject interface, the most important concept in
Shiro's API.Concrete support implementations of most of the
org.apache.shiro.subject interfaces.-
Uses of Session in org.apache.shiro.mgt
Methods in org.apache.shiro.mgt that return SessionModifier and TypeMethodDescriptionSessionsSecurityManager.getSession(SessionKey key) protected SessionDefaultSecurityManager.resolveContextSession(SubjectContext context) SessionsSecurityManager.start(SessionContext context) Methods in org.apache.shiro.mgt with parameters of type SessionModifier and TypeMethodDescriptionprotected SubjectDefaultSubjectFactory.newSubjectInstance(PrincipalCollection principals, boolean authenticated, String host, Session session, SecurityManager securityManager) Deprecated. -
Uses of Session in org.apache.shiro.session
Classes in org.apache.shiro.session that implement SessionModifier and TypeClassDescriptionclassSimpleSessionimplementation that immediately delegates all corresponding calls to an underlying proxied session instance.Fields in org.apache.shiro.session declared as SessionModifier and TypeFieldDescriptionprotected final SessionProxiedSession.delegateThe proxied instanceMethods in org.apache.shiro.session with parameters of type SessionModifier and TypeMethodDescriptionvoidSessionListener.onExpiration(Session session) Notification callback that occurs when the corresponding Session has expired.voidSessionListenerAdapter.onExpiration(Session session) Adapter no-op implementation - does nothing and returns immediately.voidNotification callback that occurs when the corresponding Session has started.voidAdapter no-op implementation - does nothing and returns immediately.voidNotification callback that occurs when the corresponding Session has stopped, either programmatically viastop()or automatically upon a subject logging out.voidAdapter no-op implementation - does nothing and returns immediately.Constructors in org.apache.shiro.session with parameters of type SessionModifierConstructorDescriptionProxiedSession(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.mgtModifier and TypeInterfaceDescriptioninterfaceAValidatingSessionis aSessionthat 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 SessionModifier and TypeClassDescriptionclassA DelegatingSession is a client-tier representation of a server sideSession.classImplementation of theSessioninterface that proxies anotherSession, but does not allow any 'write' operations to the underlying session.classSimpleSessionJavaBeans-compatible POJO implementation, intended to be used on the business/server tier.Methods in org.apache.shiro.session.mgt that return SessionModifier and TypeMethodDescriptionprotected SessionAbstractNativeSessionManager.beforeInvalidNotification(Session session) Returns the session instance to use to pass to registeredSessionListeners for notification that the session has been invalidated (stopped or expired).protected SessionAbstractNativeSessionManager.createExposedSession(Session session, SessionContext context) protected SessionAbstractNativeSessionManager.createExposedSession(Session session, SessionKey key) protected abstract SessionAbstractNativeSessionManager.createSession(SessionContext context) Creates a newSession Sessioninstance based on the specified (possiblynull) initialization data.protected SessionAbstractValidatingSessionManager.createSession(SessionContext context) SessionFactory.createSession(SessionContext initData) Creates a newSessioninstance based on the specified contextual initialization data.SimpleSessionFactory.createSession(SessionContext initData) Creates a newSimpleSessioninstance retaining the context'shostif one can be found.protected abstract SessionAbstractValidatingSessionManager.doCreateSession(SessionContext initData) protected SessionDefaultSessionManager.doCreateSession(SessionContext context) protected abstract SessionAbstractNativeSessionManager.doGetSession(SessionKey key) protected final SessionAbstractValidatingSessionManager.doGetSession(SessionKey key) AbstractNativeSessionManager.getSession(SessionKey key) SessionManager.getSession(SessionKey key) Retrieves the session corresponding to the specified contextual data (such as a session ID if applicable), ornullif no Session could be found.protected SessionDefaultSessionManager.newSessionInstance(SessionContext context) protected abstract SessionAbstractValidatingSessionManager.retrieveSession(SessionKey key) Looks up a session from the underlying data store based on the specified session key.protected SessionDefaultSessionManager.retrieveSession(SessionKey sessionKey) protected SessionDefaultSessionManager.retrieveSessionFromDataSource(Serializable sessionId) AbstractNativeSessionManager.start(SessionContext context) 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 SessionModifier and TypeMethodDescriptionprotected abstract Collection<Session> AbstractValidatingSessionManager.getActiveSessions()protected Collection<Session> DefaultSessionManager.getActiveSessions()Methods in org.apache.shiro.session.mgt with parameters of type SessionModifier and TypeMethodDescriptionprotected voidAbstractValidatingSessionManager.afterExpired(Session session) protected voidDefaultSessionManager.afterExpired(Session session) protected voidAbstractNativeSessionManager.afterStopped(Session session) protected voidDefaultSessionManager.afterStopped(Session session) protected voidAbstractNativeSessionManager.applyGlobalSessionTimeout(Session session) protected SessionAbstractNativeSessionManager.beforeInvalidNotification(Session session) Returns the session instance to use to pass to registeredSessionListeners for notification that the session has been invalidated (stopped or expired).protected voidPersists the given session instance to an underlying EIS (Enterprise Information System).protected SessionAbstractNativeSessionManager.createExposedSession(Session session, SessionContext context) protected SessionAbstractNativeSessionManager.createExposedSession(Session session, SessionKey key) protected voidprotected voidAbstractValidatingSessionManager.doValidate(Session session) protected longAbstractValidatingSessionManager.getTimeout(Session session) Subclass template hook in case per-session timeout is not based ongetTimeout().protected voidAbstractNativeSessionManager.notifyExpiration(Session session) protected voidAbstractNativeSessionManager.notifyStart(Session session) Notifies any interestedSessionListeners that a Session has started.protected voidAbstractNativeSessionManager.notifyStop(Session session) protected voidprotected voidprotected voidAbstractValidatingSessionManager.onExpiration(Session session) protected voidAbstractValidatingSessionManager.onExpiration(Session s, ExpiredSessionException ese, SessionKey key) protected voidDefaultSessionManager.onExpiration(Session session) protected voidAbstractValidatingSessionManager.onInvalidation(Session s, InvalidSessionException ise, SessionKey key) protected voidAbstractNativeSessionManager.onStart(Session session, SessionContext context) Template method that allows subclasses to react to a new session being created.protected voidprotected voidAbstractNativeSessionManager.onStop(Session session, SessionKey key) protected voidprotected voidAbstractValidatingSessionManager.validate(Session session, SessionKey key) Constructors in org.apache.shiro.session.mgt with parameters of type SessionModifierConstructorDescriptionImmutableProxiedSession(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 SessionModifier and TypeMethodDescriptionprotected abstract SessionAbstractSessionDAO.doReadSession(Serializable sessionId) Subclass implementation hook that retrieves the Session object from the underlying EIS ornullif a session with that ID could not be found.protected SessionEnterpriseCacheSessionDAO.doReadSession(Serializable sessionId) protected SessionMemorySessionDAO.doReadSession(Serializable sessionId) protected SessionCachingSessionDAO.getCachedSession(Serializable sessionId) Returns the cached session with the correspondingsessionIdornullif there is no session cached under that id (or if there is no Cache).protected SessionCachingSessionDAO.getCachedSession(Serializable sessionId, org.apache.shiro.cache.Cache<Serializable, Session> cache) Returns the Session with the specified id from the specified cache.AbstractSessionDAO.readSession(Serializable sessionId) Retrieves the Session object from the underlying EIS identified by sessionId by delegating to theAbstractSessionDAO.doReadSession(java.io.Serializable)method.CachingSessionDAO.readSession(Serializable sessionId) Attempts to acquire the Session from the cache first using the session ID as the cache key.SessionDAO.readSession(Serializable sessionId) Retrieves the session from the EIS uniquely identified by the specifiedsessionId.protected SessionMemorySessionDAO.storeSession(Serializable id, Session session) Methods in org.apache.shiro.session.mgt.eis that return types with arguments of type SessionModifier and TypeMethodDescriptionprotected org.apache.shiro.cache.Cache<Serializable, Session> CachingSessionDAO.createActiveSessionsCache()Creates a cache instance used to store active sessions.CachingSessionDAO.getActiveSessions()Returns all active sessions in the system.MemorySessionDAO.getActiveSessions()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 SessionModifier and TypeMethodDescriptionprotected voidAbstractSessionDAO.assignSessionId(Session session, Serializable sessionId) Utility method available to subclasses that wish to assign a generated session ID to the session instance directly.protected voidCachingSessionDAO.cache(Session session, Serializable sessionId) Caches the specified session under the cache entry key ofsessionId.protected voidCachingSessionDAO.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.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.Callssuper.create(session), then caches the session keyed by the returnedsessionId, and then returns thissessionId.Inserts a new Session record into the underling EIS (e.g.voidRemoves the specified session from any cache and then permanently deletes the session from the EIS by delegating toCachingSessionDAO.doDelete(org.apache.shiro.session.Session).voidvoidDeletes the associated EIS record of the specifiedsession.protected abstract SerializableSubclass hook to actually persist the given Session instance to the underlying EIS.protected Serializableprotected Serializableprotected abstract voidSubclass implementation hook to permanently delete the given Session from the underlying EIS.protected voidprotected abstract voidSubclass implementation hook to actually persist theSession's state to the underlying EIS.protected voidJavaUuidSessionIdGenerator.generateId(Session session) RandomSessionIdGenerator.generateId(Session session) Returns the String value of the configuredRandom'snextLong()invocation.SessionIdGenerator.generateId(Session session) Generates a new ID to be applied to the specifiedSessioninstance.protected SerializableAbstractSessionDAO.generateSessionId(Session session) Generates a new ID to be applied to the specifiedsessioninstance.protected SessionMemorySessionDAO.storeSession(Serializable id, Session session) protected voidRemoves the specified Session from the cache.voidUpdates the state of the given session to the EIS by first delegating toCachingSessionDAO.doUpdate(org.apache.shiro.session.Session).voidvoidUpdates (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 SessionModifier and TypeMethodDescriptionprotected voidCachingSessionDAO.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 SessionCachingSessionDAO.getCachedSession(Serializable sessionId, org.apache.shiro.cache.Cache<Serializable, Session> cache) Returns the Session with the specified id from the specified cache.voidCachingSessionDAO.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 SessionModifier and TypeMethodDescriptionSubject.getSession()Returns the applicationSessionassociated with this Subject.Subject.getSession(boolean create) Returns the applicationSessionassociated with this Subject.SubjectContext.getSession()Returns theSessionto use when building theSubjectinstance.SubjectContext.resolveSession()Methods in org.apache.shiro.subject with parameters of type SessionModifier and TypeMethodDescriptionEnsures theSubjectbeing built will use the specifiedSessioninstance.voidSubjectContext.setSession(Session session) Sets theSessionto use when building theSubjectinstance. -
Uses of Session in org.apache.shiro.subject.support
Fields in org.apache.shiro.subject.support declared as SessionMethods in org.apache.shiro.subject.support that return SessionModifier and TypeMethodDescriptionprotected SessionDefaultSubjectContext.getSession()DelegatingSubject.getSession()DelegatingSubject.getSession(boolean create) DefaultSubjectContext.resolveSession()Methods in org.apache.shiro.subject.support with parameters of type SessionModifier and TypeMethodDescriptionprotected SessionvoidDefaultSubjectContext.setSession(Session session) Constructors in org.apache.shiro.subject.support with parameters of type SessionModifierConstructorDescriptionDelegatingSubject(PrincipalCollection principals, boolean authenticated, String host, Session session, boolean sessionCreationEnabled, SecurityManager securityManager) DelegatingSubject(PrincipalCollection principals, boolean authenticated, String host, Session session, SecurityManager securityManager)
DefaultSubjectFactory.createSubject(org.apache.shiro.subject.SubjectContext)directly if you need to instantiate a customSubjectclass.