12b196989e4a0c4fa1f608cd7a479d224064555c
[controller.git] / opendaylight / connectionmanager / api / src / main / java / org / opendaylight / controller / connectionmanager / IConnectionManager.java
1
2 /*
3  * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
4  *
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
8  */
9
10 package org.opendaylight.controller.connectionmanager;
11
12 import java.net.InetAddress;
13 import java.util.Map;
14 import java.util.Set;
15
16 import org.opendaylight.controller.sal.connection.ConnectionConstants;
17 import org.opendaylight.controller.sal.core.Node;
18 import org.opendaylight.controller.sal.utils.Status;
19
20 /**
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.
26  *
27  * This (and its corresponding implementation) component can also be enhanced further
28  * for more fancy algorithms/criteria for connection acceptance.
29  */
30
31 public interface IConnectionManager {
32     /**
33      * This method returns Connectivity Algorithm (Scheme) that is currently being used.
34      *
35      * @return ConnectionMgmtScheme Enum that represents the active scheme.
36      */
37     public ConnectionMgmtScheme getActiveScheme();
38
39     /**
40      * Method that will retrieve and return a Set of Nodes that is currently connected to the given controller.
41      *
42      * @param controller InetAddress of the Controller that is currently connected to a set of Nodes.
43      *
44      * @return Set<Node> Set of Nodes connected to a controller.
45      */
46     public Set<Node> getNodes(InetAddress controller);
47
48     /**
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.
51      *
52      * @return Set<Node> Set of Nodes connected to this controller.
53      */
54     public Set<Node> getLocalNodes();
55
56     /**
57      * Method to test if a node is local to a controller.
58      *
59      * @return true if node is local to this controller. false otherwise.
60      */
61     public boolean isLocal(Node node);
62
63     /**
64      * Disconnect a Node from the controller.
65      *
66      * @return Status of the disconnect Operation.
67      */
68     public Status disconnect(Node node);
69
70     /**
71      * Connect to a node
72      *
73      * @param connectionIdentifier identifier with which the application would refer to a given connection.
74      * @param params Connection Params in Map format. This is entirely handled by the south-bound
75      * plugins and is an opaque value for SAL or Connection Manager. Typical values keyed inside
76      * this params are Management IP-Address, Username, Password, Security Keys, etc...
77      *
78      *  @return Node Node connected to.
79      */
80     public Node connect (String connectionIdentifier, Map<ConnectionConstants, String> params);
81
82     /**
83      * Connect to a node
84      *
85      * @param type Type of the node representing NodeIDType.
86      * @param connectionIdentifier identifier with which the application would refer to a given connection.
87      * @param params Connection Params in Map format. This is entirely handled by the south-bound
88      * plugins and is an opaque value for SAL or Connection Manager. Typical values keyed inside
89      * this params are Management IP-Address, Username, Password, Security Keys, etc...
90      *
91      *  @return Status of the Connect Operation.
92      */
93     public Node connect(String type, String connectionIdentifier, Map<ConnectionConstants, String> params);
94 }