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 classCachedSupplier
to wrap the credential value and provide refresh capabilities, set with theNonBlocking
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 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 ---------|---------|---|--------------- <--------> refresh
Make sure to
close()
instances when they are no longer used.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CachedS3ExpressCredentials.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CachedS3ExpressCredentials.Builder
builder(Function<S3ExpressIdentityKey,SessionCredentials> supplier)
void
close()
boolean
equals(Object o)
SessionCredentials
get()
int
hashCode()
-
-
-
Method Detail
-
builder
public static CachedS3ExpressCredentials.Builder builder(Function<S3ExpressIdentityKey,SessionCredentials> supplier)
-
get
public SessionCredentials get()
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSdkAutoCloseable
-
-