3 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
5 * This program and the accompanying materials are made available under the
6 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
7 * and is available at http://www.eclipse.org/legal/epl-v10.html
10 package org.opendaylight.controller.connectionmanager;
12 import java.net.InetAddress;
16 import org.opendaylight.controller.sal.connection.ConnectionConstants;
17 import org.opendaylight.controller.sal.connection.ConnectionLocality;
18 import org.opendaylight.controller.sal.core.Node;
19 import org.opendaylight.controller.sal.utils.Status;
22 * Connection Manager provides south-bound connectivity services.
23 * The APIs are currently focused towards Active-Active Clustering support
24 * wherein the node can connect to any of the Active Controller in the Cluster.
25 * This component can also host the necessary logic for south-bound connectivity
26 * when partial cluster is identified during Partition scenarios.
28 * This (and its corresponding implementation) component can also be enhanced further
29 * for more fancy algorithms/criteria for connection acceptance.
32 public interface IConnectionManager {
34 * This method returns Connectivity Algorithm (Scheme) that is currently being used.
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 connected to the given controller.
43 * @param controller InetAddress of the Controller that is currently connected to a set of Nodes.
45 * @return Set<Node> Set of Nodes connected to a controller.
47 public Set<Node> getNodes(InetAddress controller);
50 * Method that will retrieve and return a Set of Nodes that is currently connected to
51 * the controller on which this method is executed.
53 * @return Set<Node> Set of Nodes connected to this controller.
55 public Set<Node> getLocalNodes();
58 * @deprecated Use getLocalityStatus(Node node) instead.
60 * Method to test if a node is local to a controller.
62 * @param node The node for which the locality is being tested
63 * @return true if node is local to this controller.<br>
64 * false if either node is not connected to this controller or
65 * not connected to any other controllers in the cluster.
67 public boolean isLocal(Node node);
70 * getLocalityStatus provides the tri-state connectivity status as opposed to the
71 * binary status returned by isLocal.
72 * ConnectionLocality enum that is returned by this method also includes the case of
73 * a Node not connected to any of the controllers in the cluster.
74 * @param node The node for which the locality is being verified
75 * @return ConnectionLocality
77 public ConnectionLocality getLocalityStatus(Node node);
80 * Disconnect a Node from the controller.
82 * @return Status of the disconnect Operation.
84 public Status disconnect(Node node);
89 * @param connectionIdentifier identifier with which the application would refer to a given connection.
90 * @param params Connection Params in Map format. This is entirely handled by the south-bound
91 * plugins and is an opaque value for SAL or Connection Manager. Typical values keyed inside
92 * this params are Management IP-Address, Username, Password, Security Keys, etc...
94 * @return Node Node connected to.
96 public Node connect (String connectionIdentifier, Map<ConnectionConstants, String> params);
101 * @param type Type of the node representing NodeIDType.
102 * @param connectionIdentifier identifier with which the application would refer to a given connection.
103 * @param params Connection Params in Map format. This is entirely handled by the south-bound
104 * plugins and is an opaque value for SAL or Connection Manager. Typical values keyed inside
105 * this params are Management IP-Address, Username, Password, Security Keys, etc...
107 * @return Status of the Connect Operation.
109 public Node connect(String type, String connectionIdentifier, Map<ConnectionConstants, String> params);