Package org.apache.hadoop.fs.s3a.auth
Class AbstractSessionCredentialsProvider
java.lang.Object
org.apache.hadoop.fs.s3a.auth.AbstractAWSCredentialProvider
org.apache.hadoop.fs.s3a.auth.AbstractSessionCredentialsProvider
- All Implemented Interfaces:
software.amazon.awssdk.auth.credentials.AwsCredentialsProvider,software.amazon.awssdk.identity.spi.IdentityProvider<software.amazon.awssdk.identity.spi.AwsCredentialsIdentity>
- Direct Known Subclasses:
MarshalledCredentialProvider,TemporaryAWSCredentialsProvider
@Private
public abstract class AbstractSessionCredentialsProvider
extends AbstractAWSCredentialProvider
Base class for session credential support.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static final classA special set of null credentials which are not the anonymous class. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractSessionCredentialsProvider(URI uri, org.apache.hadoop.conf.Configuration conf) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract software.amazon.awssdk.auth.credentials.AwsCredentialscreateCredentials(org.apache.hadoop.conf.Configuration config) Implementation point: whatever the subclass must do to load credentials.Get any IOE raised during initialization.final booleanprotected voidinit()Initialize the credentials by callingcreateCredentials(Configuration)with the current config.booleanHas an attempt to initialize the credentials been attempted?software.amazon.awssdk.auth.credentials.AwsCredentialsGet the credentials.toString()Methods inherited from class org.apache.hadoop.fs.s3a.auth.AbstractAWSCredentialProvider
getConf, getUriMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awssdk.auth.credentials.AwsCredentialsProvider
identityType, resolveIdentityMethods inherited from interface software.amazon.awssdk.identity.spi.IdentityProvider
resolveIdentity, resolveIdentity
-
Constructor Details
-
AbstractSessionCredentialsProvider
public AbstractSessionCredentialsProvider(@Nullable URI uri, org.apache.hadoop.conf.Configuration conf) Constructor.- Parameters:
uri- possibly null filesystem URI.conf- configuration.
-
-
Method Details
-
init
Initialize the credentials by callingcreateCredentials(Configuration)with the current config.- Throws:
IOException- on any failure.
-
isInitialized
public boolean isInitialized()Has an attempt to initialize the credentials been attempted?- Returns:
- true if
init()was called.
-
createCredentials
protected abstract software.amazon.awssdk.auth.credentials.AwsCredentials createCredentials(org.apache.hadoop.conf.Configuration config) throws IOException Implementation point: whatever the subclass must do to load credentials. This is called frominit()and then the credentials are cached, along with any exception.- Parameters:
config- the configuration- Returns:
- the credentials
- Throws:
IOException- on any failure.
-
resolveCredentials
public software.amazon.awssdk.auth.credentials.AwsCredentials resolveCredentials() throws software.amazon.awssdk.core.exception.SdkExceptionGet the credentials. Any exception raised increateCredentials(Configuration)is thrown here before any attempt to return the credentials is made.- Returns:
- credentials, if set.
- Throws:
software.amazon.awssdk.core.exception.SdkException- if one was raised during initCredentialInitializationException- on other failures.
-
hasCredentials
public final boolean hasCredentials() -
toString
-
getInitializationException
Get any IOE raised during initialization. Null ifinit()hasn't been called, or it actually worked.- Returns:
- an exception or null.
-