protected static class AbstractGemFireOperationsSessionRepository.SessionEventHandlerCacheListenerAdapter
extends org.apache.geode.cache.util.CacheListenerAdapter<java.lang.Object,org.springframework.session.Session>
Modifier | Constructor and Description |
---|---|
protected |
SessionEventHandlerCacheListenerAdapter(AbstractGemFireOperationsSessionRepository sessionRepository)
Constructs a new instance of the
AbstractGemFireOperationsSessionRepository.SessionEventHandlerCacheListenerAdapter initialized with
the given AbstractGemFireOperationsSessionRepository . |
Modifier and Type | Method and Description |
---|---|
void |
afterCreate(org.apache.geode.cache.EntryEvent<java.lang.Object,org.springframework.session.Session> event)
Callback method triggered when an entry is created (put) in the
Session cache Region . |
protected void |
afterDelete(java.lang.String sessionId,
org.springframework.session.Session session)
Causes Session deleted events to be published to the Spring application context.
|
void |
afterDestroy(org.apache.geode.cache.EntryEvent<java.lang.Object,org.springframework.session.Session> event)
Callback method triggered when an entry is destroyed (removed) in the
Session cache Region . |
void |
afterInvalidate(org.apache.geode.cache.EntryEvent<java.lang.Object,org.springframework.session.Session> event)
Callback method triggered when an entry is invalidated (expired) in the
Session cache Region . |
void |
afterUpdate(org.apache.geode.cache.EntryEvent<java.lang.Object,org.springframework.session.Session> event)
Callback method triggered when an entry is updated in the
Session cache Region . |
protected boolean |
forget(org.apache.geode.cache.EntryEvent<java.lang.Object,org.springframework.session.Session> entryEvent)
Forgets the
Key contained in the given EntryEvent
as a Session ID . |
protected boolean |
forget(java.lang.Object sessionId)
Forgets the given
Session ID . |
protected AbstractGemFireOperationsSessionRepository |
getSessionRepository()
Returns a reference to the configured
SessionRepository . |
protected boolean |
isRemembered(java.lang.Object sessionId)
Determines whether the given
Session ID has been remembered. |
protected boolean |
isSession(org.apache.geode.cache.EntryEvent<?,?> entryEvent)
Determines whether the
new value contained in the EntryEvent
is a Session . |
protected boolean |
isSession(java.lang.Object target)
Determines whether the given
Object is a Session . |
protected SessionChangedEvent |
newSessionChangedEvent(org.springframework.session.Session session)
Constructs a new
SessionChangedEvent initialized with the given Session ,
using the SessionRepository as the event source. |
protected org.springframework.session.events.SessionCreatedEvent |
newSessionCreatedEvent(org.springframework.session.Session session)
Constructs a new
SessionCreatedEvent initialized with the given Session ,
using the SessionRepository as the event source. |
protected org.springframework.session.events.SessionDeletedEvent |
newSessionDeletedEvent(org.springframework.session.Session session)
Constructs a new
SessionDeletedEvent initialized with the given Session ,
using the SessionRepository as the event source. |
protected org.springframework.session.events.SessionDestroyedEvent |
newSessionDestroyedEvent(org.springframework.session.Session session)
Constructs a new
SessionDestroyedEvent initialized with the given Session ,
using the SessionRepository as the event source. |
protected org.springframework.session.events.SessionExpiredEvent |
newSessionExpiredEvent(org.springframework.session.Session session)
Constructs a new
SessionExpiredEvent initialized with the given Session ,
using the SessionRepository as the event source. |
protected boolean |
remember(org.apache.geode.cache.EntryEvent<java.lang.Object,org.springframework.session.Session> entryEvent)
Remembers the
Key contained by the given EntryEvent
iff the Key is a valid Session ID
and the new value is a Session . |
protected boolean |
remember(java.lang.Object sessionId)
Remembers the given
Session ID . |
protected org.springframework.session.Session |
toSession(java.lang.Object target,
java.lang.Object sessionId)
Casts the given
Object into a Session iff the Object is a Session . |
afterRegionClear, afterRegionCreate, afterRegionDestroy, afterRegionInvalidate, afterRegionLive, close
protected SessionEventHandlerCacheListenerAdapter(AbstractGemFireOperationsSessionRepository sessionRepository)
AbstractGemFireOperationsSessionRepository.SessionEventHandlerCacheListenerAdapter
initialized with
the given AbstractGemFireOperationsSessionRepository
.sessionRepository
- AbstractGemFireOperationsSessionRepository
used by this event handler
to manage Session Events
.java.lang.IllegalArgumentException
- if AbstractGemFireOperationsSessionRepository
is null.AbstractGemFireOperationsSessionRepository
@NonNull protected AbstractGemFireOperationsSessionRepository getSessionRepository()
SessionRepository
.SessionRepository
.AbstractGemFireOperationsSessionRepository
public void afterCreate(org.apache.geode.cache.EntryEvent<java.lang.Object,org.springframework.session.Session> event)
Session
cache Region
.afterCreate
in interface org.apache.geode.cache.CacheListener<java.lang.Object,org.springframework.session.Session>
afterCreate
in class org.apache.geode.cache.util.CacheListenerAdapter<java.lang.Object,org.springframework.session.Session>
event
- EntryEvent
containing the details of the cache operation.SessionCreatedEvent
,
Session
,
EntryEvent
,
newSessionCreatedEvent(Session)
,
AbstractGemFireOperationsSessionRepository.publishEvent(ApplicationEvent)
,
toSession(Object, Object)
,
forget(Object)
protected void afterDelete(java.lang.String sessionId, org.springframework.session.Session session)
sessionId
- a String indicating the ID of the Session.session
- a reference to the Session triggering the event.SessionDeletedEvent
,
Session
,
newSessionDeletedEvent(Session)
,
AbstractGemFireOperationsSessionRepository.publishEvent(ApplicationEvent)
,
toSession(Object, Object)
,
forget(Object)
public void afterDestroy(org.apache.geode.cache.EntryEvent<java.lang.Object,org.springframework.session.Session> event)
Session
cache Region
.afterDestroy
in interface org.apache.geode.cache.CacheListener<java.lang.Object,org.springframework.session.Session>
afterDestroy
in class org.apache.geode.cache.util.CacheListenerAdapter<java.lang.Object,org.springframework.session.Session>
event
- EntryEvent
containing the details of the cache operation.SessionDestroyedEvent
,
Session
,
EntryEvent
,
newSessionDestroyedEvent(Session)
,
AbstractGemFireOperationsSessionRepository.publishEvent(ApplicationEvent)
,
toSession(Object, Object)
,
forget(Object)
public void afterInvalidate(org.apache.geode.cache.EntryEvent<java.lang.Object,org.springframework.session.Session> event)
Session
cache Region
.afterInvalidate
in interface org.apache.geode.cache.CacheListener<java.lang.Object,org.springframework.session.Session>
afterInvalidate
in class org.apache.geode.cache.util.CacheListenerAdapter<java.lang.Object,org.springframework.session.Session>
event
- EntryEvent
containing the details of the cache operation.SessionExpiredEvent
,
Session
,
EntryEvent
,
newSessionExpiredEvent(Session)
,
AbstractGemFireOperationsSessionRepository.publishEvent(ApplicationEvent)
,
toSession(Object, Object)
,
forget(Object)
public void afterUpdate(org.apache.geode.cache.EntryEvent<java.lang.Object,org.springframework.session.Session> event)
Session
cache Region
.afterUpdate
in interface org.apache.geode.cache.CacheListener<java.lang.Object,org.springframework.session.Session>
afterUpdate
in class org.apache.geode.cache.util.CacheListenerAdapter<java.lang.Object,org.springframework.session.Session>
event
- EntryEvent
containing the details of the cache operation.SessionChangedEvent
,
Session
,
EntryEvent
,
newSessionChangedEvent(Session)
,
AbstractGemFireOperationsSessionRepository.publishEvent(ApplicationEvent)
,
toSession(Object, Object)
protected org.springframework.session.events.SessionCreatedEvent newSessionCreatedEvent(org.springframework.session.Session session)
SessionCreatedEvent
initialized with the given Session
,
using the SessionRepository
as the event source.session
- Session
that is the subject of the event
.SessionCreatedEvent
.SessionCreatedEvent
,
Session
,
getSessionRepository()
protected SessionChangedEvent newSessionChangedEvent(org.springframework.session.Session session)
SessionChangedEvent
initialized with the given Session
,
using the SessionRepository
as the event source.session
- Session
that is the subject of the change event
.SessionChangedEvent
.SessionChangedEvent
,
Session
,
getSessionRepository()
protected org.springframework.session.events.SessionDeletedEvent newSessionDeletedEvent(org.springframework.session.Session session)
SessionDeletedEvent
initialized with the given Session
,
using the SessionRepository
as the event source.session
- Session
that is the subject of the event
.SessionDeletedEvent
.SessionDeletedEvent
,
Session
,
getSessionRepository()
protected org.springframework.session.events.SessionDestroyedEvent newSessionDestroyedEvent(org.springframework.session.Session session)
SessionDestroyedEvent
initialized with the given Session
,
using the SessionRepository
as the event source.session
- Session
that is the subject of the event
.SessionDestroyedEvent
.SessionDestroyedEvent
,
Session
,
getSessionRepository()
protected org.springframework.session.events.SessionExpiredEvent newSessionExpiredEvent(org.springframework.session.Session session)
SessionExpiredEvent
initialized with the given Session
,
using the SessionRepository
as the event source.session
- Session
that is the subject of the event
.SessionExpiredEvent
.SessionExpiredEvent
,
Session
,
getSessionRepository()
protected boolean isRemembered(java.lang.Object sessionId)
Session ID
has been remembered.sessionId
- Session ID
to evaluate.Session ID
has been remembered.getCachedSessionIds()
protected boolean forget(org.apache.geode.cache.EntryEvent<java.lang.Object,org.springframework.session.Session> entryEvent)
Key
contained in the given EntryEvent
as a Session ID
.entryEvent
- EntryEvent
to evaluate.Key
contained in the given EntryEvent
was forgotten as a Session ID
.Session
,
EntryEvent
,
forget(Object)
protected boolean forget(java.lang.Object sessionId)
Session ID
.sessionId
- Object
containing the Session ID
to forget.Session ID
was forgotten.getCachedSessionIds()
,
remember(Object)
protected boolean remember(org.apache.geode.cache.EntryEvent<java.lang.Object,org.springframework.session.Session> entryEvent)
Key
contained by the given EntryEvent
iff the Key
is a valid Session ID
and the new value
is a Session
.entryEvent
- EntryEvent
to evaluate.Key
of the given EntryEvent
is a valid Session ID
.SessionUtils.isValidSessionId(Object)
,
isSession(EntryEvent)
,
remember(Object)
,
Session
,
EntryEvent
protected boolean remember(java.lang.Object sessionId)
Session ID
.sessionId
- Object
containing the Session ID
to remember.Session ID
.getCachedSessionIds()
,
forget(Object)
protected boolean isSession(org.apache.geode.cache.EntryEvent<?,?> entryEvent)
new value
contained in the EntryEvent
is a Session
.entryEvent
- EntryEvent
to evaluate.new value
contained in the EntryEvent
is a Session
.Session
,
EntryEvent
protected boolean isSession(java.lang.Object target)
Object
is a Session
.target
- Object
to evaluate.Object
is a Session
.Session
protected org.springframework.session.Session toSession(@Nullable java.lang.Object target, java.lang.Object sessionId)
Object
into a Session
iff the Object
is a Session
.
Otherwise, this method attempts to use the supplied Session ID
to create a Session
representation containing only the ID.target
- Object
to evaluate as a Session
.sessionId
- String
containing the Session ID
.Session
from the given Object
or a Session
representation
containing only the supplied Session ID
.java.lang.IllegalStateException
- if the given Object
is not a Session
and a Session ID
was not supplied.Session
,
SessionUtils.isValidSessionId(Object)
,
isSession(Object)