Class LazyAwsCredentialsProvider
- java.lang.Object
-
- software.amazon.awssdk.auth.credentials.internal.LazyAwsCredentialsProvider
-
- All Implemented Interfaces:
AutoCloseable
,AwsCredentialsProvider
,IdentityProvider<AwsCredentialsIdentity>
,SdkAutoCloseable
public class LazyAwsCredentialsProvider extends Object implements AwsCredentialsProvider, SdkAutoCloseable
A wrapper forAwsCredentialsProvider
that defers creation of the underlying provider until the first time theAwsCredentialsProvider.resolveCredentials()
method is invoked.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static LazyAwsCredentialsProvider
create(Supplier<AwsCredentialsProvider> delegateConstructor)
AwsCredentials
resolveCredentials()
ReturnsAwsCredentials
that can be used to authorize an AWS request.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.auth.credentials.AwsCredentialsProvider
identityType, resolveIdentity
-
Methods inherited from interface software.amazon.awssdk.identity.spi.IdentityProvider
resolveIdentity, resolveIdentity
-
-
-
-
Method Detail
-
create
public static LazyAwsCredentialsProvider create(Supplier<AwsCredentialsProvider> delegateConstructor)
-
resolveCredentials
public AwsCredentials resolveCredentials()
Description copied from interface:AwsCredentialsProvider
ReturnsAwsCredentials
that can be used to authorize an AWS request. Each implementation of AWSCredentialsProvider can choose its own strategy for loading credentials. For example, an implementation might load credentials from an existing key management system, or load new credentials when credentials are rotated.If an error occurs during the loading of credentials or credentials could not be found, a runtime exception will be raised.
- Specified by:
resolveCredentials
in interfaceAwsCredentialsProvider
- Returns:
- AwsCredentials which the caller can use to authorize an AWS request.
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceSdkAutoCloseable
-
-