Class S3ClientFactory
java.lang.Object
com.netflix.genie.common.internal.aws.s3.S3ClientFactory
An
S3Client
client factory class. Given S3Uri
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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A simple class used as a key to see if we already have a S3Client created for the combination of properties that make up this class. -
Constructor Summary
ConstructorsConstructorDescriptionS3ClientFactory
(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider awsCredentialsProvider, software.amazon.awssdk.regions.providers.AwsRegionProvider regionProvider, org.springframework.core.env.Environment environment) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionsoftware.amazon.awssdk.services.s3.S3AsyncClient
getAsyncClient
(software.amazon.awssdk.services.s3.S3Uri s3Uri) Get anS3AsyncClient
client instance appropriate for the givenS3Uri
.software.amazon.awssdk.services.s3.S3Client
getClient
(software.amazon.awssdk.services.s3.S3Uri s3Uri) Get anS3Client
client instance appropriate for the givenS3Uri
.getS3ClientKey
(software.amazon.awssdk.services.s3.S3Uri s3Uri) Get the S3 client key for a given S3 URI.software.amazon.awssdk.services.s3.S3Uri
Get aS3Uri
from a string.software.amazon.awssdk.services.s3.S3Uri
Get aS3Uri
from a URI.software.amazon.awssdk.transfer.s3.S3TransferManager
getTransferManager
(software.amazon.awssdk.services.s3.S3Uri s3Uri) Get aS3TransferManager
instance for use with the givens3Uri
.
-
Constructor Details
-
S3ClientFactory
public S3ClientFactory(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider awsCredentialsProvider, software.amazon.awssdk.regions.providers.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 defaultRegion
environment
- The Spring applicationEnvironment
-
-
Method Details
-
getClient
public software.amazon.awssdk.services.s3.S3Client getClient(software.amazon.awssdk.services.s3.S3Uri s3Uri) Get anS3Client
client instance appropriate for the givenS3Uri
.- 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
-
getS3Uri
Get aS3Uri
from a URI.- Parameters:
uri
- The URI to parse- Returns:
- A
S3Uri
instance
-
getS3Uri
Get aS3Uri
from a string.- Parameters:
uri
- The URI string to parse- Returns:
- A
S3Uri
instance
-
getS3ClientKey
Get the S3 client key for a given S3 URI.- Parameters:
s3Uri
- The S3 URI- Returns:
- The S3 client key
-
getAsyncClient
public software.amazon.awssdk.services.s3.S3AsyncClient getAsyncClient(software.amazon.awssdk.services.s3.S3Uri s3Uri) Get anS3AsyncClient
client instance appropriate for the givenS3Uri
.- Parameters:
s3Uri
- The URI of the S3 resource this client is expected to access.- Returns:
- A S3 async client instance which should be used to access the S3 resource
-
getTransferManager
public software.amazon.awssdk.transfer.s3.S3TransferManager getTransferManager(software.amazon.awssdk.services.s3.S3Uri s3Uri) Get aS3TransferManager
instance for use with the givens3Uri
.- Parameters:
s3Uri
- The S3 URI this transfer manager will be interacting with- Returns:
- An instance of
S3TransferManager
backed by an appropriate S3 async client for the given URI
-