Package org.onosproject.common
Class DefaultTopology
- java.lang.Object
- 
- org.onosproject.net.AbstractAnnotated
- 
- org.onosproject.net.AbstractModel
- 
- org.onosproject.common.DefaultTopology
 
 
 
- 
 public class DefaultTopology extends AbstractModel implements Topology Default implementation of the topology descriptor. This carries the backing topology data.
- 
- 
Constructor SummaryConstructors Constructor Description DefaultTopology(ProviderId providerId, GraphDescription description)Creates a topology descriptor attributed to the specified provider.DefaultTopology(ProviderId providerId, GraphDescription description, com.google.common.base.Function<ConnectPoint,Boolean> broadcastFunction)Creates a topology descriptor attributed to the specified provider.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<ConnectPoint>broadcastPoints(ClusterId clusterId)Returns the set of the cluster broadcast points.intbroadcastSetSize(ClusterId clusterId)Returns the size of the cluster broadcast set.intclusterCount()Returns the number of SCCs (strongly connected components) in the topology.longcomputeCost()Returns the time, specified in system nanos of how long the topology took to compute.longcreationTime()Returns the time, specified in system millis of when the topology became available.intdeviceCount()Returns the number of infrastructure devices in the topology.TopologyClustergetCluster(DeviceId deviceId)Returns the topology cluster that contains the given device.TopologyClustergetCluster(ClusterId clusterId)Returns the specified topology cluster.Set<DeviceId>getClusterDevices(TopologyCluster cluster)Returns the set of cluster devices.Set<Link>getClusterLinks(TopologyCluster cluster)Returns the set of cluster links.Set<TopologyCluster>getClusters()Returns the set of topology clusters.Set<DisjointPath>getDisjointPaths(DeviceId src, DeviceId dst)Returns the set of pre-computed shortest disjoint path pairs between source and destination devices.Set<DisjointPath>getDisjointPaths(DeviceId src, DeviceId dst, Map<Link,Object> riskProfile)Computes on-demand the set of shortest disjoint risk groups path pairs between source and destination devices.Set<DisjointPath>getDisjointPaths(DeviceId src, DeviceId dst, LinkWeigher weigher)Computes on-demand the set of shortest disjoint path pairs between source and destination devices.Set<DisjointPath>getDisjointPaths(DeviceId src, DeviceId dst, LinkWeigher weigher, Map<Link,Object> riskProfile)Computes on-demand the set of shortest disjoint risk groups path pairs between source and destination devices.TopologyGraphgetGraph()Returns the backing topology graph.Stream<Path>getKShortestPaths(DeviceId src, DeviceId dst)Lazily computes on-demand the k-shortest paths between source and destination devices.Set<Path>getKShortestPaths(DeviceId src, DeviceId dst, int maxPaths)Computes on-demand the k-shortest paths between source and destination devices.Stream<Path>getKShortestPaths(DeviceId src, DeviceId dst, LinkWeigher weigher)Lazily computes on-demand the k-shortest paths between source and destination devices.Set<Path>getKShortestPaths(DeviceId src, DeviceId dst, LinkWeigher weigher, int maxPaths)Computes on-demand the k-shortest paths between source and destination devices.Set<Path>getPaths(DeviceId src, DeviceId dst)Returns the set of pre-computed shortest paths between source and destination devices.Set<Path>getPaths(DeviceId src, DeviceId dst, LinkWeigher weigher)Computes on-demand the set of shortest paths between source and destination devices.Set<Path>getPaths(DeviceId src, DeviceId dst, LinkWeigher weigher, int maxPaths)Computes on-demand the set of shortest paths between source and destination devices, the set of returned paths will be no more than, maxPaths in size.booleanisBroadcastPoint(ConnectPoint connectPoint)Indicates whether the given point is part of a broadcast set.booleanisInfrastructure(ConnectPoint connectPoint)Indicates whether the given point is an infrastructure link end-point.intlinkCount()Returns the number of infrastructure links in the topology.static voidsetDefaultGraphPathSearch(GraphPathSearch<TopologyVertex,TopologyEdge> graphPathSearch)Sets the default lpath search algorighm to be used when computing paths.static voidsetDefaultLinkWeigher(LinkWeigher linkWeigher)Sets the default link-weight to be used when computing paths.static voidsetDefaultMaxPaths(int maxPaths)Sets the default maximum path count to be used when computing paths.longtime()Returns the time, specified in system nanos of when the topology became available.StringtoString()- 
Methods inherited from class org.onosproject.net.AbstractModelproviderId
 - 
