Prevent ConfigPusher from killing its thread
[controller.git] / opendaylight / connectionmanager / implementation / src / main / java / org / opendaylight / controller / connectionmanager / scheme / SingleControllerScheme.java
index d80911a46533b39b63c075026c89f1352b0c4475..a84a11b33614d2b7ffce0d3fba3b839fe35749f4 100644 (file)
@@ -1,14 +1,12 @@
 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;
 
 class SingleControllerScheme extends AbstractScheme {
 
-    private static AbstractScheme myScheme= null;
+    private static AbstractScheme myScheme = null;
 
     protected SingleControllerScheme(IClusterGlobalServices clusterServices) {
         super(clusterServices, ConnectionMgmtScheme.SINGLE_CONTROLLER);
@@ -21,15 +19,9 @@ class SingleControllerScheme extends AbstractScheme {
         return myScheme;
     }
 
-    @SuppressWarnings("deprecation")
     @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
+        return clusterServices.amICoordinator();
     }
-}
+}
\ No newline at end of file