public abstract class AbstractMongoSessionConverter extends Object implements org.springframework.core.convert.converter.GenericConverter
Modifier and Type | Field and Description |
---|---|
protected static String |
EXPIRE_AT_FIELD_NAME |
Constructor and Description |
---|
AbstractMongoSessionConverter() |
Modifier and Type | Method and Description |
---|---|
protected abstract MongoExpiringSession |
convert(com.mongodb.DBObject sessionWrapper) |
protected abstract com.mongodb.DBObject |
convert(MongoExpiringSession session) |
Object |
convert(Object source,
org.springframework.core.convert.TypeDescriptor sourceType,
org.springframework.core.convert.TypeDescriptor targetType) |
protected void |
ensureIndexes(org.springframework.data.mongodb.core.IndexOperations sessionCollectionIndexes)
Method ensures that there is a TTL index on expireAt field.
|
protected String |
extractPrincipal(Session expiringSession) |
Set<org.springframework.core.convert.converter.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.
|
protected static final String EXPIRE_AT_FIELD_NAME
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.IndexOperations sessionCollectionIndexes)
sessionCollectionIndexes
- IndexOperations
to usepublic Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> getConvertibleTypes()
getConvertibleTypes
in interface org.springframework.core.convert.converter.GenericConverter
public Object convert(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(MongoExpiringSession session)
protected abstract MongoExpiringSession convert(com.mongodb.DBObject sessionWrapper)