public class GemFireOperationsSessionRepository extends AbstractGemFireOperationsSessionRepository
AbstractGemFireOperationsSessionRepository
AbstractGemFireOperationsSessionRepository.GemFireSession, AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes, AbstractGemFireOperationsSessionRepository.GemFireSessionAttributesInstantiator, AbstractGemFireOperationsSessionRepository.GemFireSessionInstantiator
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
FIND_SESSIONS_BY_INDEX_NAME_VALUE_QUERY |
protected static java.lang.String |
FIND_SESSIONS_BY_PRINCIPAL_NAME_QUERY |
logger
PRINCIPAL_NAME_INDEX_NAME
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 |
---|---|
ExpiringSession |
createSession()
Constructs a new
ExpiringSession instance backed by GemFire. |
void |
delete(java.lang.String sessionId)
Deletes (removes) any existing
ExpiringSession from GemFire. |
java.util.Map<java.lang.String,ExpiringSession> |
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.
|
ExpiringSession |
getSession(java.lang.String sessionId)
Gets a copy of an existing, non-expired
ExpiringSession by ID. |
protected java.lang.String |
prepareQuery(java.lang.String indexName)
Prepares the appropriate GemFire OQL query based on the indexed Session attribute
name.
|
void |
save(ExpiringSession session)
Saves the specified
ExpiringSession to GemFire. |
afterCreate, afterDestroy, afterInvalidate, afterPropertiesSet, delete, getApplicationEventPublisher, getFullyQualifiedRegionName, getMaxInactiveIntervalInSeconds, getTemplate, handleCreated, handleDeleted, handleDestroyed, handleExpired, publishEvent, setApplicationEventPublisher, setMaxInactiveIntervalInSeconds, touch
protected static final java.lang.String FIND_SESSIONS_BY_INDEX_NAME_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.GemfireOperations
public java.util.Map<java.lang.String,ExpiringSession> 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).ExpiringSession
,
Map
,
prepareQuery(String)
protected java.lang.String prepareQuery(java.lang.String indexName)
indexName
- a String indicating the name of the indexed Session attribute.public ExpiringSession createSession()
ExpiringSession
instance backed by GemFire.ExpiringSession
backed by GemFire.AbstractGemFireOperationsSessionRepository.GemFireSession.create(int)
,
ExpiringSession
,
AbstractGemFireOperationsSessionRepository.getMaxInactiveIntervalInSeconds()
public ExpiringSession getSession(java.lang.String sessionId)
ExpiringSession
by ID. If the
Session is expired, then it is deleted.sessionId
- a String indicating the ID of the Session to get.ExpiringSession
by ID or null if not Session exists.AbstractGemFireOperationsSessionRepository.GemFireSession.from(ExpiringSession)
,
ExpiringSession
,
delete(String)
public void save(ExpiringSession session)
ExpiringSession
to GemFire.session
- the ExpiringSession
to save.GemfireOperations.put(Object, Object)
,
ExpiringSession
public void delete(java.lang.String sessionId)
ExpiringSession
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, ExpiringSession)