Class CachedTokenRefresher<TokenT extends SdkToken>
java.lang.Object
software.amazon.awssdk.awscore.internal.token.CachedTokenRefresher<TokenT>
- All Implemented Interfaces:
AutoCloseable,TokenRefresher<TokenT>,SdkAutoCloseable
@ThreadSafe
public final class CachedTokenRefresher<TokenT extends SdkToken>
extends Object
implements TokenRefresher<TokenT>
Class to cache Tokens which are supplied by the Suppliers while constructing this class. Automatic refresh can be enabled by
setting autoRefreshDuration in builder methods.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classCachedTokenRefresher.Builder<TokenT extends SdkToken> -
Method Summary
Modifier and TypeMethodDescriptionstatic CachedTokenRefresher.Builderbuilder()Builder method to construct instance of CachedTokenRefresher.voidclose()Gets the fresh token from the service or provided suppliers.
-
Method Details
-
builder
Builder method to construct instance of CachedTokenRefresher.- Returns:
-
refreshIfStaleAndFetch
Description copied from interface:TokenRefresherGets the fresh token from the service or provided suppliers.- Specified by:
refreshIfStaleAndFetchin interfaceTokenRefresher<TokenT extends SdkToken>- Returns:
- Fresh AwsToken as supplied by suppliers.
-
close
public void close()Description copied from interface:SdkAutoCloseable- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSdkAutoCloseable
-