Class AmazonS3Connection

java.lang.Object
com.adaptris.core.AdaptrisConnectionImp
com.adaptris.aws.AWSConnection
com.adaptris.aws.s3.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 Details

    • AmazonS3Connection

      public AmazonS3Connection()
  • Method Details

    • prepareConnection

      protected void prepareConnection() throws CoreException
      Specified by:
      prepareConnection in class AdaptrisConnectionImp
      Throws:
      CoreException
    • initConnection

      protected void initConnection() throws CoreException
      Specified by:
      initConnection in class AdaptrisConnectionImp
      Throws:
      CoreException
    • createBuilder

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

      protected void startConnection() throws CoreException
      Specified by:
      startConnection in class AdaptrisConnectionImp
      Throws:
      CoreException
    • stopConnection

      protected void stopConnection()
      Specified by:
      stopConnection in class AdaptrisConnectionImp
    • closeConnection

      protected void closeConnection()
      Specified by:
      closeConnection in class AdaptrisConnectionImp
    • 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 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(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.