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.core.Node;
18 import org.opendaylight.controller.sal.utils.Status;
21 * Connection Manager provides south-bound connectivity services.
22 * The APIs are currently focused towards Active-Active Clustering support
23 * wherein the node can connect to any of the Active Controller in the Cluster.
24 * This component can also host the necessary logic for south-bound connectivity
25 * when partial cluster is identified during Partition scenarios.
27 * This (and its corresponding implementation) component can also be enhanced further
28 * for more fancy algorithms/criteria for connection acceptance.
31 public interface IConnectionManager {
33 * This method returns Connectivity Algorithm (Scheme) that is currently being used.
35 * @return ConnectionMgmtScheme Enum that represents the active scheme.
37 public ConnectionMgmtScheme getActiveScheme();
40 * Method that will retrieve and return a Set of Nodes that is currently connected to the given controller.
42 * @param controller InetAddress of the Controller that is currently connected to a set of Nodes.
44 * @return Set<Node> Set of Nodes connected to a controller.
46 public Set<Node> getNodes(InetAddress controller);
49 * Method that will retrieve and return a Set of Nodes that is currently connected to
50 * the controller on which this method is executed.
52 * @return Set<Node> Set of Nodes connected to this controller.
54 public Set<Node> getLocalNodes();
57 * @deprecated Use getLocalityStatus(Node node) instead.
59 * Method to test if a node is local to a controller.
61 * @param node The node for which the locality is being tested
62 * @return true if node is local to this controller.<br>
63 * false if either node is not connected to this controller or
64 * not connected to any other controllers in the cluster.
66 public boolean isLocal(Node node);
69 * getLocalityStatus provides the tri-state connectivity status as opposed to the
70 * binary status returned by isLocal.
71 * ConnectionLocality enum that is returned by this method also includes the case of
72 * a Node not connected to any of the controllers in the cluster.
73 * @param node The node for which the locality is being verified
74 * @return ConnectionLocality
76 public ConnectionLocality getLocalityStatus(Node node);
79 * Disconnect a Node from the controller.
81 * @return Status of the disconnect Operation.
83 public Status disconnect(Node node);
88 * @param connectionIdentifier identifier with which the application would refer to a given connection.
89 * @param params Connection Params in Map format. This is entirely handled by the south-bound
90 * plugins and is an opaque value for SAL or Connection Manager. Typical values keyed inside
91 * this params are Management IP-Address, Username, Password, Security Keys, etc...
93 * @return Node Node connected to.
95 public Node connect (String connectionIdentifier, Map<ConnectionConstants, String> params);
100 * @param type Type of the node representing NodeIDType.
101 * @param connectionIdentifier identifier with which the application would refer to a given connection.
102 * @param params Connection Params in Map format. This is entirely handled by the south-bound
103 * plugins and is an opaque value for SAL or Connection Manager. Typical values keyed inside
104 * this params are Management IP-Address, Username, Password, Security Keys, etc...
106 * @return Status of the Connect Operation.
108 public Node connect(String type, String connectionIdentifier, Map<ConnectionConstants, String> params);