public class S3ClientCache extends java.lang.Object
|Modifier and Type||Method and Description|
Returns a client for the requested region, or throws an exception when unable.
Force the client cache to provide a certain client for the region which that client is configured.
public void useClient(AmazonS3Client client)
S3ClientOptionsor use a
AmazonS3EncryptionClientin place of a regular client. Using a new client will also forcibly shut down any
TransferManagerthat has been instantiated with that client, with the
AmazonS3Clientto use in the cache. Its region will be detected automatically.
public AmazonS3Client getClient(Region s3region)
s3region- The region the returned
AmazonS3Clientwill be configured to use.
AWSCredentialsor provided with
java.lang.IllegalArgumentException- When a region is requested that has not been provided to the cache with
useClient(AmazonS3Client), and the cache has no
AWSCredentialswith which a client may be instantiated.
public TransferManager getTransferManager(Region region)
TransferManagerfor the given region, or throws an exception when unable. The returned
TransferManagerwill always be instantiated from whatever
AmazonS3Clientis in the cache, whether provided with
useClient(AmazonS3Client)or instantiated automatically from
TransferManagerreturned could be shut down if a new underlying
AmazonS3Clientis provided with
Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.