Example usage for com.amazonaws.services.elasticache AmazonElastiCacheClient setRegion

List of usage examples for com.amazonaws.services.elasticache AmazonElastiCacheClient setRegion

Introduction

In this page you can find the example usage for com.amazonaws.services.elasticache AmazonElastiCacheClient setRegion.

Prototype

@Deprecated
public void setRegion(Region region) throws IllegalArgumentException 

Source Link

Document

An alternative to AmazonWebServiceClient#setEndpoint(String) , sets the regional endpoint for this client's service calls.

Usage

From source file:org.springframework.cloud.aws.cache.config.annotation.ElastiCacheCachingConfiguration.java

License:Apache License

@Bean
@ConditionalOnMissingAmazonClient(AmazonElastiCache.class)
public AmazonElastiCache amazonElastiCache() {
    AmazonElastiCacheClient elastiCacheClient;
    if (this.credentialsProvider != null) {
        elastiCacheClient = new AmazonElastiCacheClient(this.credentialsProvider);
    } else {/*from  w  w w .j a  va2s  . c  o  m*/
        elastiCacheClient = new AmazonElastiCacheClient();
    }

    if (this.regionProvider != null) {
        elastiCacheClient.setRegion(this.regionProvider.getRegion());
    }
    return elastiCacheClient;
}