Class S3ClientFactory
java.lang.Object
com.netflix.genie.common.internal.aws.s3.S3ClientFactory
An
AmazonS3
client factory class. Given AmazonS3URI
instances and the configuration of the system
this factory is expected to return a valid client instance for the S3 URI which can then be used to access that URI.- Since:
- 4.0.0
-
Constructor Summary
ConstructorDescriptionS3ClientFactory
(com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider, com.amazonaws.regions.AwsRegionProvider regionProvider, org.springframework.core.env.Environment environment) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncom.amazonaws.services.s3.AmazonS3
getClient
(com.amazonaws.services.s3.AmazonS3URI s3URI) Get anAmazonS3
client instance appropriate for the givenAmazonS3URI
.com.amazonaws.services.s3.transfer.TransferManager
getTransferManager
(com.amazonaws.services.s3.AmazonS3URI s3URI) Get aTransferManager
instance for use with the givens3URI
.
-
Constructor Details
-
S3ClientFactory
public S3ClientFactory(com.amazonaws.auth.AWSCredentialsProvider awsCredentialsProvider, com.amazonaws.regions.AwsRegionProvider regionProvider, org.springframework.core.env.Environment environment) Constructor.- Parameters:
awsCredentialsProvider
- The base AWS credentials provider to use for the generated S3 clientsregionProvider
- How this factory should determine the defaultRegions
environment
- The Spring applicationEnvironment
-
-
Method Details
-
getClient
public com.amazonaws.services.s3.AmazonS3 getClient(com.amazonaws.services.s3.AmazonS3URI s3URI) Get anAmazonS3
client instance appropriate for the givenAmazonS3URI
.- Parameters:
s3URI
- The URI of the S3 resource this client is expected to access.- Returns:
- A S3 client instance which should be used to access the S3 resource
-
getTransferManager
public com.amazonaws.services.s3.transfer.TransferManager getTransferManager(com.amazonaws.services.s3.AmazonS3URI s3URI) Get aTransferManager
instance for use with the givens3URI
.- Parameters:
s3URI
- The S3 URI this transfer manager will be interacting with- Returns:
- An instance of
TransferManager
backed by an appropriate S3 client for the given URI
-