public class TokenManager
extends java.lang.Object
| Constructor and Description |
|---|
TokenManager(IdentityProvider identityProvider,
TokenManagerConfig tokenManagerConfig) |
| Modifier and Type | Method and Description |
|---|---|
long |
calculateRenewalDelay(long expireDate,
long issueDate)
This method calculates the duration we need to wait for requesting the next token.
|
TokenManagerConfig |
getConfig() |
Token |
getCurrentToken() |
protected Token |
renewToken()
This method is called by the renewal scheduler
Dispatches a request to the identity provider asynchronously, with a timeout for execution, and returns the Token if successfully acquired.
|
void |
start(TokenListener listener,
boolean blockForInitialToken)
Starts the token manager with given listener, blocks if blockForInitialToken is true
|
void |
stop() |
protected long |
ttlForLowerRefresh(long expireDate)
This method calculates TTL to renewal zone based on a minimum duration to token expiration.
|
protected long |
ttlForRatioRefresh(long expireDate,
long issueDate)
This method calculates TTL to renewal zone based on a ratio.
|
public TokenManager(IdentityProvider identityProvider, TokenManagerConfig tokenManagerConfig)
public void start(TokenListener listener, boolean blockForInitialToken)
listener - blockForInitialToken - protected Token renewToken()
public TokenManagerConfig getConfig()
public Token getCurrentToken()
public void stop()
public long calculateRenewalDelay(long expireDate,
long issueDate)
expireDate - issueDate - protected long ttlForLowerRefresh(long expireDate)
expireDate - protected long ttlForRatioRefresh(long expireDate,
long issueDate)
expireDate - issueDate - Copyright © 2025. All rights reserved.