public class S3ClientCache extends Object
S3Client
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(S3Client, Region)
.Modifier and Type | Method | Description |
---|---|---|
S3Client |
getClient(String region) |
Returns a client for the requested region, or throws an exception when
unable.
|
S3Client |
getClient(Region region) |
Returns a client for the requested region, or throws an exception when
unable.
|
void |
useClient(S3Client client,
Region region) |
Force the client cache to provide a certain client for the region which
that client is configured.
|
public void useClient(S3Client client, Region region)
S3AdvancedConfiguration
.client
- An S3Client
to use in the cache. Its region will
be detected automatically.public S3Client getClient(Region region)
region
- The region the returned S3Client
will be
configured to use.AwsCredentials
or
provided with useClient(S3Client, Region)
.IllegalArgumentException
- When a region is requested that has not been provided to the
cache with useClient(S3Client, Region)
, and the cache
has no AwsCredentials
with which a client may be
instantiated.public S3Client getClient(String region)
region
- The region the returned S3Client
will be
configured to use.AwsCredentials
or
provided with useClient(S3Client, Region)
.IllegalArgumentException
- When a region is requested that has not been provided to the
cache with useClient(S3Client, Region)
, and the cache
has no AwsCredentials
with which a client may be
instantiated.Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.