Package org.infinispan.spring.session
Class AbstractInfinispanSessionRepository
- java.lang.Object
-
- org.infinispan.spring.session.AbstractInfinispanSessionRepository
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.beans.factory.DisposableBean,org.springframework.beans.factory.InitializingBean,org.springframework.context.ApplicationEventPublisherAware,org.springframework.session.FindByIndexNameSessionRepository<org.springframework.session.MapSession>,org.springframework.session.SessionRepository<org.springframework.session.MapSession>
- Direct Known Subclasses:
InfinispanEmbeddedSessionRepository,InfinispanRemoteSessionRepository
public abstract class AbstractInfinispanSessionRepository extends Object implements org.springframework.session.SessionRepository<org.springframework.session.MapSession>, org.springframework.session.FindByIndexNameSessionRepository<org.springframework.session.MapSession>, org.springframework.context.ApplicationEventPublisherAware, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
Infinispan implementation for Spring Session with basic functionality.- Since:
- 9.0
- Author:
- Sebastian Ćaskawiec
- See Also:
- Spring Session Web Page,
SessionRepository,ApplicationEventPublisherAware,FindByIndexNameSessionRepository
-
-
Field Summary
Fields Modifier and Type Field Description protected AbstractApplicationPublisherBridgeapplicationEventPublisherprotected SpringCachecacheprotected PrincipalNameResolverprincipalNameResolver
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractInfinispanSessionRepository(SpringCache cache, AbstractApplicationPublisherBridge eventsBridge)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()org.springframework.session.MapSessioncreateSession()voiddelete(String id)voiddestroy()Map<String,org.springframework.session.MapSession>findByIndexNameAndIndexValue(String indexName, String indexValue)org.springframework.session.MapSessiongetSession(String id)org.springframework.session.MapSessiongetSession(String id, boolean updateTTL)Returns session with optional parameter whether or not update time accessed.voidsave(org.springframework.session.MapSession session)voidsetApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)protected org.springframework.session.MapSessionupdateTTL(org.springframework.session.MapSession session, boolean updateTTL)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Field Detail
-
applicationEventPublisher
protected final AbstractApplicationPublisherBridge applicationEventPublisher
-
cache
protected final SpringCache cache
-
principalNameResolver
protected final PrincipalNameResolver principalNameResolver
-
-
Constructor Detail
-
AbstractInfinispanSessionRepository
protected AbstractInfinispanSessionRepository(SpringCache cache, AbstractApplicationPublisherBridge eventsBridge)
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
destroy
public void destroy() throws Exception- Specified by:
destroyin interfaceorg.springframework.beans.factory.DisposableBean- Throws:
Exception
-
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
- Specified by:
setApplicationEventPublisherin interfaceorg.springframework.context.ApplicationEventPublisherAware
-
createSession
public org.springframework.session.MapSession createSession()
- Specified by:
createSessionin interfaceorg.springframework.session.SessionRepository<org.springframework.session.MapSession>
-
save
public void save(org.springframework.session.MapSession session)
- Specified by:
savein interfaceorg.springframework.session.SessionRepository<org.springframework.session.MapSession>
-
getSession
public org.springframework.session.MapSession getSession(String id)
-
getSession
public org.springframework.session.MapSession getSession(String id, boolean updateTTL)
Returns session with optional parameter whether or not update time accessed.- Parameters:
id- Session ID.updateTTL-trueif time accessed needs to be updated.- Returns:
- Session or
nullif it doesn't exist.
-
updateTTL
protected org.springframework.session.MapSession updateTTL(org.springframework.session.MapSession session, boolean updateTTL)
-
delete
public void delete(String id)
-
findByIndexNameAndIndexValue
public Map<String,org.springframework.session.MapSession> findByIndexNameAndIndexValue(String indexName, String indexValue)
- Specified by:
findByIndexNameAndIndexValuein interfaceorg.springframework.session.FindByIndexNameSessionRepository<org.springframework.session.MapSession>
-
-