Class AmazonS3Connection

  • All Implemented Interfaces:
    com.adaptris.aws.AWSCredentialsProviderBuilder.BuilderConfig, ClientWrapper, AdaptrisComponent, AdaptrisConnection, ComponentLifecycle, ComponentLifecycleExtension, StateManagedComponent

    @ComponentProfile(summary="Connection for supporting connectivity to Amazon S3",
                      tag="connections,amazon,s3",
                      recommended=S3Service.class)
    public class AmazonS3Connection
    extends com.adaptris.aws.AWSConnection
    implements ClientWrapper
    AdaptrisConnection implementation for Amazon S3.

    This class directly exposes almost all the getter and setters that are available in ClientConfiguration via the AWSConnection.getClientConfiguration() property for maximum flexibility in configuration.

    The key from the client-configuration element should match the name of the underlying ClientConfiguration property; so if you wanted to control the user-agent you would do :

     
       <client-configuration>
         <key-value-pair>
            <key>UserAgent</key>
            <value>My User Agent</value>
         </key-value-pair>
       </client-configuration>
     
     

    In the adapter configuration file this class is aliased as amazon-s3-connection which is the preferred alternative to the fully qualified classname when building your configuration.

    • Constructor Detail

      • AmazonS3Connection

        public AmazonS3Connection()
    • Method Detail

      • createBuilder

        protected com.amazonaws.services.s3.AmazonS3ClientBuilder createBuilder()
                                                                         throws CoreException
        Throws:
        CoreException
      • shutdownQuietly

        protected static void shutdownQuietly​(com.amazonaws.services.s3.transfer.TransferManager tm)
      • shutdownQuietly

        protected static void shutdownQuietly​(com.amazonaws.services.s3.AmazonS3Client client)
      • amazonClient

        public com.amazonaws.services.s3.AmazonS3Client amazonClient()
        Specified by:
        amazonClient in interface ClientWrapper
      • transferManager

        public com.amazonaws.services.s3.transfer.TransferManager transferManager()
        Specified by:
        transferManager in interface ClientWrapper
      • getForcePathStyleAccess

        public java.lang.Boolean getForcePathStyleAccess()
        Configures the client to use path-style access for all requests.

        The default behaviour is to detect which access style to use based on the configured endpoint (an IP will result in path-style access) and the bucket being accessed (some buckets are not valid DNS names). Setting this flag will result in path-style access being used for all requests.

      • setForcePathStyleAccess

        public void setForcePathStyleAccess​(java.lang.Boolean forcePathStyleAccess)
        Configures the client to use path-style access for all requests.

        The default behaviour is to detect which access style to use based on the configured endpoint (an IP will result in path-style access) and the bucket being accessed (some buckets are not valid DNS names). Setting this flag will result in path-style access being used for all requests.