public abstract class AbstractMongoSessionConverter extends Object implements GenericConverter
GenericConverter.ConvertiblePair
Constructor and Description |
---|
AbstractMongoSessionConverter() |
Modifier and Type | Method and Description |
---|---|
protected abstract MongoSession |
convert(org.bson.Document sessionWrapper) |
protected abstract com.mongodb.DBObject |
convert(MongoSession session) |
Object |
convert(Object source,
TypeDescriptor sourceType,
TypeDescriptor targetType) |
protected void |
ensureIndexes(org.springframework.data.mongodb.core.index.IndexOperations sessionCollectionIndexes)
Method ensures that there is a TTL index on expireAt field.
|
protected String |
extractPrincipal(MongoSession expiringSession) |
Set<GenericConverter.ConvertiblePair> |
getConvertibleTypes() |
protected abstract org.springframework.data.mongodb.core.query.Query |
getQueryForIndex(String indexName,
Object indexValue)
Returns query to be executed to return sessions based on a particular index.
|
void |
setIndexResolver(org.springframework.session.IndexResolver<MongoSession> indexResolver) |
@Nullable protected abstract org.springframework.data.mongodb.core.query.Query getQueryForIndex(String indexName, Object indexValue)
indexName
- name of the indexindexValue
- value to query againstprotected void ensureIndexes(org.springframework.data.mongodb.core.index.IndexOperations sessionCollectionIndexes)
sessionCollectionIndexes
- IndexOperations
to useprotected String extractPrincipal(MongoSession expiringSession)
public Set<GenericConverter.ConvertiblePair> getConvertibleTypes()
getConvertibleTypes
in interface GenericConverter
@Nullable public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType)
convert
in interface GenericConverter
protected abstract com.mongodb.DBObject convert(MongoSession session)
protected abstract MongoSession convert(org.bson.Document sessionWrapper)
public void setIndexResolver(org.springframework.session.IndexResolver<MongoSession> indexResolver)
Copyright © 2014–2021 Pivotal, Inc.. All rights reserved.