クラス ReactiveMongoSessionRepository
java.lang.ObjectSE
org.springframework.session.data.mongo.ReactiveMongoSessionRepository
- 実装されているすべてのインターフェース:
org.springframework.beans.factory.Aware、org.springframework.beans.factory.InitializingBean、org.springframework.context.ApplicationEventPublisherAware、ReactiveSessionRepository<org.springframework.session.data.mongo.MongoSession>
public class ReactiveMongoSessionRepository
extends ObjectSE
implements ReactiveSessionRepository<org.springframework.session.data.mongo.MongoSession>, org.springframework.context.ApplicationEventPublisherAware, org.springframework.beans.factory.InitializingBean
Spring Data MongoDB を使用する
ReactiveSessionRepository 実装。- 導入:
- 2.2.0
フィールドのサマリー
フィールドコンストラクターの概要
コンストラクターコンストラクター説明ReactiveMongoSessionRepository(org.springframework.data.mongodb.core.ReactiveMongoOperations mongoOperations) メソッドのサマリー
修飾子と型メソッド説明voidインデックスが存在することを確認するためにReactiveIndexOperationsを使用しないでください。reactor.core.publisher.Mono<org.springframework.session.data.mongo.MongoSession>このReactiveSessionRepositoryによって永続化できる新しいMongoSessionを作成します。reactor.core.publisher.Mono<VoidSE>deleteById(StringSE id) reactor.core.publisher.Mono<org.springframework.session.data.mongo.MongoSession>reactor.core.publisher.Mono<VoidSE>save(org.springframework.session.data.mongo.MongoSession session) ReactiveSessionRepository.createSession()によって作成されたSessionが確実に保存されます。voidsetApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher eventPublisher) voidsetBlockingMongoOperations(org.springframework.data.mongodb.core.MongoOperations blockingMongoOperations) voidsetCollectionName(StringSE collectionName) voidsetDefaultMaxInactiveInterval(DurationSE defaultMaxInactiveInterval) 新しく作成されたセッションが無効になるまでのリクエスト間の最大非アクティブ間隔を秒単位で設定します。voidsetMaxInactiveIntervalInSeconds(IntegerSE defaultMaxInactiveInterval) 使用すべきではありません。3.0.0 以降、setDefaultMaxInactiveInterval(Duration)を推奨voidsetMongoSessionConverter(AbstractMongoSessionConverter mongoSessionConverter) voidsetSessionIdGenerator(SessionIdGenerator sessionIdGenerator)
フィールドの詳細
DEFAULT_INACTIVE_INTERVAL
使用すべきではありません。3.0.0 以降、MapSession.DEFAULT_MAX_INACTIVE_INTERVAL_SECONDSを推奨セッションが期限切れになるデフォルトの時間(秒単位)。- 関連事項:
DEFAULT_COLLECTION_NAME
セッションを保存するためのデフォルトのコレクション名。- 関連事項:
コンストラクターの詳細
ReactiveMongoSessionRepository
public ReactiveMongoSessionRepository(org.springframework.data.mongodb.core.ReactiveMongoOperations mongoOperations)
メソッドの詳細
createSession
public reactor.core.publisher.Mono<org.springframework.session.data.mongo.MongoSession> createSession()このReactiveSessionRepositoryによって永続化できる新しいMongoSessionを作成します。これにより、
MongoSessionの永続化方法の最適化とカスタマイズが可能になります。例: 返された実装は変更を追跡し、保存時にデルタのみを保持する必要があることを保証します。- 次で指定:
- インターフェース
ReactiveSessionRepository<org.springframework.session.data.mongo.MongoSession>のcreateSession - 戻り値:
- この
ReactiveSessionRepositoryによって永続化できる新しいMongoSession
save
public reactor.core.publisher.Mono<VoidSE> save(org.springframework.session.data.mongo.MongoSession session) インターフェースからコピーされた説明:ReactiveSessionRepositoryReactiveSessionRepository.createSession()によって作成されたSessionが確実に保存されます。一部の実装では、変更を即座に保持する
Sessionを返すことにより、Sessionが更新されたときに保存することを選択する場合があります。この場合、このメソッドは実際には何も実行しない可能性があります。- 次で指定:
- インターフェース
ReactiveSessionRepository<org.springframework.session.data.mongo.MongoSession>のsave - パラメーター:
session- 保存するSession- 戻り値:
- 操作完了のインジケータ
findById
public reactor.core.publisher.Mono<org.springframework.session.data.mongo.MongoSession> findById(StringSE id) インターフェースからコピーされた説明:ReactiveSessionRepository- 次で指定:
- インターフェース
ReactiveSessionRepository<org.springframework.session.data.mongo.MongoSession>のfindById - パラメーター:
id- ルックアップするSession.getId()- 戻り値:
Session.getId()によるSession、またはSessionが見つからない場合は null。
deleteById
インターフェースからコピーされた説明:ReactiveSessionRepository- 次で指定:
- インターフェース
ReactiveSessionRepository<org.springframework.session.data.mongo.MongoSession>のdeleteById - パラメーター:
id- 削除するSession.getId()- 戻り値:
- 操作完了のインジケータ
afterPropertiesSet
public void afterPropertiesSet()インデックスが存在することを確認するためにReactiveIndexOperationsを使用しないでください。代わりに、ブロッキングIndexOperationsを取得し、可能であれば代わりにそれを使用してください。- 次で指定:
- インターフェース
org.springframework.beans.factory.InitializingBeanのafterPropertiesSet
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher eventPublisher) - 次で指定:
- インターフェース
org.springframework.context.ApplicationEventPublisherAwareのsetApplicationEventPublisher
setDefaultMaxInactiveInterval
新しく作成されたセッションが無効になるまでの、リクエスト間の最大非アクティブ間隔を秒単位で設定します。負の時間は、セッションがタイムアウトしないことを示します。デフォルトは 30 分です。- パラメーター:
defaultMaxInactiveInterval- デフォルトの maxInactiveInterval
setMaxInactiveIntervalInSeconds
@DeprecatedSE(since="3.0.0") public void setMaxInactiveIntervalInSeconds(IntegerSE defaultMaxInactiveInterval) 使用すべきではありません。3.0.0 以降、setDefaultMaxInactiveInterval(Duration)を推奨新しく作成されたセッションが無効になるまでの、リクエスト間の最大非アクティブ間隔を秒単位で設定します。負の時間は、セッションがタイムアウトしないことを示します。デフォルトは 1800 (30 分です)。- パラメーター:
defaultMaxInactiveInterval- デフォルトの maxInactiveInterval(秒単位)
getCollectionName
setCollectionName
setMongoSessionConverter
setBlockingMongoOperations
public void setBlockingMongoOperations(org.springframework.data.mongodb.core.MongoOperations blockingMongoOperations) setSessionIdGenerator
MapSession.DEFAULT_MAX_INACTIVE_INTERVAL_SECONDSを推奨