Class CoherenceIndexedSessionRepository
java.lang.Object
com.oracle.coherence.spring.session.CoherenceIndexedSessionRepository
- All Implemented Interfaces:
- Aware,- ApplicationEventPublisherAware,- org.springframework.session.FindByIndexNameSessionRepository<com.oracle.coherence.spring.session.CoherenceSpringSession>,- org.springframework.session.SessionRepository<com.oracle.coherence.spring.session.CoherenceSpringSession>
public class CoherenceIndexedSessionRepository
extends Object
implements org.springframework.session.FindByIndexNameSessionRepository<com.oracle.coherence.spring.session.CoherenceSpringSession>, ApplicationEventPublisherAware
The 
CoherenceIndexedSessionRepository is a SessionRepository
 implementation that stores sessions in Coherence's distributed CacheMap.- Since:
- 3.0
- Author:
- Gunnar Hillert
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final StringThe default name of map used by Spring Session to store sessions.static final StringThe principal name custom attribute name.Fields inherited from interface org.springframework.session.FindByIndexNameSessionRepositoryPRINCIPAL_NAME_INDEX_NAME
- 
Constructor SummaryConstructorsConstructorDescriptionCoherenceIndexedSessionRepository(com.tangosol.net.Session coherenceSession) Create a newCoherenceIndexedSessionRepositoryinstance.
- 
Method SummaryModifier and TypeMethodDescriptionvoidClear all sessions.voidclose()voiddeleteById(String id) findByIndexNameAndIndexValue(String indexName, String indexValue) org.springframework.session.FlushModeorg.springframework.session.IndexResolver<org.springframework.session.Session>org.springframework.session.SaveModevoidinit()booleanvoidReset the max inactive interval for all active sessions.voidvoidsetApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) Sets theApplicationEventPublisherthat is used to publishsession events.voidsetDefaultMaxInactiveInterval(Duration defaultMaxInactiveInterval) Set the maximum inactive interval between requests before newly created sessions will be invalidated.voidsetFlushMode(org.springframework.session.FlushMode flushMode) Sets theFlushMode.voidsetIndexResolver(org.springframework.session.IndexResolver<org.springframework.session.Session> indexResolver) Set theIndexResolverto use.voidsetSaveMode(org.springframework.session.SaveMode saveMode) Set the save mode.voidsetSessionIdGenerator(org.springframework.session.SessionIdGenerator sessionIdGenerator) Sets theSessionIdGeneratorto be used when generating a new session id.voidsetSessionMapName(String sessionMapName) Set the name of map used to store sessions.voidsetUseEntryProcessor(boolean useEntryProcessor) Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.session.FindByIndexNameSessionRepositoryfindByPrincipalName
- 
Field Details- 
DEFAULT_SESSION_MAP_NAMEThe default name of map used by Spring Session to store sessions.- See Also:
 
- 
PRINCIPAL_NAME_ATTRIBUTEThe principal name custom attribute name.- See Also:
 
 
- 
- 
Constructor Details- 
CoherenceIndexedSessionRepositorypublic CoherenceIndexedSessionRepository(com.tangosol.net.Session coherenceSession) Create a newCoherenceIndexedSessionRepositoryinstance.- Parameters:
- coherenceSession- the Coherence- Sessioninstance to use for managing sessions
 
 
- 
- 
Method Details- 
init@PostConstruct public void init()
- 
close@PreDestroy public void close()
- 
setDefaultMaxInactiveIntervalSet the maximum inactive interval between requests before newly created sessions will be invalidated. A value of0means that the session will never time out unless the cache is configured otherwise in thecoherence-cache-config.xml. The default is 1800s (30 minutes).- Parameters:
- defaultMaxInactiveInterval- the maximum inactive interval in seconds must not be negative or null
 
- 
setIndexResolverpublic void setIndexResolver(org.springframework.session.IndexResolver<org.springframework.session.Session> indexResolver) Set theIndexResolverto use.- Parameters:
- indexResolver- the index resolver
 
- 
setSessionIdGeneratorpublic void setSessionIdGenerator(org.springframework.session.SessionIdGenerator sessionIdGenerator) Sets theSessionIdGeneratorto be used when generating a new session id. If not specified aUuidSessionIdGeneratorwill be used.- Parameters:
- sessionIdGenerator- the- SessionIdGeneratorto use. Must not be null.
 
- 
setSessionMapNameSet the name of map used to store sessions.- Parameters:
- sessionMapName- the session map name
 
- 
setFlushModepublic void setFlushMode(org.springframework.session.FlushMode flushMode) Sets theFlushMode. Defaults toFlushMode.ON_SAVE.- Parameters:
- flushMode- must not be null
 
- 
setSaveModepublic void setSaveMode(org.springframework.session.SaveMode saveMode) Set the save mode.- Parameters:
- saveMode- must not be null
 
- 
setUseEntryProcessorpublic void setUseEntryProcessor(boolean useEntryProcessor) 
- 
isUseEntryProcessorpublic boolean isUseEntryProcessor()
- 
createSession- Specified by:
- createSessionin interface- org.springframework.session.SessionRepository<com.oracle.coherence.spring.session.CoherenceSpringSession>
 
- 
save- Specified by:
- savein interface- org.springframework.session.SessionRepository<com.oracle.coherence.spring.session.CoherenceSpringSession>
 
- 
findById- Specified by:
- findByIdin interface- org.springframework.session.SessionRepository<com.oracle.coherence.spring.session.CoherenceSpringSession>
 
- 
deleteById- Specified by:
- deleteByIdin interface- org.springframework.session.SessionRepository<com.oracle.coherence.spring.session.CoherenceSpringSession>
 
- 
findByIndexNameAndIndexValuepublic Map<String,com.oracle.coherence.spring.session.CoherenceSpringSession> findByIndexNameAndIndexValue(String indexName, String indexValue) - Specified by:
- findByIndexNameAndIndexValuein interface- org.springframework.session.FindByIndexNameSessionRepository<com.oracle.coherence.spring.session.CoherenceSpringSession>
 
- 
getFlushModepublic org.springframework.session.FlushMode getFlushMode()
- 
getSaveModepublic org.springframework.session.SaveMode getSaveMode()
- 
getIndexResolverpublic org.springframework.session.IndexResolver<org.springframework.session.Session> getIndexResolver()
- 
setApplicationEventPublisherSets theApplicationEventPublisherthat is used to publishsession events. The default is to not publish session events.- Specified by:
- setApplicationEventPublisherin interface- ApplicationEventPublisherAware
- Parameters:
- applicationEventPublisher- the- ApplicationEventPublisherthat is used to publish session events. Cannot be null.
 
- 
clearAllSessionspublic void clearAllSessions()Clear all sessions.
- 
resetMaxInactiveIntervalForActiveSessionspublic void resetMaxInactiveIntervalForActiveSessions()Reset the max inactive interval for all active sessions.
 
-