public class S3ClientCache
extends java.lang.Object
AmazonS3Client objects. S3ClientCache keeps
the clients organized by region, and if provided AWSCredentials will
create clients on the fly. Otherwise it just return clients given to it with
useClient(AmazonS3Client).| Modifier and Type | Method and Description |
|---|---|
AmazonS3Client |
getClient(Region s3region)
Returns a client for the requested region, or throws an exception when
unable.
|
void |
useClient(AmazonS3Client client)
Force the client cache to provide a certain client for the region which
that client is configured.
|
public void useClient(AmazonS3Client client)
S3ClientOptions.client - An AmazonS3Client to use in the cache. Its region
will be detected automatically.public AmazonS3Client getClient(Region s3region)
s3region - The region the returned AmazonS3Client will be
configured to use.AWSCredentials or
provided with useClient(AmazonS3Client).java.lang.IllegalArgumentException - When a region is requested that has not
been provided to the cache with
useClient(AmazonS3Client), and the cache has no
AWSCredentials with which a client may be
instantiated.Copyright © 2018 Amazon Web Services, Inc. All Rights Reserved.