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 | import org.onlab.onos.net.Topology; |
| 8 | |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame^] | 9 | import java.util.Set; |
| 10 | |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 11 | /** |
| 12 | * Service for providing network topology information. |
| 13 | */ |
| 14 | public interface TopologyService { |
| 15 | |
| 16 | /** |
| 17 | * Returns the current topology descriptor. |
| 18 | * |
| 19 | * @return current topology |
| 20 | */ |
| 21 | Topology currentTopology(); |
| 22 | |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame^] | 23 | /** |
| 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); |
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 | } |