Move adsal into its own subdirectory.
[controller.git] / opendaylight / adsal / connectionmanager / api / src / main / java / org / opendaylight / controller / connectionmanager / ConnectionMgmtScheme.java
1 /*
2  * Copyright (c) 2013 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
9 package org.opendaylight.controller.connectionmanager;
10
11 /**
12  * Enumeration that represents the Connectivity Scheme / Algorithm for South-Bound nodes
13  * towards an Active-Active Clustered Controllers.
14  */
15 public enum ConnectionMgmtScheme {
16     /**
17      * All the nodes are connected with a Single Controller.
18      * The SingleControllerScheme algorithm will determine that one controller to which all
19      * the nodes are connected with.
20      * This is like Active-Standby model from a South-Bound perspective.
21      */
22     SINGLE_CONTROLLER("All nodes connected with a Single Controller"),
23
24     /**
25      * Any node can be connected with any controller. But with just 1 master controller.
26      */
27     ANY_CONTROLLER_ONE_MASTER("Nodes can to connect with any controller in the cluster"),
28
29     /**
30      * Simple Round Robin Scheme that will let the nodes connect with each controller in
31      * Active-Active cluster in a round robin fashion.
32      */
33     ROUND_ROBIN("Each node is connected with individual Controller in Round-Robin fashion"),
34
35     /**
36      * Complex Load Balancing scheme that will let the nodes connect with controller based
37      * on the resource usage in each of the controllers in a cluster.
38      */
39     LOAD_BALANCED("Connect nodes to controllers based on the Controller Load"),
40
41     /**
42      * Container based scheme will let the nodes connect with controller based
43      * on the container configuration.
44      */
45     CONTAINER_BASED("Connect nodes to controllers based on Container they belong to");
46
47     private ConnectionMgmtScheme(String name) {
48         this.name = name;
49     }
50
51     private String name;
52
53     public String toString() {
54         return name;
55     }
56
57     public static ConnectionMgmtScheme fromString(String pName) {
58         for(ConnectionMgmtScheme p:ConnectionMgmtScheme.values()) {
59             if (p.toString().equals(pName)) {
60                 return p;
61             }
62         }
63         return null;
64     }
65 }