Class S3ClientStore


  • public class S3ClientStore
    extends java.lang.Object
    A Singleton cache of clients for buckets configured for the region of those buckets
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected software.amazon.awssdk.services.s3.S3CrtAsyncClientBuilder asyncClientBuilder
      Default S3CrtAsyncClientBuilder
      static software.amazon.awssdk.services.s3.S3AsyncClient DEFAULT_ASYNC_CLIENT
      Default asynchronous client using the "https://s3.us-east-1.amazonaws.com" endpoint
      static software.amazon.awssdk.services.s3.S3Client DEFAULT_CLIENT
      Default client using the "https://s3.us-east-1.amazonaws.com" endpoint
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected software.amazon.awssdk.services.s3.S3AsyncClient generateAsyncClient​(java.lang.String bucketName)
      Generate an asynchronous client for the named bucket using a default client to determine the location of the named bucket
      protected software.amazon.awssdk.services.s3.S3AsyncClient generateAsyncClient​(java.lang.String bucketName, software.amazon.awssdk.services.s3.S3Client locationClient)
      Generate an asynchronous client for the named bucket using a default client to determine the location of the named client
      protected software.amazon.awssdk.services.s3.S3Client generateClient​(java.lang.String bucketName)
      Generate a client for the named bucket using a default client to determine the location of the named bucket
      protected software.amazon.awssdk.services.s3.S3Client generateClient​(java.lang.String bucketName, software.amazon.awssdk.services.s3.S3Client locationClient)
      Generate a client for the named bucket using a default client to determine the location of the named client
      software.amazon.awssdk.services.s3.S3AsyncClient getAsyncClientForBucketName​(java.lang.String bucketName)
      Get an existing async client or generate a new client for the named bucket if one doesn't exist
      software.amazon.awssdk.services.s3.S3Client getClientForBucketName​(java.lang.String bucketName)
      Get an existing client or generate a new client for the named bucket if one doesn't exist
      static S3ClientStore getInstance()
      Get the ClientStore instance
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • asyncClientBuilder

        protected software.amazon.awssdk.services.s3.S3CrtAsyncClientBuilder asyncClientBuilder
        Default S3CrtAsyncClientBuilder
      • DEFAULT_CLIENT

        public static final software.amazon.awssdk.services.s3.S3Client DEFAULT_CLIENT
        Default client using the "https://s3.us-east-1.amazonaws.com" endpoint
      • DEFAULT_ASYNC_CLIENT

        public static final software.amazon.awssdk.services.s3.S3AsyncClient DEFAULT_ASYNC_CLIENT
        Default asynchronous client using the "https://s3.us-east-1.amazonaws.com" endpoint
    • Method Detail

      • getInstance

        public static S3ClientStore getInstance()
        Get the ClientStore instance
        Returns:
        a singleton
      • getClientForBucketName

        public software.amazon.awssdk.services.s3.S3Client getClientForBucketName​(java.lang.String bucketName)
        Get an existing client or generate a new client for the named bucket if one doesn't exist
        Parameters:
        bucketName - the bucket name. If this value is null or empty a default client is returned
        Returns:
        a client
      • getAsyncClientForBucketName

        public software.amazon.awssdk.services.s3.S3AsyncClient getAsyncClientForBucketName​(java.lang.String bucketName)
        Get an existing async client or generate a new client for the named bucket if one doesn't exist
        Parameters:
        bucketName - the bucket name. If this value is null or empty a default client is returned
        Returns:
        a client
      • generateClient

        protected software.amazon.awssdk.services.s3.S3Client generateClient​(java.lang.String bucketName)
        Generate a client for the named bucket using a default client to determine the location of the named bucket
        Parameters:
        bucketName - the named of the bucket to make the client for
        Returns:
        an S3 client appropriate for the region of the named bucket
      • generateAsyncClient

        protected software.amazon.awssdk.services.s3.S3AsyncClient generateAsyncClient​(java.lang.String bucketName)
        Generate an asynchronous client for the named bucket using a default client to determine the location of the named bucket
        Parameters:
        bucketName - the named of the bucket to make the client for
        Returns:
        an asynchronous S3 client appropriate for the region of the named bucket
      • generateClient

        protected software.amazon.awssdk.services.s3.S3Client generateClient​(java.lang.String bucketName,
                                                                             software.amazon.awssdk.services.s3.S3Client locationClient)
        Generate a client for the named bucket using a default client to determine the location of the named client
        Parameters:
        bucketName - the named of the bucket to make the client for
        locationClient - the client used to determine the location of the named bucket, recommend using DEFAULT_CLIENT
        Returns:
        an S3 client appropriate for the region of the named bucket
      • generateAsyncClient

        protected software.amazon.awssdk.services.s3.S3AsyncClient generateAsyncClient​(java.lang.String bucketName,
                                                                                       software.amazon.awssdk.services.s3.S3Client locationClient)
        Generate an asynchronous client for the named bucket using a default client to determine the location of the named client
        Parameters:
        bucketName - the named of the bucket to make the client for
        locationClient - the client used to determine the location of the named bucket, recommend using DEFAULT_CLIENT
        Returns:
        an S3 client appropriate for the region of the named bucket