Class AbstractInfinispanSessionRepository
- java.lang.Object
-
- org.infinispan.spring.common.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 java.lang.Object implements 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 AbstractApplicationPublisherBridge
applicationEventPublisher
protected SpringCache
cache
protected PrincipalNameResolver
principalNameResolver
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractInfinispanSessionRepository(SpringCache cache, AbstractApplicationPublisherBridge eventsBridge)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
org.springframework.session.MapSession
createSession()
void
deleteById(java.lang.String sessionId)
void
destroy()
org.springframework.session.MapSession
findById(java.lang.String sessionId)
java.util.Map<java.lang.String,org.springframework.session.MapSession>
findByIndexNameAndIndexValue(java.lang.String indexName, java.lang.String indexValue)
org.springframework.session.MapSession
getSession(java.lang.String id, boolean updateTTL)
Returns session with optional parameter whether or not update time accessed.protected abstract void
removeFromCacheWithoutNotifications(java.lang.String originalId)
void
save(org.springframework.session.MapSession session)
void
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
protected org.springframework.session.MapSession
updateTTL(org.springframework.session.MapSession session, boolean updateTTL)
-
-
-
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()
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
destroy
public void destroy()
- Specified by:
destroy
in interfaceorg.springframework.beans.factory.DisposableBean
-
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
- Specified by:
setApplicationEventPublisher
in interfaceorg.springframework.context.ApplicationEventPublisherAware
-
createSession
public org.springframework.session.MapSession createSession()
- Specified by:
createSession
in interfaceorg.springframework.session.SessionRepository<org.springframework.session.MapSession>
-
save
public void save(org.springframework.session.MapSession session)
- Specified by:
save
in interfaceorg.springframework.session.SessionRepository<org.springframework.session.MapSession>
-
removeFromCacheWithoutNotifications
protected abstract void removeFromCacheWithoutNotifications(java.lang.String originalId)
-
findById
public org.springframework.session.MapSession findById(java.lang.String sessionId)
- Specified by:
findById
in interfaceorg.springframework.session.SessionRepository<org.springframework.session.MapSession>
-
deleteById
public void deleteById(java.lang.String sessionId)
- Specified by:
deleteById
in interfaceorg.springframework.session.SessionRepository<org.springframework.session.MapSession>
-
getSession
public org.springframework.session.MapSession getSession(java.lang.String id, boolean updateTTL)
Returns session with optional parameter whether or not update time accessed.- Parameters:
id
- Session ID.updateTTL
-true
if time accessed needs to be updated.- Returns:
- Session or
null
if it doesn't exist.
-
updateTTL
protected org.springframework.session.MapSession updateTTL(org.springframework.session.MapSession session, boolean updateTTL)
-
findByIndexNameAndIndexValue
public java.util.Map<java.lang.String,org.springframework.session.MapSession> findByIndexNameAndIndexValue(java.lang.String indexName, java.lang.String indexValue)
- Specified by:
findByIndexNameAndIndexValue
in interfaceorg.springframework.session.FindByIndexNameSessionRepository<org.springframework.session.MapSession>
-
-