Class 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 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 class HttpAWSCredentials
        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 interface RenewableCredentials