public abstract class AbstractMongoSessionConverter
extends java.lang.Object
implements org.springframework.core.convert.converter.GenericConverter
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) |
java.lang.Object |
convert(java.lang.Object source,
org.springframework.core.convert.TypeDescriptor sourceType,
org.springframework.core.convert.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 java.lang.String |
extractPrincipal(MongoSession expiringSession) |
java.util.Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> |
getConvertibleTypes() |
protected abstract org.springframework.data.mongodb.core.query.Query |
getQueryForIndex(java.lang.String indexName,
java.lang.Object indexValue)
Returns query to be executed to return sessions based on a particular index.
|
void |
setIndexResolver(IndexResolver<MongoSession> indexResolver) |
@Nullable protected abstract org.springframework.data.mongodb.core.query.Query getQueryForIndex(java.lang.String indexName, java.lang.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 java.lang.String extractPrincipal(MongoSession expiringSession)
public java.util.Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> getConvertibleTypes()
getConvertibleTypes
in interface org.springframework.core.convert.converter.GenericConverter
@Nullable public java.lang.Object convert(java.lang.Object source, org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType)
convert
in interface org.springframework.core.convert.converter.GenericConverter
protected abstract com.mongodb.DBObject convert(MongoSession session)
protected abstract MongoSession convert(org.bson.Document sessionWrapper)
public void setIndexResolver(IndexResolver<MongoSession> indexResolver)