2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.controller.connectionmanager.scheme;
10 import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
11 import org.opendaylight.controller.connectionmanager.ConnectionMgmtScheme;
13 public class SchemeFactory {
14 public static AbstractScheme getScheme(ConnectionMgmtScheme scheme, IClusterGlobalServices clusterServices) {
15 if (scheme == ConnectionMgmtScheme.SINGLE_CONTROLLER) {
16 return SingleControllerScheme.getScheme(clusterServices);
17 } else if (scheme == ConnectionMgmtScheme.ROUND_ROBIN) {
18 return RoundRobinScheme.getScheme(clusterServices);
19 } else if (scheme == ConnectionMgmtScheme.LOAD_BALANCED) {
20 return LoadBalancedScheme.getScheme(clusterServices);
21 } else if (scheme == ConnectionMgmtScheme.ANY_CONTROLLER_ONE_MASTER) {
22 return AnyControllerScheme.getScheme(clusterServices);