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
Modifier and TypeClassDescriptionstatic class
CachedTokenRefresher.Builder<TokenT extends SdkToken>
-
Method Summary
Modifier and TypeMethodDescriptionstatic CachedTokenRefresher.Builder
builder()
Builder method to construct instance of CachedTokenRefresher.void
close()
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:TokenRefresher
Gets the fresh token from the service or provided suppliers.- Specified by:
refreshIfStaleAndFetch
in interfaceTokenRefresher<TokenT extends SdkToken>
- Returns:
- Fresh AwsToken as supplied by suppliers.
-
close
public void close()Description copied from interface:SdkAutoCloseable
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSdkAutoCloseable
-