Connection Manager infrastructure supporting the Clustering Active-Active requirement.
[controller.git] / opendaylight / connectionmanager / implementation / src / main / java / org / opendaylight / controller / connectionmanager / scheme / SchemeFactory.java
diff --git a/opendaylight/connectionmanager/implementation/src/main/java/org/opendaylight/controller/connectionmanager/scheme/SchemeFactory.java b/opendaylight/connectionmanager/implementation/src/main/java/org/opendaylight/controller/connectionmanager/scheme/SchemeFactory.java
new file mode 100644 (file)
index 0000000..7e13745
--- /dev/null
@@ -0,0 +1,19 @@
+package org.opendaylight.controller.connectionmanager.scheme;
+
+import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
+import org.opendaylight.controller.connectionmanager.ConnectionMgmtScheme;
+
+public class SchemeFactory {
+    public static AbstractScheme getScheme(ConnectionMgmtScheme scheme, IClusterGlobalServices clusterServices) {
+        if (scheme == ConnectionMgmtScheme.SINGLE_CONTROLLER) {
+            return SingleControllerScheme.getScheme(clusterServices);
+        } else if (scheme == ConnectionMgmtScheme.ROUND_ROBIN) {
+            return RoundRobinScheme.getScheme(clusterServices);
+        } else if (scheme == ConnectionMgmtScheme.LOAD_BALANCED) {
+            return LoadBalancedScheme.getScheme(clusterServices);
+        } else if (scheme == ConnectionMgmtScheme.ANY_CONTROLLER_ONE_MASTER) {
+            return AnyControllerScheme.getScheme(clusterServices);
+        }
+        return null;
+    }
+}