Class S3ClientFactory

java.lang.Object
com.netflix.genie.common.internal.aws.s3.S3ClientFactory

public class S3ClientFactory extends Object
An S3Client client factory class. Given S3Uri instances and the configuration of the system this factory is expected to return a valid client instance for the S3 URI which can then be used to access that URI.
Since:
4.0.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    A simple class used as a key to see if we already have a S3Client created for the combination of properties that make up this class.
  • Constructor Summary

    Constructors
    Constructor
    Description
    S3ClientFactory(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider awsCredentialsProvider, software.amazon.awssdk.regions.providers.AwsRegionProvider regionProvider, org.springframework.core.env.Environment environment)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    software.amazon.awssdk.services.s3.S3AsyncClient
    getAsyncClient(software.amazon.awssdk.services.s3.S3Uri s3Uri)
    Get an S3AsyncClient client instance appropriate for the given S3Uri.
    software.amazon.awssdk.services.s3.S3Client
    getClient(software.amazon.awssdk.services.s3.S3Uri s3Uri)
    Get an S3Client client instance appropriate for the given S3Uri.
    getS3ClientKey(software.amazon.awssdk.services.s3.S3Uri s3Uri)
    Get the S3 client key for a given S3 URI.
    software.amazon.awssdk.services.s3.S3Uri
    Get a S3Uri from a string.
    software.amazon.awssdk.services.s3.S3Uri
    Get a S3Uri from a URI.
    software.amazon.awssdk.transfer.s3.S3TransferManager
    getTransferManager(software.amazon.awssdk.services.s3.S3Uri s3Uri)
    Get a S3TransferManager instance for use with the given s3Uri.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • S3ClientFactory

      public S3ClientFactory(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider awsCredentialsProvider, software.amazon.awssdk.regions.providers.AwsRegionProvider regionProvider, org.springframework.core.env.Environment environment)
      Constructor.
      Parameters:
      awsCredentialsProvider - The base AWS credentials provider to use for the generated S3 clients
      regionProvider - How this factory should determine the default Region
      environment - The Spring application Environment
  • Method Details

    • getClient

      public software.amazon.awssdk.services.s3.S3Client getClient(software.amazon.awssdk.services.s3.S3Uri s3Uri)
      Get an S3Client client instance appropriate for the given S3Uri.
      Parameters:
      s3Uri - The URI of the S3 resource this client is expected to access.
      Returns:
      A S3 client instance which should be used to access the S3 resource
    • getS3Uri

      public software.amazon.awssdk.services.s3.S3Uri getS3Uri(URI uri)
      Get a S3Uri from a URI.
      Parameters:
      uri - The URI to parse
      Returns:
      A S3Uri instance
    • getS3Uri

      public software.amazon.awssdk.services.s3.S3Uri getS3Uri(String uri)
      Get a S3Uri from a string.
      Parameters:
      uri - The URI string to parse
      Returns:
      A S3Uri instance
    • getS3ClientKey

      public S3ClientFactory.S3ClientKey getS3ClientKey(software.amazon.awssdk.services.s3.S3Uri s3Uri)
      Get the S3 client key for a given S3 URI.
      Parameters:
      s3Uri - The S3 URI
      Returns:
      The S3 client key
    • getAsyncClient

      public software.amazon.awssdk.services.s3.S3AsyncClient getAsyncClient(software.amazon.awssdk.services.s3.S3Uri s3Uri)
      Get an S3AsyncClient client instance appropriate for the given S3Uri.
      Parameters:
      s3Uri - The URI of the S3 resource this client is expected to access.
      Returns:
      A S3 async client instance which should be used to access the S3 resource
    • getTransferManager

      public software.amazon.awssdk.transfer.s3.S3TransferManager getTransferManager(software.amazon.awssdk.services.s3.S3Uri s3Uri)
      Get a S3TransferManager instance for use with the given s3Uri.
      Parameters:
      s3Uri - The S3 URI this transfer manager will be interacting with
      Returns:
      An instance of S3TransferManager backed by an appropriate S3 async client for the given URI