X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fconnectionmanager%2Fimplementation%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconnectionmanager%2Fscheme%2FSingleControllerScheme.java;h=a84a11b33614d2b7ffce0d3fba3b839fe35749f4;hb=a84d1bd3fba5d6fb7d9777e1508221e2f773e94f;hp=d80911a46533b39b63c075026c89f1352b0c4475;hpb=d4b6addab23cf24f20cd7969a7f1d800fda2bac1;p=controller.git diff --git a/opendaylight/connectionmanager/implementation/src/main/java/org/opendaylight/controller/connectionmanager/scheme/SingleControllerScheme.java b/opendaylight/connectionmanager/implementation/src/main/java/org/opendaylight/controller/connectionmanager/scheme/SingleControllerScheme.java index d80911a465..a84a11b336 100644 --- a/opendaylight/connectionmanager/implementation/src/main/java/org/opendaylight/controller/connectionmanager/scheme/SingleControllerScheme.java +++ b/opendaylight/connectionmanager/implementation/src/main/java/org/opendaylight/controller/connectionmanager/scheme/SingleControllerScheme.java @@ -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 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