Class CachedS3ExpressCredentials
- java.lang.Object
-
- software.amazon.awssdk.services.s3.internal.s3express.CachedS3ExpressCredentials
-
- All Implemented Interfaces:
AutoCloseable,SdkAutoCloseable
@SdkInternalApi public final class CachedS3ExpressCredentials extends Object implements SdkAutoCloseable
This class represents a single cached S3Express credential. It utilizes the existing classCachedSupplierto wrap the credential value and provide refresh capabilities, set with theNonBlockingprefetch 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 therefreshResult(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 ---------|---------|---|--------------- <--------> refreshMake sure to
close()instances when they are no longer used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCachedS3ExpressCredentials.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CachedS3ExpressCredentials.Builderbuilder(Function<S3ExpressIdentityKey,SessionCredentials> supplier)voidclose()booleanequals(Object o)SessionCredentialsget()inthashCode()
-
-
-
Method Detail
-
builder
public static CachedS3ExpressCredentials.Builder builder(Function<S3ExpressIdentityKey,SessionCredentials> supplier)
-
get
public SessionCredentials get()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceSdkAutoCloseable
-
-