Package org.onosproject.net.topology
Interface TopologyService
-
- All Superinterfaces:
ListenerService<TopologyEvent,TopologyListener>
public interface TopologyService extends ListenerService<TopologyEvent,TopologyListener>
Service for providing network topology information.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description Topology
currentTopology()
Returns the current topology descriptor.TopologyCluster
getCluster(Topology topology, ClusterId clusterId)
Returns the cluster with the specified ID.java.util.Set<DeviceId>
getClusterDevices(Topology topology, TopologyCluster cluster)
Returns the set of devices that belong to the specified cluster.java.util.Set<Link>
getClusterLinks(Topology topology, TopologyCluster cluster)
Returns the set of links that form the specified cluster.java.util.Set<TopologyCluster>
getClusters(Topology topology)
Returns the set of clusters in the specified topology.java.util.Set<DisjointPath>
getDisjointPaths(Topology topology, DeviceId src, DeviceId dst)
Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count, between the specified source and destination devices.java.util.Set<DisjointPath>
getDisjointPaths(Topology topology, DeviceId src, DeviceId dst, java.util.Map<Link,java.lang.Object> riskProfile)
Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count, between the specified source and destination devices.java.util.Set<DisjointPath>
getDisjointPaths(Topology topology, DeviceId src, DeviceId dst, LinkWeigher weigher)
Returns the set of all disjoint shortest path pairs, computed using the supplied edge-weight entity, between the specified source and destination devices.java.util.Set<DisjointPath>
getDisjointPaths(Topology topology, DeviceId src, DeviceId dst, LinkWeigher weigher, java.util.Map<Link,java.lang.Object> riskProfile)
Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count, between the specified source and destination devices.TopologyGraph
getGraph(Topology topology)
Returns the graph view of the specified topology.default java.util.stream.Stream<Path>
getKShortestPaths(Topology topology, DeviceId src, DeviceId dst)
Returns the k-shortest paths between source and destination devices.default java.util.stream.Stream<Path>
getKShortestPaths(Topology topology, DeviceId src, DeviceId dst, LinkWeigher weigher)
Returns the k-shortest paths between source and destination devices.default java.util.Set<Path>
getKShortestPaths(Topology topology, DeviceId src, DeviceId dst, LinkWeigher weigher, int maxPaths)
Returns the k-shortest paths between source and destination devices.java.util.Set<Path>
getPaths(Topology topology, DeviceId src, DeviceId dst)
Returns the set of all shortest paths, precomputed in terms of hop-count, between the specified source and destination devices.java.util.Set<Path>
getPaths(Topology topology, DeviceId src, DeviceId dst, LinkWeigher weigher)
Returns the set of all shortest paths, computed using the supplied edge-weight entity, between the specified source and destination devices.boolean
isBroadcastPoint(Topology topology, ConnectPoint connectPoint)
Indicates whether broadcast is allowed for traffic received on the specified connection point.boolean
isInfrastructure(Topology topology, ConnectPoint connectPoint)
Indicates whether the specified connection point is part of the network infrastructure or part of network edge.boolean
isLatest(Topology topology)
Indicates whether the specified topology is the latest or not.-
Methods inherited from interface org.onosproject.event.ListenerService
addListener, removeListener
-
-
-
-
Method Detail
-
currentTopology
Topology currentTopology()
Returns the current topology descriptor.- Returns:
- current topology
-
isLatest
boolean isLatest(Topology topology)
Indicates whether the specified topology is the latest or not.- Parameters:
topology
- topology descriptor- Returns:
- true if the topology is the most recent; false otherwise
-
getGraph
TopologyGraph getGraph(Topology topology)
Returns the graph view of the specified topology.- Parameters:
topology
- topology descriptor- Returns:
- topology graph view
-
getClusters
java.util.Set<TopologyCluster> getClusters(Topology topology)
Returns the set of clusters in the specified topology.- Parameters:
topology
- topology descriptor- Returns:
- set of topology clusters
-
getCluster
TopologyCluster getCluster(Topology topology, ClusterId clusterId)
Returns the cluster with the specified ID.- Parameters:
topology
- topology descriptorclusterId
- cluster identifier- Returns:
- topology cluster
-
getClusterDevices
java.util.Set<DeviceId> getClusterDevices(Topology topology, TopologyCluster cluster)
Returns the set of devices that belong to the specified cluster.- Parameters:
topology
- topology descriptorcluster
- topology cluster- Returns:
- set of cluster devices
-
getClusterLinks
java.util.Set<Link> getClusterLinks(Topology topology, TopologyCluster cluster)
Returns the set of links that form the specified cluster.- Parameters:
topology
- topology descriptorcluster
- topology cluster- Returns:
- set of cluster links
-
getPaths
java.util.Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst)
Returns the set of all shortest paths, precomputed in terms of hop-count, between the specified source and destination devices.- Parameters:
topology
- topology descriptorsrc
- source devicedst
- destination device- Returns:
- set of all shortest paths between the two devices
-
getPaths
java.util.Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst, LinkWeigher weigher)
Returns the set of all shortest paths, computed using the supplied edge-weight entity, between the specified source and destination devices.- Parameters:
topology
- topology descriptorsrc
- source devicedst
- destination deviceweigher
- edge-weight entity- Returns:
- set of all shortest paths between the two devices
-
getKShortestPaths
default java.util.Set<Path> getKShortestPaths(Topology topology, DeviceId src, DeviceId dst, LinkWeigher weigher, int maxPaths)
Returns the k-shortest paths between source and destination devices. The firstmaxPaths
paths will be returned in ascending order according to the providedweigher
- Parameters:
topology
- topology descriptorsrc
- source devicedst
- destination deviceweigher
- edge-weight entitymaxPaths
- maximum number of paths (k)- Returns:
- set of k-shortest paths
-
getKShortestPaths
default java.util.stream.Stream<Path> getKShortestPaths(Topology topology, DeviceId src, DeviceId dst)
Returns the k-shortest paths between source and destination devices.- Parameters:
topology
- topology descriptorsrc
- source devicedst
- destination device- Returns:
- stream of k-shortest paths
-
getKShortestPaths
default java.util.stream.Stream<Path> getKShortestPaths(Topology topology, DeviceId src, DeviceId dst, LinkWeigher weigher)
Returns the k-shortest paths between source and destination devices.- Parameters:
topology
- topology descriptorsrc
- source devicedst
- destination deviceweigher
- edge-weight entity- Returns:
- stream of k-shortest paths
-
getDisjointPaths
java.util.Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst)
Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count, between the specified source and destination devices.- Parameters:
topology
- topology descriptorsrc
- source devicedst
- destination device- Returns:
- set of all shortest paths between the two devices
-
getDisjointPaths
java.util.Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst, LinkWeigher weigher)
Returns the set of all disjoint shortest path pairs, computed using the supplied edge-weight entity, between the specified source and destination devices.- Parameters:
topology
- topology descriptorsrc
- source devicedst
- destination deviceweigher
- edge-weight entity- Returns:
- set of all shortest paths between the two devices
-
getDisjointPaths
java.util.Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst, java.util.Map<Link,java.lang.Object> riskProfile)
Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count, between the specified source and destination devices.- Parameters:
topology
- topology descriptorsrc
- source devicedst
- destination deviceriskProfile
- map of edges to risk profiles- Returns:
- set of all shortest paths between the two devices
-
getDisjointPaths
java.util.Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst, LinkWeigher weigher, java.util.Map<Link,java.lang.Object> riskProfile)
Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count, between the specified source and destination devices.- Parameters:
topology
- topology descriptorsrc
- source devicedst
- destination deviceweigher
- edge-weight entityriskProfile
- map of edges to risk profiles- Returns:
- set of all shortest paths between the two devices
-
isInfrastructure
boolean isInfrastructure(Topology topology, ConnectPoint connectPoint)
Indicates whether the specified connection point is part of the network infrastructure or part of network edge.- Parameters:
topology
- topology descriptorconnectPoint
- connection point- Returns:
- true of connection point is in infrastructure; false if edge
-
isBroadcastPoint
boolean isBroadcastPoint(Topology topology, ConnectPoint connectPoint)
Indicates whether broadcast is allowed for traffic received on the specified connection point.- Parameters:
topology
- topology descriptorconnectPoint
- connection point- Returns:
- true if broadcast is permissible
-
-