com.amazonaws.services.dynamodbv2.datamodeling
Class S3ClientCache

java.lang.Object
  extended by com.amazonaws.services.dynamodbv2.datamodeling.S3ClientCache

Deprecated. These classes have been deprecated, please use the classes in the com.amazonaws.mobileconnectors namespace.

public class S3ClientCache
extends java.lang.Object

A smart Map for 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).


Method Summary
 AmazonS3Client getClient(Region s3region)
          Deprecated. Returns a client for the requested region, or throws an exception when unable.
 TransferManager getTransferManager(Region region)
          Deprecated. Returns a TransferManager for the given region, or throws an exception when unable.
 void useClient(AmazonS3Client client)
          Deprecated. Force the client cache to provide a certain client for the region which that client is configured.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

useClient

public void useClient(AmazonS3Client client)
Deprecated. 
Force the client cache to provide a certain client for the region which that client is configured. This can be useful to provide clients with different S3ClientOptions or use a AmazonS3EncryptionClient in place of a regular client. Using a new client will also forcibly shut down any TransferManager that has been instantiated with that client, with the TransferManager.shutdownNow() method.

Parameters:
client - An AmazonS3Client to use in the cache. Its region will be detected automatically.

getClient

public AmazonS3Client getClient(Region s3region)
Deprecated. 
Returns a client for the requested region, or throws an exception when unable.

Parameters:
s3region - The region the returned AmazonS3Client will be configured to use.
Returns:
A client for the given region from the cache, either instantiated automatically from the provided AWSCredentials or provided with useClient(AmazonS3Client).
Throws:
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.

getTransferManager

public TransferManager getTransferManager(Region region)
Deprecated. 
Returns a TransferManager for the given region, or throws an exception when unable. The returned TransferManager will always be instantiated from whatever AmazonS3Client is in the cache, whether provided with useClient(AmazonS3Client) or instantiated automatically from AWSCredentials. Any TransferManager returned could be shut down if a new underlying AmazonS3Client is provided with useClient(AmazonS3Client).

Parameters:
region - The region the returned TransferManager will be configured to use.
Returns:
A transfer manager for the given region from the cache, or one instantiated automatically from any existing AmazonS3Client,


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.