public class GemFireOperationsSessionRepository extends AbstractGemFireOperationsSessionRepository
GemFireOperationsSessionRepository class is a Spring SessionRepository implementation
that interfaces with and uses GemFire to back and store Spring Sessions.GemfireOperations,
Session,
SessionRepository,
AbstractGemFireOperationsSessionRepositoryAbstractGemFireOperationsSessionRepository.DeltaCapableGemFireSession, AbstractGemFireOperationsSessionRepository.DeltaCapableGemFireSessionAttributes, AbstractGemFireOperationsSessionRepository.GemFireSession<T extends AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes>, AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
FIND_SESSIONS_BY_INDEX_NAME_INDEX_VALUE_QUERY |
protected static java.lang.String |
FIND_SESSIONS_BY_PRINCIPAL_NAME_QUERY |
| Constructor and Description |
|---|
GemFireOperationsSessionRepository(org.springframework.data.gemfire.GemfireOperations template)
Constructs an instance of GemFireOperationsSessionRepository initialized with the
required GemfireOperations object used to perform data access operations to manage
Session state.
|
| Modifier and Type | Method and Description |
|---|---|
org.springframework.session.Session |
createSession()
Constructs a new
Session instance backed by GemFire. |
void |
deleteById(java.lang.String sessionId)
Deletes (removes) any existing
Session from GemFire. |
org.springframework.session.Session |
findById(java.lang.String sessionId)
Gets a copy of an existing, non-expired
Session by ID. |
java.util.Map<java.lang.String,org.springframework.session.Session> |
findByIndexNameAndIndexValue(java.lang.String indexName,
java.lang.String indexValue)
Looks up all available Sessions with the particular attribute indexed by name
having the given value.
|
protected java.lang.String |
prepareQuery(java.lang.String indexName)
Prepares the appropriate GemFire OQL query based on the indexed Session attribute
name.
|
void |
save(org.springframework.session.Session session)
Saves the specified
Session to GemFire. |
afterCreate, afterDestroy, afterInvalidate, afterPropertiesSet, delete, getApplicationEventPublisher, getFullyQualifiedRegionName, getLogger, getMaxInactiveInterval, getMaxInactiveIntervalInSeconds, getTemplate, handleCreated, handleDeleted, handleDestroyed, handleExpired, isUsingDataSerialization, publishEvent, setApplicationEventPublisher, setMaxInactiveInterval, setMaxInactiveIntervalInSeconds, setUseDataSerialization, touchafterRegionClear, afterRegionCreate, afterRegionDestroy, afterRegionInvalidate, afterRegionLive, afterUpdate, closeprotected static final java.lang.String FIND_SESSIONS_BY_INDEX_NAME_INDEX_VALUE_QUERY
protected static final java.lang.String FIND_SESSIONS_BY_PRINCIPAL_NAME_QUERY
public GemFireOperationsSessionRepository(org.springframework.data.gemfire.GemfireOperations template)
template - the GemfireOperations object used to access and manage Session
state in GemFire.GemfireOperationspublic java.util.Map<java.lang.String,org.springframework.session.Session> findByIndexNameAndIndexValue(java.lang.String indexName,
java.lang.String indexValue)
indexName - name of the indexed Session attribute. (e.g.
FindByIndexNameSessionRepository.PRINCIPAL_NAME_INDEX_NAME
).indexValue - value of the indexed Session attribute to search on (e.g.
username).Session,
Map,
prepareQuery(String)protected java.lang.String prepareQuery(java.lang.String indexName)
indexName - a String indicating the name of the indexed Session attribute.public org.springframework.session.Session createSession()
Session instance backed by GemFire.Session backed by GemFire.AbstractGemFireOperationsSessionRepository.GemFireSession.create(Duration),
Session,
AbstractGemFireOperationsSessionRepository.getMaxInactiveIntervalInSeconds()public org.springframework.session.Session findById(java.lang.String sessionId)
Session by ID. If the
Session is expired, then it is deleted.sessionId - a String indicating the ID of the Session to get.Session by ID or null if not Session exists.AbstractGemFireOperationsSessionRepository.GemFireSession.from(Session),
Session,
deleteById(String)public void save(org.springframework.session.Session session)
Session to GemFire.session - the Session to save.GemfireOperations.put(Object, Object),
Sessionpublic void deleteById(java.lang.String sessionId)
Session from GemFire. This operation
also results in a SessionDeletedEvent.sessionId - a String indicating the ID of the Session to remove from GemFire.GemfireOperations.remove(Object),
AbstractGemFireOperationsSessionRepository.handleDeleted(String, Session)