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