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