クラス DelegatingSecurityContextCallable<V>
java.lang.ObjectSE
org.springframework.security.concurrent.DelegatingSecurityContextCallable<V>
- 実装されているすべてのインターフェース:
CallableSE<V>
デリゲート CallableSE を、デリゲート CallableSE を呼び出す前に SecurityContext をセットアップし、デリゲートの完了後に SecurityContext を削除するためのロジックでラップします。
すでに存在する SecurityContext がある場合は、call() メソッドが呼び出された後に復元されます。
- 導入:
- 3.2
コンストラクターの概要
コンストラクターコンストラクター説明DelegatingSecurityContextCallable(CallableSE<V> delegate) DelegatingSecurityContextCallable(CallableSE<V> delegate, SecurityContext securityContext) 特定のSecurityContextを使用して新しいDelegatingSecurityContextCallableを作成します。メソッドのサマリー
修飾子と型メソッド説明call()static <V> CallableSE<V>create(CallableSE<V> delegate, SecurityContext securityContext) 指定されたCallableSE とSecurityContextを使用してDelegatingSecurityContextCallableを作成しますが、securityContext が null の場合は、SecurityContextHolderの現在のSecurityContextがデフォルトになります。voidsetSecurityContextHolderStrategy(SecurityContextHolderStrategy securityContextHolderStrategy) 使用するSecurityContextHolderStrategyを設定します。toString()
コンストラクターの詳細
DelegatingSecurityContextCallable
特定のSecurityContextを使用して新しいDelegatingSecurityContextCallableを作成します。- パラメーター:
delegate- 指定されたSecurityContextで実行するデリゲートDelegatingSecurityContextCallable。null にすることはできません。securityContext- デリゲートCallableSE のために確立するSecurityContext。null にすることはできません。
DelegatingSecurityContextCallable
- パラメーター:
delegate- 現在のSecurityContextで実行するデリゲートCallableSE。null にすることはできません。
メソッドの詳細
call
- 次で指定:
- インターフェース
CallableSE<V>のcall - 例外:
ExceptionSE
setSecurityContextHolderStrategy
public void setSecurityContextHolderStrategy(SecurityContextHolderStrategy securityContextHolderStrategy) 使用するSecurityContextHolderStrategyを設定します。デフォルトのアクションは、SecurityContextHolderに格納されているSecurityContextHolderStrategyを使用することです。- 導入:
- 5.8
toString
create
指定されたCallableSE とSecurityContextを使用してDelegatingSecurityContextCallableを作成しますが、securityContext が null の場合は、SecurityContextHolderの現在のSecurityContextがデフォルトになります。- パラメーター:
delegate- 指定されたSecurityContextで実行するデリゲートDelegatingSecurityContextCallable。null にすることはできません。securityContext- デリゲートCallableSE のために確立するSecurityContext。null の場合、デフォルトはSecurityContextHolder.getContext()- 戻り値: