Java Code Examples for com.amazonaws.services.elasticache.model.CacheCluster#getCacheClusterId()

The following examples show how to use com.amazonaws.services.elasticache.model.CacheCluster#getCacheClusterId() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ElastiCacheFactoryBean.java    From spring-cloud-aws with Apache License 2.0 5 votes vote down vote up
private static Endpoint getEndpointForCache(CacheCluster cacheCluster) {
	if (cacheCluster.getConfigurationEndpoint() != null) {
		return cacheCluster.getConfigurationEndpoint();
	}

	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() + "'");
}
 
Example 2
Source File: ElasticacheCluster.java    From billow with Apache License 2.0 5 votes vote down vote up
public ElasticacheCluster(CacheCluster cacheCluster, NodeGroupMember nodeGroupMember, List<Tag> tagList) {
    this.cacheClusterId = cacheCluster.getCacheClusterId();
    this.clientDownloadLandingPage = cacheCluster.getClientDownloadLandingPage();
    this.cacheNodeType = cacheCluster.getCacheNodeType();
    this.engine = cacheCluster.getEngine();
    this.engineVersion = cacheCluster.getEngineVersion();
    this.cacheClusterStatus = cacheCluster.getCacheClusterStatus();
    this.numCacheNodes = cacheCluster.getNumCacheNodes();
    this.preferredAvailabilityZone = cacheCluster.getPreferredAvailabilityZone();
    this.cacheClusterCreateTime = cacheCluster.getCacheClusterCreateTime();
    this.preferredMaintenanceWindow = cacheCluster.getPreferredMaintenanceWindow();
    this.pendingModifiedValues = cacheCluster.getPendingModifiedValues().toString();
    if (cacheCluster.getNotificationConfiguration() != null) {
        this.notificationConfiguration = cacheCluster.getNotificationConfiguration().toString();
    } else {
        this.notificationConfiguration = "empty";
    }
    this.cacheSecurityGroups = cacheCluster.getSecurityGroups().toString();
    this.cacheParameterGroup = cacheCluster.getCacheParameterGroup().toString();
    this.cacheSubnetGroupName = cacheCluster.getCacheSubnetGroupName();
    this.cacheNodes = cacheCluster.getCacheNodes().toString();
    this.autoMinorVersionUpgrade = cacheCluster.getAutoMinorVersionUpgrade();
    this.securityGroups = cacheCluster.getSecurityGroups().toString();
    this.replicationGroupId = cacheCluster.getReplicationGroupId();
    this.snapshotRetentionLimit = cacheCluster.getSnapshotRetentionLimit();
    this.snapshotWindow = cacheCluster.getSnapshotWindow();
    if (nodeGroupMember != null) {
        this.endpoint = nodeGroupMember.getReadEndpoint();
        this.currentRole = nodeGroupMember.getCurrentRole();
    } else {
        this.endpoint = cacheCluster.getConfigurationEndpoint();
        this.currentRole = null;
    }
    this.tags = new HashMap<>(tagList.size());
    for(Tag tag : tagList) {
        this.tags.put(tag.getKey(), tag.getValue());
    }
}