package org.opendaylight.controller.connectionmanager.scheme; 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; protected SingleControllerScheme(IClusterGlobalServices clusterServices) { super(clusterServices, ConnectionMgmtScheme.SINGLE_CONTROLLER); } public static AbstractScheme getScheme(IClusterGlobalServices clusterServices) { if (myScheme == null) { myScheme = new SingleControllerScheme(clusterServices); } return myScheme; } @Override public boolean isConnectionAllowedInternal(Node node) { // Lets make it simple. The Cluster Coordinator is the master return clusterServices.amICoordinator(); } }