クラス LifecycleAwareSessionManager
java.lang.ObjectSE
org.springframework.vault.authentication.AuthenticationEventPublisher
org.springframework.vault.authentication.LifecycleAwareSessionManagerSupport
org.springframework.vault.authentication.LifecycleAwareSessionManager
- 実装済みのインターフェース一覧:
DisposableBean、AuthenticationEventMulticaster、SessionManager
public class LifecycleAwareSessionManager
extends LifecycleAwareSessionManagerSupport
implements SessionManager, DisposableBean
ライフサイクルを意識した
Session Manager。この SessionManager は、トークンを同時に取得しようとする複数のスレッドを同期する request で、ClientAuthentication からトークンを取得します。 トークンにリース期間がある場合、トークンは非同期的に更新されます。これは、トークンの有効期限が切れる 5 秒前に発生します。LifecycleAwareSessionManagerSupport.REFRESH_PERIOD_BEFORE_EXPIRY を参照してください。
この SessionManager は、LoginToken が不要になったときにそれを取り消すための DisposableBean も実装します。トークンが失効すると、定期的なトークンのリフレッシュが停止されます。トークンは、関連付けられた ClientAuthentication が service token を返した場合にのみ取り消されます。
トークンの更新でクライアント側のエラーが発生した場合、トークンが取り消されたか期限切れになったと見なされます。トークンの状態を破棄するため、次の試行で別のログイン試行が行われます。
デフォルトでは、VaultToken は Vault で検索され、更新可能性、残りの TTL、アクセサー、型が決定されます。LifecycleAwareSessionManagerSupport.setTokenSelfLookupEnabled(boolean) を参照してください。
セッションマネージャーは、認証イベントを AuthenticationListener および AuthenticationErrorListener にディスパッチします。イベント通知は、バックグラウンド更新に使用される呼び出し元の ThreadSE または ワーカースレッドでディスパッチされます。
このクラスはスレッドセーフです。
- 作成者:
- Mark Paluch, Steven Swor, Iouri Goussev
- 関連事項:
ネストされたクラスの概要
ネストされたクラスクラス org.springframework.vault.authentication.LifecycleAwareSessionManagerSupport から継承されたネストクラス / インターフェース
LifecycleAwareSessionManagerSupport.FixedTimeoutRefreshTrigger, LifecycleAwareSessionManagerSupport.OneShotTrigger, LifecycleAwareSessionManagerSupport.RefreshTriggerフィールド概要
クラス org.springframework.vault.authentication.LifecycleAwareSessionManagerSupport から継承されたフィールド
logger, REFRESH_PERIOD_BEFORE_EXPIRYコンストラクター概要
コンストラクターコンストラクター説明LifecycleAwareSessionManager(ClientAuthentication clientAuthentication, TaskScheduler taskScheduler, VaultClient client) LifecycleAwareSessionManager(ClientAuthentication clientAuthentication, TaskScheduler taskScheduler, VaultClient client, LifecycleAwareSessionManagerSupport.RefreshTrigger refreshTrigger) LifecycleAwareSessionManager(ClientAuthentication clientAuthentication, TaskScheduler taskScheduler, RestClient client) LifecycleAwareSessionManager(ClientAuthentication clientAuthentication, TaskScheduler taskScheduler, RestClient client, LifecycleAwareSessionManagerSupport.RefreshTrigger refreshTrigger) LifecycleAwareSessionManager(ClientAuthentication clientAuthentication, TaskScheduler taskScheduler, RestOperations restOperations) 使用すべきではありません。LifecycleAwareSessionManager(ClientAuthentication clientAuthentication, TaskScheduler taskScheduler, RestOperations restOperations, LifecycleAwareSessionManagerSupport.RefreshTrigger refreshTrigger) 使用すべきではありません。方法の概要
修飾子と型メソッド説明voiddestroy()セッショントークンを取得します。getToken()トークンの状態: Vault セッションを識別する現在有効なトークンが含まれています。protected booleanprotected VaultTokenlogin()booleanトークンのリフレッシュを実行します。voidrevoke()現在のVaultTokenを取り消して削除します。protected voidrevoke(VaultToken token) VaultTokenを取り消します。protected voidクラス org.springframework.vault.authentication.LifecycleAwareSessionManagerSupport から継承されたメソッド
getRefreshTrigger, getTaskScheduler, isExpired, isTokenSelfLookupEnabled, setLeaseStrategy, setTokenSelfLookupEnabledクラス org.springframework.vault.authentication.AuthenticationEventPublisher から継承されたメソッド
addAuthenticationListener, addErrorListener, multicastEvent, multicastEvent, removeAuthenticationListener, removeErrorListener
コンストラクターの詳細
LifecycleAwareSessionManager
@DeprecatedSE(since="4.1") public LifecycleAwareSessionManager(ClientAuthentication clientAuthentication, TaskScheduler taskScheduler, RestOperations restOperations) 使用すべきではありません。4.1 以降、代わりにLifecycleAwareSessionManager(ClientAuthentication, TaskScheduler, VaultClient)を使用してください。- パラメーター:
clientAuthentication- null であってはなりません。taskScheduler- null であってはなりません。restOperations- null であってはなりません。- 導入:
- 1.0.1
LifecycleAwareSessionManager
@DeprecatedSE(since="4.1") public LifecycleAwareSessionManager(ClientAuthentication clientAuthentication, TaskScheduler taskScheduler, RestOperations restOperations, LifecycleAwareSessionManagerSupport.RefreshTrigger refreshTrigger) 使用すべきではありません。- パラメーター:
clientAuthentication- null であってはなりません。taskScheduler- null であってはなりません。restOperations- null であってはなりません。refreshTrigger- null であってはなりません。- 導入:
- 1.0.1
LifecycleAwareSessionManager
public LifecycleAwareSessionManager(ClientAuthentication clientAuthentication, TaskScheduler taskScheduler, RestClient client) - パラメーター:
clientAuthentication- null であってはなりません。taskScheduler- null であってはなりません。client- null であってはなりません。- 導入:
- 4.0
LifecycleAwareSessionManager
public LifecycleAwareSessionManager(ClientAuthentication clientAuthentication, TaskScheduler taskScheduler, RestClient client, LifecycleAwareSessionManagerSupport.RefreshTrigger refreshTrigger) - パラメーター:
clientAuthentication- null であってはなりません。taskScheduler- null であってはなりません。client- null であってはなりません。refreshTrigger- null であってはなりません。- 導入:
- 4.0
LifecycleAwareSessionManager
public LifecycleAwareSessionManager(ClientAuthentication clientAuthentication, TaskScheduler taskScheduler, VaultClient client) - パラメーター:
clientAuthentication- null であってはなりません。taskScheduler- null であってはなりません。client- null であってはなりません。- 導入:
- 4.1
LifecycleAwareSessionManager
public LifecycleAwareSessionManager(ClientAuthentication clientAuthentication, TaskScheduler taskScheduler, VaultClient client, LifecycleAwareSessionManagerSupport.RefreshTrigger refreshTrigger) - パラメーター:
clientAuthentication- null であってはなりません。taskScheduler- null であってはなりません。client- null であってはなりません。refreshTrigger- null であってはなりません。- 導入:
- 4.1
方法の詳細
getToken
トークンの状態: Vault セッションを識別する現在有効なトークンが含まれています。setToken
destroy
public void destroy()- 次で指定:
- インターフェース
DisposableBean内のdestroy
revoke
public void revoke()現在のVaultTokenを取り消して削除します。- 導入:
- 3.0.2
revoke
VaultTokenを取り消します。- パラメーター:
token- 取り消すトークン。null であってはなりません。
renewToken
public boolean renewToken()トークンのリフレッシュを実行します。以前にトークンを取得していない場合は、新しいトークンを作成します。トークンが以前に取得された場合、自己リフレッシュを使用して現在のトークンをリフレッシュします。クライアント側のエラー (許可が拒否されたなど) は、トークンが期限切れであるか単に見つからないためにリフレッシュできないことを示します。- 戻り値:
- リフレッシュが成功した場合は true。新しいトークンが取得された場合、またはリフレッシュに失敗した場合は false。
getSessionToken
インターフェースからコピーされた説明:SessionManagerセッショントークンを取得します。- 次で指定:
- インターフェース
SessionManager内のgetSessionToken - 戻り値:
- セッショントークン。
login
isTokenRenewable
protected boolean isTokenRenewable()- 戻り値:
- トークンが更新可能な場合は true。
LifecycleAwareSessionManager(ClientAuthentication, TaskScheduler, VaultClient)を使用してください。