public class GemFireOperationsSessionRepository extends AbstractGemFireOperationsSessionRepository
GemfireOperations,
ExpiringSession,
Session,
AbstractGemFireOperationsSessionRepositoryAbstractGemFireOperationsSessionRepository.GemFireSession, AbstractGemFireOperationsSessionRepository.GemFireSessionAttributes| Modifier and Type | Field and Description |
|---|---|
protected static String |
FIND_SESSIONS_BY_INDEX_NAME_VALUE_QUERY |
protected static String |
FIND_SESSIONS_BY_PRINCIPAL_NAME_QUERY |
loggerPRINCIPAL_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(String sessionId)
Deletes (removes) any existing
ExpiringSession from GemFire. |
Map<String,ExpiringSession> |
findByIndexNameAndIndexValue(String indexName,
String indexValue)
Looks up all available Sessions with the particular attribute indexed by name having the given value.
|
ExpiringSession |
getSession(String sessionId)
Gets a copy of an existing, non-expired
ExpiringSession by ID. |
protected String |
prepareQuery(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, getApplicationEventPublisher, getFullyQualifiedRegionName, getMaxInactiveIntervalInSeconds, getTemplate, handleCreated, handleDeleted, handleDestroyed, handleExpired, publishEvent, setApplicationEventPublisher, setMaxInactiveIntervalInSecondsprotected static final String FIND_SESSIONS_BY_INDEX_NAME_VALUE_QUERY
protected static final 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 Map<String,ExpiringSession> findByIndexNameAndIndexValue(String indexName, 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 String prepareQuery(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.org.springframework.session.data.gemfire.GemFireOperationsSessionRepository.GemFireSession#create(int),
ExpiringSession,
AbstractGemFireOperationsSessionRepository.getMaxInactiveIntervalInSeconds()public ExpiringSession getSession(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.org.springframework.session.data.gemfire.GemFireOperationsSessionRepository.GemFireSession#from(ExpiringSession),
ExpiringSession,
delete(String)public void save(ExpiringSession session)
ExpiringSession to GemFire.session - the ExpiringSession to save.GemfireOperations.put(Object, Object),
ExpiringSessionpublic void delete(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)