tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.topology; |
| 2 | |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 3 | import org.onlab.graph.Graph; |
| 4 | import org.onlab.onos.net.ConnectPoint; |
| 5 | import org.onlab.onos.net.DeviceId; |
| 6 | import org.onlab.onos.net.Path; |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 7 | |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 8 | import java.util.Set; |
| 9 | |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 10 | /** |
| 11 | * Service for providing network topology information. |
| 12 | */ |
| 13 | public interface TopologyService { |
| 14 | |
| 15 | /** |
| 16 | * Returns the current topology descriptor. |
| 17 | * |
| 18 | * @return current topology |
| 19 | */ |
| 20 | Topology currentTopology(); |
| 21 | |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 22 | /** |
| 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 | /** |
tom | cfde062 | 2014-09-09 11:02:42 -0700 | [diff] [blame] | 39 | * Returns the set of all shortest paths, precomputed in terms of hop-count, |
| 40 | * between the specified source and destination devices. |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 41 | * |
| 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 | /** |
tom | cfde062 | 2014-09-09 11:02:42 -0700 | [diff] [blame] | 73 | * Indicates whether the specified connection point belong to the |
| 74 | * broadcast tree. |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 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); |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 81 | |
| 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 | } |