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 ClientWrapperAdaptrisConnection implementation for Amazon S3.This class directly exposes almost all the getter and setters that are available in
ClientConfigurationvia theAWSConnection.getClientConfiguration()property for maximum flexibility in configuration.The key from the
client-configurationelement 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.
-
-
Field Summary
-
Fields inherited from class com.adaptris.core.AdaptrisConnectionImp
log
-
-
Constructor Summary
Constructors Constructor Description AmazonS3Connection()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.amazonaws.services.s3.AmazonS3ClientamazonClient()protected voidcloseConnection()protected com.amazonaws.services.s3.AmazonS3ClientBuildercreateBuilder()java.lang.BooleangetForcePathStyleAccess()Configures the client to use path-style access for all requests.protected voidinitConnection()protected voidprepareConnection()voidsetForcePathStyleAccess(java.lang.Boolean forcePathStyleAccess)Configures the client to use path-style access for all requests.protected static voidshutdownQuietly(com.amazonaws.services.s3.AmazonS3Client client)protected static voidshutdownQuietly(com.amazonaws.services.s3.transfer.TransferManager tm)protected voidstartConnection()protected voidstopConnection()com.amazonaws.services.s3.transfer.TransferManagertransferManager()-
Methods inherited from class com.adaptris.aws.AWSConnection
clientConfiguration, credentialsProvider, endpointBuilder, getClientConfiguration, getCredentials, getCustomEndpoint, getRegion, getRetryPolicy, retryPolicy, setClientConfiguration, setCredentials, setCustomEndpoint, setRegion, setRetryPolicy, withClientConfiguration, withCredentialsProviderBuilder, withCustomEndpoint, withRegion, withRetryPolicy
-
Methods inherited from class com.adaptris.core.AdaptrisConnectionImp
addExceptionListener, addMessageConsumer, addMessageProducer, changeState, cloneForTesting, close, connectionErrorHandler, getConnectionErrorHandler, getUniqueId, getWorkersFirstOnShutdown, init, prepare, requestClose, requestInit, requestStart, requestStop, retrieveComponentState, retrieveConnection, retrieveExceptionListeners, retrieveMessageConsumers, retrieveMessageProducers, setConnectionErrorHandler, setUniqueId, setWorkersFirstOnShutdown, start, stop, workersFirstOnShutdown
-
-
-
-
Method Detail
-
prepareConnection
protected void prepareConnection() throws CoreException- Specified by:
prepareConnectionin classAdaptrisConnectionImp- Throws:
CoreException
-
initConnection
protected void initConnection() throws CoreException- Specified by:
initConnectionin classAdaptrisConnectionImp- Throws:
CoreException
-
createBuilder
protected com.amazonaws.services.s3.AmazonS3ClientBuilder createBuilder() throws CoreException- Throws:
CoreException
-
startConnection
protected void startConnection() throws CoreException- Specified by:
startConnectionin classAdaptrisConnectionImp- Throws:
CoreException
-
stopConnection
protected void stopConnection()
- Specified by:
stopConnectionin classAdaptrisConnectionImp
-
closeConnection
protected void closeConnection()
- Specified by:
closeConnectionin classAdaptrisConnectionImp
-
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:
amazonClientin interfaceClientWrapper
-
transferManager
public com.amazonaws.services.s3.transfer.TransferManager transferManager()
- Specified by:
transferManagerin interfaceClientWrapper
-
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.
-
-