Methods inherited from class org.onosproject.net.AbstractAnnotatedannotations
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface org.onosproject.net.ProvidedproviderId
 
- 
 
- 
- 
- 
Constructor Detail- 
DefaultTopologypublic DefaultTopology(ProviderId providerId, GraphDescription description, com.google.common.base.Function<ConnectPoint,Boolean> broadcastFunction) Creates a topology descriptor attributed to the specified provider.- Parameters:
- providerId- identity of the provider
- description- data describing the new topology
- broadcastFunction- broadcast point function
 
 - 
DefaultTopologypublic DefaultTopology(ProviderId providerId, GraphDescription description) Creates a topology descriptor attributed to the specified provider.- Parameters:
- providerId- identity of the provider
- description- data describing the new topology
 
 
- 
 - 
Method Detail- 
setDefaultMaxPathspublic static void setDefaultMaxPaths(int maxPaths) Sets the default maximum path count to be used when computing paths. If -1 is specified, the builtin defaultALL_PATHS, signifying that all available paths should be returned is used.- Parameters:
- maxPaths- new default max path count
 
 - 
setDefaultLinkWeigherpublic static void setDefaultLinkWeigher(LinkWeigher linkWeigher) Sets the default link-weight to be used when computing paths. If null is specified, the builtin default link-weight measuring hop-counts will be used.- Parameters:
- linkWeigher- new default link-weight
 
 - 
setDefaultGraphPathSearchpublic static void setDefaultGraphPathSearch(GraphPathSearch<TopologyVertex,TopologyEdge> graphPathSearch) Sets the default lpath search algorighm to be used when computing paths. If null is specified, the builtin default Dijkstra will be used.- Parameters:
- graphPathSearch- new default algorithm
 
 - 
timepublic long time() Description copied from interface:TopologyReturns the time, specified in system nanos of when the topology became available.
 - 
creationTimepublic long creationTime() Description copied from interface:TopologyReturns the time, specified in system millis of when the topology became available.- Specified by:
- creationTimein interface- Topology
- Returns:
- time in system nanos
 
 - 
computeCostpublic long computeCost() Description copied from interface:TopologyReturns the time, specified in system nanos of how long the topology took to compute.- Specified by:
- computeCostin interface- Topology
- Returns:
- elapsed time in system nanos
 
 - 
clusterCountpublic int clusterCount() Description copied from interface:TopologyReturns the number of SCCs (strongly connected components) in the topology.- Specified by:
- clusterCountin interface- Topology
- Returns:
- number of clusters
 
 - 
deviceCountpublic int deviceCount() Description copied from interface:TopologyReturns the number of infrastructure devices in the topology.- Specified by:
- deviceCountin interface- Topology
- Returns:
- number of devices
 
 - 
linkCountpublic int linkCount() Description copied from interface:TopologyReturns the number of infrastructure links in the topology.
 - 
getGraphpublic TopologyGraph getGraph() Returns the backing topology graph.- Returns:
- topology graph
 
 - 
getClusterspublic Set<TopologyCluster> getClusters() Returns the set of topology clusters.- Returns:
- set of clusters
 
 - 
getClusterpublic TopologyCluster getCluster(ClusterId clusterId) Returns the specified topology cluster.- Parameters:
- clusterId- cluster identifier
- Returns:
- topology cluster
 
 - 
getClusterpublic TopologyCluster getCluster(DeviceId deviceId) Returns the topology cluster that contains the given device.- Parameters:
- deviceId- device identifier
- Returns:
- topology cluster
 
 - 
getClusterDevicespublic Set<DeviceId> getClusterDevices(TopologyCluster cluster) Returns the set of cluster devices.- Parameters:
- cluster- topology cluster
- Returns:
- cluster devices
 
 - 
getClusterLinkspublic Set<Link> getClusterLinks(TopologyCluster cluster) Returns the set of cluster links.- Parameters:
- cluster- topology cluster
- Returns:
- cluster links
 
 - 
isInfrastructurepublic boolean isInfrastructure(ConnectPoint connectPoint) Indicates whether the given point is an infrastructure link end-point.- Parameters:
- connectPoint- connection point
- Returns:
- true if infrastructure
 
 - 
isBroadcastPointpublic boolean isBroadcastPoint(ConnectPoint connectPoint) Indicates whether the given point is part of a broadcast set.- Parameters:
- connectPoint- connection point
- Returns:
- true if in broadcast set
 
 - 
broadcastSetSizepublic int broadcastSetSize(ClusterId clusterId) Returns the size of the cluster broadcast set.- Parameters:
- clusterId- cluster identifier
- Returns:
- size of the cluster broadcast set
 
 - 
