クラス 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 MongoSessionconvert(org.bson.Document sessionWrapper) protected abstract com.mongodb.DBObjectconvert(MongoSession session) protected voidensureIndexes(org.springframework.data.mongodb.core.index.IndexOperations sessionCollectionIndexes) この方法は、expireAt フィールドに TTL インデックスが存在することを保証します。protected StringSEextractPrincipal(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
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
convert
setIndexResolver