Prepare the TopologyManager code for integration testing. Need to have the code in...
[controller.git] / opendaylight / topologymanager / implementation / src / main / java / org / opendaylight / controller / topologymanager / ITopologyManager.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.topologymanager;
11
12 import java.util.List;
13 import java.util.Map;
14 import java.util.Set;
15 import java.util.concurrent.ConcurrentMap;
16
17 import org.opendaylight.controller.sal.core.Edge;
18 import org.opendaylight.controller.sal.core.Host;
19 import org.opendaylight.controller.sal.core.Node;
20 import org.opendaylight.controller.sal.core.NodeConnector;
21 import org.opendaylight.controller.sal.core.Property;
22 import org.opendaylight.controller.sal.core.UpdateType;
23 import org.opendaylight.controller.sal.utils.Status;
24
25 /**
26  * The Interface provides methods to interact with network topology database.
27  */
28 public interface ITopologyManager {
29     /**
30      * Query to determine if the specified NodeConnector is connected
31      * to another Node or is a leaf for the network
32      * @param p The node connector
33      * @return true if the NodeConnector is connected to another
34      * switch false otherwise
35      */
36     public boolean isInternal(NodeConnector p);
37
38     /**
39      * Retrieves a map of all known link connections between nodes
40      * including their properties
41      * @return the map as specified
42      */
43     public Map<Edge, Set<Property>> getEdges();
44
45     /**
46      * Returns an unmodifiable map indexed by the Node and reporting
47      * all the edges getting out/in from/to the Node
48      * @return the map as specified
49      */
50     public Map<Node, Set<Edge>> getNodeEdges();
51
52     /**
53      * Add or Update an Host port in the topology manager DB
54      *
55      * @param p NodeConnector to which an host is connected
56      * @param h the Host connected to the NodeConnector
57      * @param t type of update if Add/Delete/Update
58      */
59     public void updateHostLink(NodeConnector p, Host h, UpdateType t,
60             Set<Property> props);
61
62     /**
63      * Return a set of NodeConnector that have hosts attached to them
64      *
65      * @return A set with all the NodeConnectors known to have an host
66      * attached
67      */
68     public Set<NodeConnector> getNodeConnectorWithHost();
69
70     /**
71      * Return the Host attached to a NodeConnector with Host.
72      * Multiple hosts maybe attached to a node connector.
73      * This method returns the first one only. Hence it has been
74      * deprecated. Use the new method getHostsAttachedToNodeConnector
75      * that returns the complete list of hosts.
76      * @return The Host attached to a NodeConnector
77      */
78     @Deprecated
79     public Host getHostAttachedToNodeConnector(NodeConnector p);
80
81     /**
82      * Returns a list of hosts attached to a NodeConnector
83      * @param p NodeConnector
84      * @return The list of hosts attached to a NodeConnector
85      */
86     public List<Host> getHostsAttachedToNodeConnector(NodeConnector p);
87
88     /**
89      * Returns a copy map which associates every node with all the
90      * NodeConnectors of the node that have an Host attached to it
91      *
92      * @return A map of all the Nodes with NodeConnectors
93      */
94     public Map<Node, Set<NodeConnector>> getNodesWithNodeConnectorHost();
95
96     /**
97      * Adds user configured link
98      *
99      * @param link User configured link
100      * @return "Success" or error reason
101      */
102     public Status addUserLink(TopologyUserLinkConfig link);
103
104     /**
105      * Deletes user configured link
106      *
107      * @param linkName The name of the user configured link
108      * @return "Success" or error reason
109      */
110     public Status deleteUserLink(String linkName);
111
112     /**
113      * Saves user configured links into config file
114      *
115      * @return "Success" or error reason
116      */
117     public Status saveConfig();
118
119     /**
120      * Gets all the user configured links
121      *
122      * @return The map of the user configured links
123      */
124     public ConcurrentMap<String, TopologyUserLinkConfig> getUserLinks();
125 }