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 | /** |
tom | dc361b6 | 2014-09-09 20:36:52 -0700 | [diff] [blame] | 23 | * Indicates whether the specified topology is the latest or not. |
tom | e52ce70 | 2014-09-11 00:12:54 -0700 | [diff] [blame^] | 24 | * |
tom | dc361b6 | 2014-09-09 20:36:52 -0700 | [diff] [blame] | 25 | * @param topology topology descriptor |
| 26 | * @return true if the topology is the most recent; false otherwise |
| 27 | */ |
| 28 | boolean isLatest(Topology topology); |
| 29 | |
| 30 | /** |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 31 | * 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 | /** |
tom | cfde062 | 2014-09-09 11:02:42 -0700 | [diff] [blame] | 47 | * Returns the set of all shortest paths, precomputed in terms of hop-count, |
| 48 | * between the specified source and destination devices. |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 49 | * |
| 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 | /** |
tom | cfde062 | 2014-09-09 11:02:42 -0700 | [diff] [blame] | 81 | * Indicates whether the specified connection point belong to the |
| 82 | * broadcast tree. |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 83 | * |
| 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); |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 89 | |
| 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 | } |