2 * Copyright (c) 2013 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
9 package org.opendaylight.controller.connectionmanager;
11 import java.net.InetAddress;
15 import org.opendaylight.controller.sal.connection.ConnectionConstants;
16 import org.opendaylight.controller.sal.connection.ConnectionLocality;
17 import org.opendaylight.controller.sal.core.Node;
18 import org.opendaylight.controller.sal.utils.Status;
21 * Connection Manager provides south-bound connectivity services. The APIs are
22 * currently focused towards Active-Active Clustering support wherein the node
23 * can connect to any of the Active Controller in the Cluster. This component
24 * can also host the necessary logic for south-bound connectivity when partial
25 * cluster is identified during Partition scenarios.
27 * This (and its corresponding implementation) component can also be enhanced
28 * further for more fancy algorithms/criteria for connection acceptance.
31 public interface IConnectionManager {
33 * This method returns Connectivity Algorithm (Scheme) that is currently
36 * @return ConnectionMgmtScheme Enum that represents the active scheme.
38 public ConnectionMgmtScheme getActiveScheme();
41 * Method that will retrieve and return a Set of Nodes that is currently
42 * connected to the given controller.
45 * InetAddress of the Controller that is currently connected to a
48 * @return Set<Node> Set of Nodes connected to a controller.
50 public Set<Node> getNodes(InetAddress controller);
53 * Method that will retrieve and return a Set of Nodes that is currently
54 * connected to the controller on which this method is executed.
56 * @return Set<Node> Set of Nodes connected to this controller.
58 public Set<Node> getLocalNodes();
61 * @deprecated Use getLocalityStatus(Node node) instead.
63 * Method to test if a node is local to a controller.
66 * The node for which the locality is being tested
67 * @return true if node is local to this controller.<br>
68 * false if either node is not connected to this controller or not
69 * connected to any other controllers in the cluster.
71 public boolean isLocal(Node node);
74 * getLocalityStatus provides the tri-state connectivity status as opposed
75 * to the binary status returned by isLocal. ConnectionLocality enum that is
76 * returned by this method also includes the case of a Node not connected to
77 * any of the controllers in the cluster.
80 * The node for which the locality is being verified
81 * @return ConnectionLocality
83 public ConnectionLocality getLocalityStatus(Node node);
86 * Disconnect a Node from the controller.
88 * @return Status of the disconnect Operation.
90 public Status disconnect(Node node);
95 * @param connectionIdentifier
96 * identifier with which the application would refer to a given
99 * Connection Params in Map format. This is entirely handled by
100 * the south-bound plugins and is an opaque value for SAL or
101 * Connection Manager. Typical values keyed inside this params
102 * are Management IP-Address, Username, Password, Security Keys,
105 * @return Node Node connected to.
107 public Node connect(String connectionIdentifier,
108 Map<ConnectionConstants, String> params);
114 * Type of the node representing NodeIDType.
115 * @param connectionIdentifier
116 * identifier with which the application would refer to a given
119 * Connection Params in Map format. This is entirely handled by
120 * the south-bound plugins and is an opaque value for SAL or
121 * Connection Manager. Typical values keyed inside this params
122 * are Management IP-Address, Username, Password, Security Keys,
125 * @return Status of the Connect Operation.
127 public Node connect(String type, String connectionIdentifier,
128 Map<ConnectionConstants, String> params);
131 * Retrieve list of cluster-members to which Node is connected to
134 * Node for which cluster-members to be retrieved
136 * @return Set<InetAddress> List of cluster-member addresses to which the
139 public Set<InetAddress> getControllers(Node node);