broadcastPointspublic Set<ConnectPoint> broadcastPoints(ClusterId clusterId) Returns the set of the cluster broadcast points.- Parameters:
- clusterId- cluster identifier
- Returns:
- set of cluster broadcast points
 
 - 
getPathspublic Set<Path> getPaths(DeviceId src, DeviceId dst) Returns the set of pre-computed shortest paths between source and destination devices.- Parameters:
- src- source device
- dst- destination device
- Returns:
- set of shortest paths
 
 - 
getPathspublic Set<Path> getPaths(DeviceId src, DeviceId dst, LinkWeigher weigher) Computes on-demand the set of shortest paths between source and destination devices.- Parameters:
- src- source device
- dst- destination device
- weigher- link weight function
- Returns:
- set of shortest paths
 
 - 
getPathspublic Set<Path> getPaths(DeviceId src, DeviceId dst, LinkWeigher weigher, int maxPaths) Computes on-demand the set of shortest paths between source and destination devices, the set of returned paths will be no more than, maxPaths in size. The firstmaxPathspaths will be returned maintaining any ordering guarantees provided by the underlying (default or if no default is specifiedDijkstraGraphSearch) search. If returning all paths of a given length would exceedmaxPathsa subset of paths of that length will be returned, which paths will be returned depends on the currently specifiedGraphPathSearch. SeesetDefaultGraphPathSearch(org.onlab.graph.GraphPathSearch<org.onosproject.net.topology.TopologyVertex, org.onosproject.net.topology.TopologyEdge>).- Parameters:
- src- source device
- dst- destination device
- weigher- link weight function
- maxPaths- maximum number of paths
- Returns:
- set of shortest paths
 
 - 
getKShortestPathspublic Set<Path> getKShortestPaths(DeviceId src, DeviceId dst, int maxPaths) Computes on-demand the k-shortest paths between source and destination devices.- Parameters:
- src- source device
- dst- destination device
- maxPaths- maximum number of paths (k)
- Returns:
- set of k-shortest paths
 
 - 
getKShortestPathspublic Set<Path> getKShortestPaths(DeviceId src, DeviceId dst, LinkWeigher weigher, int maxPaths) Computes on-demand the k-shortest paths between source and destination devices.The first maxPathspaths will be returned in ascending order according to the providedweigher- Parameters:
- src- source device
- dst- destination device
- weigher- link weight function
- maxPaths- maximum number of paths (k)
- Returns:
- set of k-shortest paths
 
 - 
getKShortestPathspublic Stream<Path> getKShortestPaths(DeviceId src, DeviceId dst) Lazily computes on-demand the k-shortest paths between source and destination devices.- Parameters:
- src- source device
- dst- destination device
- Returns:
- stream of k-shortest paths
 
 - 
getKShortestPathspublic Stream<Path> getKShortestPaths(DeviceId src, DeviceId dst, LinkWeigher weigher) Lazily computes on-demand the k-shortest paths between source and destination devices.- Parameters:
- src- source device
- dst- destination device
- weigher- link weight function
- Returns:
- stream of k-shortest paths
 
 - 
getDisjointPathspublic Set<DisjointPath> getDisjointPaths(DeviceId src, DeviceId dst) Returns the set of pre-computed shortest disjoint path pairs between source and destination devices.- Parameters:
- src- source device
- dst- destination device
- Returns:
- set of shortest disjoint path pairs
 
 - 
getDisjointPathspublic Set<DisjointPath> getDisjointPaths(DeviceId src, DeviceId dst, LinkWeigher weigher) Computes on-demand the set of shortest disjoint path pairs between source and destination devices.- Parameters:
- src- source device
- dst- destination device
- weigher- link weight function
- Returns:
- set of disjoint shortest path pairs
 
 - 
getDisjointPathspublic Set<DisjointPath> getDisjointPaths(DeviceId src, DeviceId dst, LinkWeigher weigher, Map<Link,Object> riskProfile) Computes on-demand the set of shortest disjoint risk groups path pairs between source and destination devices.- Parameters:
- src- source device
- dst- destination device
- weigher- edge weight object
- riskProfile- map representing risk groups for each link
- Returns:
- set of shortest disjoint paths
 
 - 
getDisjointPathspublic Set<DisjointPath> getDisjointPaths(DeviceId src, DeviceId dst, Map<Link,Object> riskProfile) Computes on-demand the set of shortest disjoint risk groups path pairs between source and destination devices.- Parameters:
- src- source device
- dst- destination device
- riskProfile- map representing risk groups for each link
- Returns:
- set of shortest disjoint paths
 
 
- 
 
-