public static class CachedTokenRefresher.Builder<TokenT extends SdkToken> extends Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
CachedTokenRefresher.Builder |
asyncRefreshEnabled(Boolean asyncRefreshEnabled)
Configure whether this refresher should fetch tokens asynchronously in the background.
|
CachedTokenRefresher |
build() |
CachedTokenRefresher.Builder |
exceptionHandler(Function<SdkException,TokenT> exceptionHandler) |
CachedTokenRefresher.Builder |
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.
|
CachedTokenRefresher.Builder |
staleDuration(Duration staleDuration) |
CachedTokenRefresher.Builder |
tokenRetriever(Supplier<TokenT> tokenRetriever) |
public CachedTokenRefresher.Builder tokenRetriever(Supplier<TokenT> tokenRetriever)
tokenRetriever - Supplier to retrieve the token from its respective sources.public CachedTokenRefresher.Builder staleDuration(Duration staleDuration)
staleDuration - The time before which the token is marked as stale to indicate it is time to fetch a fresh token.public CachedTokenRefresher.Builder prefetchTime(Duration prefetchTime)
asyncRefreshEnabled.
By default, this is 5 minutes.
public CachedTokenRefresher.Builder asyncRefreshEnabled(Boolean asyncRefreshEnabled)
CachedTokenRefresher.refreshIfStaleAndFetch() ()} is called, but additional resources are used to
maintain the provider.
By default, this is disabled.
public CachedTokenRefresher.Builder exceptionHandler(Function<SdkException,TokenT> exceptionHandler)
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.public CachedTokenRefresher build()
Copyright © 2022. All rights reserved.