Example usage for com.amazonaws.services.elasticache.model CacheCluster getCacheNodes

List of usage examples for com.amazonaws.services.elasticache.model CacheCluster getCacheNodes

Introduction

In this page you can find the example usage for com.amazonaws.services.elasticache.model CacheCluster getCacheNodes.

Prototype


public java.util.List<CacheNode> getCacheNodes() 

Source Link

Document

A list of cache nodes that are members of the cluster.

Usage

From source file:org.springframework.cloud.aws.cache.ElastiCacheFactoryBean.java

License:Apache License

private static Endpoint getEndpointForCache(CacheCluster cacheCluster) {
    if (cacheCluster.getConfigurationEndpoint() != null) {
        return cacheCluster.getConfigurationEndpoint();
    }/*from   w w w. j  a  va 2 s  .c  o m*/

    if (!cacheCluster.getCacheNodes().isEmpty()) {
        return cacheCluster.getCacheNodes().get(0).getEndpoint();
    }

    throw new IllegalArgumentException("No Configuration Endpoint or Cache Node available to "
            + "receive address information for cluster:'" + cacheCluster.getCacheClusterId() + "'");
}