クラス AbstractMongoSessionConverter
java.lang.ObjectSE
org.springframework.session.data.mongo.AbstractMongoSessionConverter
- 実装されているすべてのインターフェース:
org.springframework.core.convert.converter.GenericConverter
- 既知の直属サブクラス
JacksonMongoSessionConverter,JdkMongoSessionConverter
public abstract class AbstractMongoSessionConverter
extends ObjectSE
implements org.springframework.core.convert.converter.GenericConverter
セッションオブジェクトを直列化および逆直列化するための基本クラス。カスタムシリアライザーを作成するには、このインターフェースを実装し、クラスを Bean として登録する必要があります。
- 導入:
- 1.2
ネストされたクラスの要約
インターフェース org.springframework.core.convert.converter.GenericConverter から継承されたネストクラス / インターフェース
org.springframework.core.convert.converter.GenericConverter.ConvertiblePairコンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明convert(ObjectSE source, org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType) protected abstract org.springframework.session.data.mongo.MongoSessionconvert(org.bson.Document sessionWrapper) protected abstract com.mongodb.DBObjectconvert(org.springframework.session.data.mongo.MongoSession session) protected voidensureIndexes(org.springframework.data.mongodb.core.index.IndexOperations sessionCollectionIndexes) この方法は、expireAt フィールドに TTL インデックスが存在することを保証します。protected StringSEextractPrincipal(org.springframework.session.data.mongo.MongoSession expiringSession) SetSE<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair>protected abstract org.springframework.data.mongodb.core.query.QuerygetQueryForIndex(StringSE indexName, ObjectSE indexValue) 特定のインデックスに基づいてセッションを返すために実行されるクエリを返します。voidsetIndexResolver(IndexResolver<Session> indexResolver)
コンストラクターの詳細
AbstractMongoSessionConverter
public AbstractMongoSessionConverter()
メソッドの詳細
getQueryForIndex
@Nullable protected abstract org.springframework.data.mongodb.core.query.Query getQueryForIndex(StringSE indexName, ObjectSE indexValue) 特定のインデックスに基づいてセッションを返すために実行されるクエリを返します。- パラメーター:
indexName- インデックスの名前indexValue- クエリする値- 戻り値:
- 構築されたクエリ、または indexName がサポートされていない場合は null
ensureIndexes
protected void ensureIndexes(org.springframework.data.mongodb.core.index.IndexOperations sessionCollectionIndexes) このメソッドは、expireAt フィールドに TTL インデックスがあることを確認します。expireAfterSeconds は 0 秒に設定されているため、有効期限はアプリケーションによって制御されます。追加のカスタムインデックスを作成する必要がある場合は、カスタムコンバーターで拡張できます。- パラメーター:
sessionCollectionIndexes- 使用するIndexOperations
extractPrincipal
protected StringSE extractPrincipal(org.springframework.session.data.mongo.MongoSession expiringSession) getConvertibleTypes
public SetSE<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> getConvertibleTypes()- 次で指定:
- インターフェース
org.springframework.core.convert.converter.GenericConverterのgetConvertibleTypes
convert
@Nullable public ObjectSE convert(ObjectSE source, org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType) - 次で指定:
- インターフェース
org.springframework.core.convert.converter.GenericConverterのconvert
convert
protected abstract com.mongodb.DBObject convert(org.springframework.session.data.mongo.MongoSession session) convert
protected abstract org.springframework.session.data.mongo.MongoSession convert(org.bson.Document sessionWrapper) setIndexResolver