Package org.springframework.session
Interface FindByIndexNameSessionRepository<S extends Session>
- Type Parameters:
S
- the type of Session being managed by thisFindByIndexNameSessionRepository
- All Superinterfaces:
SessionRepository<S>
- All Known Implementing Classes:
HazelcastIndexedSessionRepository
,HazelcastSessionRepository
,JdbcIndexedSessionRepository
,JdbcOperationsSessionRepository
,MongoIndexedSessionRepository
,MongoOperationsSessionRepository
,RedisIndexedSessionRepository
,RedisOperationsSessionRepository
Extends a basic
SessionRepository
to allow finding sessions by the specified
index name and index value.-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
A session index that contains the current principal name (i.e. -
Method Summary
Modifier and TypeMethodDescriptionfindByIndexNameAndIndexValue
(String indexName, String indexValue) findByPrincipalName
(String principalName) Find aMap
of the session id to theSession
of all sessions that contain the index with the namePRINCIPAL_NAME_INDEX_NAME
and the specified principal name.Methods inherited from interface org.springframework.session.SessionRepository
createSession, deleteById, findById, save
-
Field Details
-
PRINCIPAL_NAME_INDEX_NAME
A session index that contains the current principal name (i.e. username).It is the responsibility of the developer to ensure the index is populated since Spring Session is not aware of the authentication mechanism being used.
- Since:
- 1.1
-
-
Method Details
-
findByIndexNameAndIndexValue
Find aMap
of the session id to theSession
of all sessions that contain the specified index name index value.- Parameters:
indexName
- the name of the index (i.e.PRINCIPAL_NAME_INDEX_NAME
)indexValue
- the value of the index to search for.- Returns:
- a
Map
(nevernull
) of the session id to theSession
of all sessions that contain the specified index name and index value. If no results are found, an emptyMap
is returned.
-
findByPrincipalName
Find aMap
of the session id to theSession
of all sessions that contain the index with the namePRINCIPAL_NAME_INDEX_NAME
and the specified principal name.- Parameters:
principalName
- the principal name- Returns:
- a
Map
(nevernull
) of the session id to theSession
of all sessions that contain the specified principal name. If no results are found, an emptyMap
is returned. - Since:
- 2.1.0
-