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