Class CachedS3ExpressCredentials
java.lang.Object
software.amazon.awssdk.services.s3.internal.s3express.CachedS3ExpressCredentials
- All Implemented Interfaces:
AutoCloseable
,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.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionbuilder
(Function<S3ExpressIdentityKey, SessionCredentials> supplier) void
close()
boolean
get()
int
hashCode()
-
Method Details
-
builder
public static CachedS3ExpressCredentials.Builder builder(Function<S3ExpressIdentityKey, SessionCredentials> supplier) -
get
-
equals
-
hashCode
-
close
public void close()Description copied from interface:SdkAutoCloseable
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSdkAutoCloseable
-