blob: d8470e76c4e691084f2eaadfc495607edcc89070 [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.onos.net.ConnectPoint;
4import org.onlab.onos.net.DeviceId;
5import org.onlab.onos.net.Path;
tomedf06bb2014-08-27 16:22:15 -07006
tom568581d2014-09-08 20:13:36 -07007import java.util.Set;
8
tomedf06bb2014-08-27 16:22:15 -07009/**
10 * Service for providing network topology information.
11 */
12public interface TopologyService {
13
14 /**
15 * Returns the current topology descriptor.
16 *
17 * @return current topology
18 */
19 Topology currentTopology();
20
tom568581d2014-09-08 20:13:36 -070021 /**
tomdc361b62014-09-09 20:36:52 -070022 * Indicates whether the specified topology is the latest or not.
tome52ce702014-09-11 00:12:54 -070023 *
tomdc361b62014-09-09 20:36:52 -070024 * @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 */
tom97937552014-09-11 10:48:42 -070043 TopologyGraph getGraph(Topology topology);
tom568581d2014-09-08 20:13:36 -070044
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}