public class InstanceProfileCredentialsProvider extends Object implements AWSCredentialsProvider
Constructor and Description |
---|
InstanceProfileCredentialsProvider()
Deprecated.
for the singleton method
getInstance() . |
InstanceProfileCredentialsProvider(boolean refreshCredentialsAsync)
Spins up a new thread to refresh the credentials asynchronously if
refreshCredentialsAsync is set to true, otherwise the credentials will be
refreshed from the instance metadata service synchronously,
|
Modifier and Type | Method and Description |
---|---|
static InstanceProfileCredentialsProvider |
createAsyncRefreshingProvider(boolean eagerlyRefreshCredentialsAsync)
Spins up a new thread to refresh the credentials asynchronously.
|
protected void |
finalize() |
AWSCredentials |
getCredentials()
Returns AWSCredentials which the caller can use to authorize an AWS request.
|
static InstanceProfileCredentialsProvider |
getInstance()
Returns a singleton
InstanceProfileCredentialsProvider that does not refresh credentials
asynchronously. |
void |
refresh()
Forces this credentials provider to refresh its credentials.
|
@Deprecated public InstanceProfileCredentialsProvider()
getInstance()
.public InstanceProfileCredentialsProvider(boolean refreshCredentialsAsync)
refreshCredentialsAsync
- true if credentials needs to be refreshed asynchronously else
false.public static InstanceProfileCredentialsProvider createAsyncRefreshingProvider(boolean eagerlyRefreshCredentialsAsync)
eagerlyRefreshCredentialsAsync
- when set to false will not attempt to refresh credentials asynchronously
until after a call has been made to getCredentials()
- ensures that
EC2CredentialsFetcher.getCredentials()
is only hit when this CredentialProvider is actually requiredpublic static InstanceProfileCredentialsProvider getInstance()
InstanceProfileCredentialsProvider
that does not refresh credentials
asynchronously. Use InstanceProfileCredentialsProvider(boolean)
for the feature.protected void finalize() throws Throwable
public AWSCredentials getCredentials()
AWSCredentialsProvider
getCredentials
in interface AWSCredentialsProvider
public void refresh()
AWSCredentialsProvider
refresh
in interface AWSCredentialsProvider
Copyright © 2017. All rights reserved.