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 theAWSConnection.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.
-
-
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.AmazonS3Client
amazonClient()
protected void
closeConnection()
protected com.amazonaws.services.s3.AmazonS3ClientBuilder
createBuilder()
java.lang.Boolean
getForcePathStyleAccess()
Configures the client to use path-style access for all requests.protected void
initConnection()
protected void
prepareConnection()
void
setForcePathStyleAccess(java.lang.Boolean forcePathStyleAccess)
Configures the client to use path-style access for all requests.protected static void
shutdownQuietly(com.amazonaws.services.s3.AmazonS3Client client)
protected static void
shutdownQuietly(com.amazonaws.services.s3.transfer.TransferManager tm)
protected void
startConnection()
protected void
stopConnection()
com.amazonaws.services.s3.transfer.TransferManager
transferManager()
-
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:
prepareConnection
in classAdaptrisConnectionImp
- Throws:
CoreException
-
initConnection
protected void initConnection() throws CoreException
- Specified by:
initConnection
in classAdaptrisConnectionImp
- Throws:
CoreException
-
createBuilder
protected com.amazonaws.services.s3.AmazonS3ClientBuilder createBuilder() throws CoreException
- Throws:
CoreException
-
startConnection
protected void startConnection() throws CoreException
- Specified by:
startConnection
in classAdaptrisConnectionImp
- Throws:
CoreException
-
stopConnection
protected void stopConnection()
- Specified by:
stopConnection
in classAdaptrisConnectionImp
-
closeConnection
protected void closeConnection()
- Specified by:
closeConnection
in 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:
amazonClient
in interfaceClientWrapper
-
transferManager
public com.amazonaws.services.s3.transfer.TransferManager transferManager()
- Specified by:
transferManager
in 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.
-
-