package org.opendaylight.controller.connectionmanager.scheme;
-import java.net.InetAddress;
-import java.util.Set;
import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
import org.opendaylight.controller.connectionmanager.ConnectionMgmtScheme;
import org.opendaylight.controller.sal.core.Node;
@Override
public boolean isConnectionAllowedInternal(Node node) {
if (nodeConnections == null) return true;
- for (Node existingNode : nodeConnections.keySet()) {
- Set<InetAddress> controllers = nodeConnections.get(existingNode);
- if (controllers == null || controllers.size() == 0) continue;
- if (!controllers.contains(clusterServices.getMyAddress())) return false;
- }
- return true;
+ // Lets make it simple. The Cluster Coordinator is the master
+ if (clusterServices.amICoordinator()) return true;
+ return false;
}
-}
+}
\ No newline at end of file