blob: 7c6be334bdf5c4c6164391b4c00ebf63e6eee5f7 [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 /**
tomdc361b62014-09-09 20:36:52 -070023 * Indicates whether the specified topology is the latest or not.
24 * @param topology topology descriptor
25 * @return true if the topology is the most recent; false otherwise
26 */
27 boolean isLatest(Topology topology);
28
29 /**
tom568581d2014-09-08 20:13:36 -070030 * Returns the set of clusters in the specified topology.
31 *
32 * @param topology topology descriptor
33 * @return set of topology clusters
34 */
35 Set<TopologyCluster> getClusters(Topology topology);
36
37 /**
38 * Returns the graph view of the specified topology.
39 *
40 * @param topology topology descriptor
41 * @return topology graph view
42 */
43 Graph<TopoVertex, TopoEdge> getGraph(Topology topology);
44
45 /**
tomcfde0622014-09-09 11:02:42 -070046 * Returns the set of all shortest paths, precomputed in terms of hop-count,
47 * between the specified source and destination devices.
tom568581d2014-09-08 20:13:36 -070048 *
49 * @param topology topology descriptor
50 * @param src source device
51 * @param dst destination device
52 * @return set of all shortest paths between the two devices
53 */
54 Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst);
55
56 /**
57 * Returns the set of all shortest paths, computed using the supplied
58 * edge-weight entity, between the specified source and destination devices.
59 *
60 * @param topology topology descriptor
61 * @param src source device
62 * @param dst destination device
63 * @return set of all shortest paths between the two devices
64 */
65 Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst,
66 LinkWeight weight);
67
68 /**
69 * Indicates whether the specified connection point is part of the network
70 * infrastructure or part of network edge.
71 *
72 * @param topology topology descriptor
73 * @param connectPoint connection point
74 * @return true of connection point is in infrastructure; false if edge
75 */
76 boolean isInfrastructure(Topology topology, ConnectPoint connectPoint);
77
78
79 /**
tomcfde0622014-09-09 11:02:42 -070080 * Indicates whether the specified connection point belong to the
81 * broadcast tree.
tom568581d2014-09-08 20:13:36 -070082 *
83 * @param topology topology descriptor
84 * @param connectPoint connection point
85 * @return true if broadcast is permissible
86 */
87 boolean isInBroadcastTree(Topology topology, ConnectPoint connectPoint);
tomedf06bb2014-08-27 16:22:15 -070088
89 /**
90 * Adds the specified topology listener.
91 *
92 * @param listener topology listener
93 */
94 void addListener(TopologyListener listener);
95
96 /**
97 * Removes the specified topology listener.
98 *
99 * @param listener topology listener
100 */
101 void removeListener(TopologyListener listener);
102
103}