blob: 36ee6669ba26a96a9701b91c315f8ddd482fc823 [file] [log] [blame]
tomedf06bb2014-08-27 16:22:15 -07001package org.onlab.onos.net.topology;
2
tom568581d2014-09-08 20:13:36 -07003import org.onlab.graph.Graph;
4import org.onlab.onos.net.ConnectPoint;
5import org.onlab.onos.net.DeviceId;
6import org.onlab.onos.net.Path;
tomedf06bb2014-08-27 16:22:15 -07007
tom568581d2014-09-08 20:13:36 -07008import java.util.Set;
9
tomedf06bb2014-08-27 16:22:15 -070010/**
11 * Service for providing network topology information.
12 */
13public interface TopologyService {
14
15 /**
16 * Returns the current topology descriptor.
17 *
18 * @return current topology
19 */
20 Topology currentTopology();
21
tom568581d2014-09-08 20:13:36 -070022 /**
23 * Returns the set of clusters in the specified topology.
24 *
25 * @param topology topology descriptor
26 * @return set of topology clusters
27 */
28 Set<TopologyCluster> getClusters(Topology topology);
29
30 /**
31 * Returns the graph view of the specified topology.
32 *
33 * @param topology topology descriptor
34 * @return topology graph view
35 */
36 Graph<TopoVertex, TopoEdge> getGraph(Topology topology);
37
38 /**
tomcfde0622014-09-09 11:02:42 -070039 * Returns the set of all shortest paths, precomputed in terms of hop-count,
40 * between the specified source and destination devices.
tom568581d2014-09-08 20:13:36 -070041 *
42 * @param topology topology descriptor
43 * @param src source device
44 * @param dst destination device
45 * @return set of all shortest paths between the two devices
46 */
47 Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst);
48
49 /**
50 * Returns the set of all shortest paths, computed using the supplied
51 * edge-weight entity, between the specified source and destination devices.
52 *
53 * @param topology topology descriptor
54 * @param src source device
55 * @param dst destination device
56 * @return set of all shortest paths between the two devices
57 */
58 Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst,
59 LinkWeight weight);
60
61 /**
62 * Indicates whether the specified connection point is part of the network
63 * infrastructure or part of network edge.
64 *
65 * @param topology topology descriptor
66 * @param connectPoint connection point
67 * @return true of connection point is in infrastructure; false if edge
68 */
69 boolean isInfrastructure(Topology topology, ConnectPoint connectPoint);
70
71
72 /**
tomcfde0622014-09-09 11:02:42 -070073 * Indicates whether the specified connection point belong to the
74 * broadcast tree.
tom568581d2014-09-08 20:13:36 -070075 *
76 * @param topology topology descriptor
77 * @param connectPoint connection point
78 * @return true if broadcast is permissible
79 */
80 boolean isInBroadcastTree(Topology topology, ConnectPoint connectPoint);
tomedf06bb2014-08-27 16:22:15 -070081
82 /**
83 * Adds the specified topology listener.
84 *
85 * @param listener topology listener
86 */
87 void addListener(TopologyListener listener);
88
89 /**
90 * Removes the specified topology listener.
91 *
92 * @param listener topology listener
93 */
94 void removeListener(TopologyListener listener);
95
96}