blob: a6962a25022fb7322d31f486c7c15e2c9df7eae2 [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 -07007import org.onlab.onos.net.Topology;
8
tom568581d2014-09-08 20:13:36 -07009import java.util.Set;
10
tomedf06bb2014-08-27 16:22:15 -070011/**
12 * Service for providing network topology information.
13 */
14public interface TopologyService {
15
16 /**
17 * Returns the current topology descriptor.
18 *
19 * @return current topology
20 */
21 Topology currentTopology();
22
tom568581d2014-09-08 20:13:36 -070023 /**
24 * Returns the set of clusters in the specified topology.
25 *
26 * @param topology topology descriptor
27 * @return set of topology clusters
28 */
29 Set<TopologyCluster> getClusters(Topology topology);
30
31 /**
32 * Returns the graph view of the specified topology.
33 *
34 * @param topology topology descriptor
35 * @return topology graph view
36 */
37 Graph<TopoVertex, TopoEdge> getGraph(Topology topology);
38
39 /**
40 * Returns the set of all shortest paths, in terms of hop-count, between
41 * the specified source and destination devices.
42 *
43 * @param topology topology descriptor
44 * @param src source device
45 * @param dst destination device
46 * @return set of all shortest paths between the two devices
47 */
48 Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst);
49
50 /**
51 * Returns the set of all shortest paths, computed using the supplied
52 * edge-weight entity, between the specified source and destination devices.
53 *
54 * @param topology topology descriptor
55 * @param src source device
56 * @param dst destination device
57 * @return set of all shortest paths between the two devices
58 */
59 Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst,
60 LinkWeight weight);
61
62 /**
63 * Indicates whether the specified connection point is part of the network
64 * infrastructure or part of network edge.
65 *
66 * @param topology topology descriptor
67 * @param connectPoint connection point
68 * @return true of connection point is in infrastructure; false if edge
69 */
70 boolean isInfrastructure(Topology topology, ConnectPoint connectPoint);
71
72
73 /**
74 * Indicates whether the specified connection point allows broadcast.
75 *
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}