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 Classes Modifier and Type Class Description static classCachedTokenRefresher.Builder<TokenT extends SdkToken>
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CachedTokenRefresher.Builderbuilder()Builder method to construct instance of CachedTokenRefresher.voidclose()TokenTrefreshIfStaleAndFetch()Gets the fresh token from the service or provided suppliers.
-
-
-
Method Detail
-
builder
public static CachedTokenRefresher.Builder builder()
Builder method to construct instance of CachedTokenRefresher.- Returns:
-
refreshIfStaleAndFetch
public TokenT 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()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSdkAutoCloseable
-
-