Class CachedS3ExpressCredentials

java.lang.Object
software.amazon.awssdk.services.s3.internal.s3express.CachedS3ExpressCredentials
All Implemented Interfaces:
AutoCloseable, SdkAutoCloseable

public final class CachedS3ExpressCredentials extends Object implements SdkAutoCloseable
This class represents a single cached S3Express credential. It utilizes the existing class CachedSupplier to wrap the credential value and provide refresh capabilities, set with the NonBlocking prefetch strategy in order to get asynchronous refresh with a common thread pool.

Each time the value is requested through the get() method, the class delegates to the cached supplier to get the value. The cached supplier uses the refreshResult(Function, S3ExpressIdentityKey) function to retrieve the value.

Stale time - the time before, and relative to, the expiration time that the credentials are considered stale (invalid) Prefetch time - the time before, and relative, the expiration time that the credentials are eligible for refresh

       prefetch   stale expiration
 ---------|---------|---|---------------
          invalid input: '<'-------->
           refresh
 

Make sure to close() instances when they are no longer used.