public class LocalClusterDiscoveryService implements ClusterDiscoveryService {
private ConcurrentMap<String, ClusterEntity> clusters = Maps.newConcurrentMap();
public void addCluster(ClusterEntity cluster) throws AlreadyExistsException {
if (null != clusters.putIfAbsent(cluster.getName(), cluster)) {
throw new AlreadyExistsException("cluster", cluster.getName());
}
}