Class CachedTokenRefresher.Builder<TokenT extends SdkToken>
java.lang.Object
software.amazon.awssdk.awscore.internal.token.CachedTokenRefresher.Builder<TokenT>
- Enclosing class:
- CachedTokenRefresher<TokenT extends SdkToken>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionasyncRefreshEnabled(Boolean asyncRefreshEnabled) Configure whether this refresher should fetch tokens asynchronously in the background.build()exceptionHandler(Function<SdkException, TokenT> exceptionHandler) prefetchTime(Duration prefetchTime) Configure the amount of time, relative to SSO session token expiration, that the cached credentials are considered close to stale and should be updated.staleDuration(Duration staleDuration) tokenRetriever(Supplier<TokenT> tokenRetriever) 
- 
Constructor Details- 
Builderpublic Builder()
 
- 
- 
Method Details- 
tokenRetriever- Parameters:
- tokenRetriever- Supplier to retrieve the token from its respective sources.
- Returns:
 
- 
staleDuration- Parameters:
- staleDuration- The time before which the token is marked as stale to indicate it is time to fetch a fresh token.
- Returns:
 
- 
prefetchTimeConfigure the amount of time, relative to SSO session token expiration, that the cached credentials are considered close to stale and should be updated. SeeasyncRefreshEnabled.By default, this is 5 minutes. 
- 
asyncRefreshEnabledConfigure whether this refresher should fetch tokens asynchronously in the background. If this is true, threads are less likely to block whenCachedTokenRefresher.refreshIfStaleAndFetch()()} is called, but additional resources are used to maintain the provider.By default, this is disabled. 
- 
exceptionHandlerpublic CachedTokenRefresher.Builder exceptionHandler(Function<SdkException, TokenT> exceptionHandler) - Parameters:
- exceptionHandler- Handler which takes action when a Runtime exception occurs while fetching a token. Handler can return a previously stored token or throw back the exception.
- Returns:
 
- 
build
 
-