Merge "BUG-2329 Add test for anyxmls inside rpc resonse for netcfon-connector"
[controller.git] / opendaylight / connectionmanager / implementation / src / main / java / org / opendaylight / controller / connectionmanager / scheme / SchemeFactory.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.connectionmanager.scheme;
9
10 import org.opendaylight.controller.clustering.services.IClusterGlobalServices;
11 import org.opendaylight.controller.connectionmanager.ConnectionMgmtScheme;
12
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);
23         }
24         return null;
25     }
26 }