}
getLogger().debug("Retrieved configuration value:" + newConfigResponse);
if(newConfigResponse != null && !newConfigResponse.equals(currentClusterConfigResponse)){
ClusterConfiguration newClusterConfiguration = AddrUtil.parseClusterTypeConfiguration(newConfigResponse);
getLogger().warn("Change in configuration - Existing configuration: " + currentClusterConfiguration + "\n New configuration:" + newClusterConfiguration);
if(newClusterConfiguration.getConfigVersion() > currentClusterConfiguration.getConfigVersion()){
currentClusterConfigResponse = newConfigResponse;
currentClusterConfiguration = newClusterConfiguration;
for(ClusterConfigurationObserver observer : clusterConfigObservers){
getLogger().info("Notifying observers about configuration change.");
observer.notifyUpdate(newClusterConfiguration);
}
if(!client.isConfigurationInitialized()){
client.setIsConfigurtionInitialized(true);
}
} else if(newClusterConfiguration.getConfigVersion() < currentClusterConfiguration.getConfigVersion()){
getLogger().info("Ignoring stale configuration - Existing configuration: " + currentClusterConfigResponse + "\n Stale configuration:" + newConfigResponse);
trackPollingError();
return;
}
}