Class AwsSessionCredentials
- java.lang.Object
-
- com.boomi.common.apache.http.auth.credentials.HttpAWSCredentials
-
- com.boomi.common.rest.rolesanywhere.AwsSessionCredentials
-
- All Implemented Interfaces:
RenewableCredentials
,Credentials
public class AwsSessionCredentials extends HttpAWSCredentials implements RenewableCredentials
A class that represents AWS session credentials for use with the Apache HTTP client. It extends the HttpAWSCredentials class and implements the RenewableCredentials interface. This class allows for the renewal of AWS credentials during the lifetime of the application.
-
-
Constructor Summary
Constructors Constructor Description AwsSessionCredentials(AWSCredentials credentials)
Constructs a new AwsSessionCredentials object with the provided AWS credentials.AwsSessionCredentials(Supplier<AWSCredentials> credentialsSupplier)
Constructs a new AwsSessionCredentials object with the provided AWS credentials supplier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AWSCredentials
createAWSCredentials()
Creates and returns the AWS credentials to be used for authentication.boolean
renew()
Method returns true if the Credentials has been renewed.-
Methods inherited from class com.boomi.common.apache.http.auth.credentials.HttpAWSCredentials
getAwsAccessKey, getAwsRegion, getAwsServiceName, getPassword, getUserPrincipal
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.http.auth.Credentials
getPassword, getUserPrincipal
-
-
-
-
Constructor Detail
-
AwsSessionCredentials
public AwsSessionCredentials(AWSCredentials credentials)
Constructs a new AwsSessionCredentials object with the provided AWS credentials.- Parameters:
credentials
- The AWS credentials to use for authentication.
-
AwsSessionCredentials
public AwsSessionCredentials(Supplier<AWSCredentials> credentialsSupplier)
Constructs a new AwsSessionCredentials object with the provided AWS credentials supplier.- Parameters:
credentialsSupplier
- A supplier that provides the AWS credentials to use for authentication. The supplier is invoked each time the credentials are needed.
-
-
Method Detail
-
createAWSCredentials
public AWSCredentials createAWSCredentials()
Creates and returns the AWS credentials to be used for authentication.- Overrides:
createAWSCredentials
in classHttpAWSCredentials
- Returns:
- The AWS credentials to be used for authentication.
-
renew
public boolean renew()
Method returns true if the Credentials has been renewed. Return false if the credentials are not renewable (the credentials supplier is null), there is an error while generating the credentials, or null credentials are obtained.- Specified by:
renew
in interfaceRenewableCredentials
-
-