Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2014-present Open Networking Laboratory |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.net.topology; |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 17 | |
Thomas Vachuska | 42e8cce | 2015-07-29 19:25:18 -0700 | [diff] [blame] | 18 | import org.onosproject.event.ListenerService; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 19 | import org.onosproject.net.ConnectPoint; |
| 20 | import org.onosproject.net.DeviceId; |
Nikhil Cheerla | 2ec191f | 2015-07-09 12:34:54 -0700 | [diff] [blame] | 21 | import org.onosproject.net.DisjointPath; |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 22 | import org.onosproject.net.Link; |
| 23 | import org.onosproject.net.Path; |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 24 | |
Nikhil Cheerla | 2ec191f | 2015-07-09 12:34:54 -0700 | [diff] [blame] | 25 | import java.util.Map; |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 26 | import java.util.Set; |
| 27 | |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 28 | /** |
| 29 | * Service for providing network topology information. |
| 30 | */ |
Thomas Vachuska | 42e8cce | 2015-07-29 19:25:18 -0700 | [diff] [blame] | 31 | public interface TopologyService |
Thomas Vachuska | 48e64e4 | 2015-09-22 15:32:55 -0700 | [diff] [blame] | 32 | extends ListenerService<TopologyEvent, TopologyListener> { |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 33 | |
| 34 | /** |
| 35 | * Returns the current topology descriptor. |
| 36 | * |
| 37 | * @return current topology |
| 38 | */ |
| 39 | Topology currentTopology(); |
| 40 | |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 41 | /** |
tom | dc361b6 | 2014-09-09 20:36:52 -0700 | [diff] [blame] | 42 | * Indicates whether the specified topology is the latest or not. |
tom | e52ce70 | 2014-09-11 00:12:54 -0700 | [diff] [blame] | 43 | * |
tom | dc361b6 | 2014-09-09 20:36:52 -0700 | [diff] [blame] | 44 | * @param topology topology descriptor |
| 45 | * @return true if the topology is the most recent; false otherwise |
| 46 | */ |
| 47 | boolean isLatest(Topology topology); |
| 48 | |
| 49 | /** |
tom | 13cb485 | 2014-09-11 12:44:17 -0700 | [diff] [blame] | 50 | * Returns the graph view of the specified topology. |
| 51 | * |
| 52 | * @param topology topology descriptor |
| 53 | * @return topology graph view |
| 54 | */ |
| 55 | TopologyGraph getGraph(Topology topology); |
| 56 | |
| 57 | /** |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 58 | * Returns the set of clusters in the specified topology. |
| 59 | * |
| 60 | * @param topology topology descriptor |
| 61 | * @return set of topology clusters |
| 62 | */ |
| 63 | Set<TopologyCluster> getClusters(Topology topology); |
| 64 | |
| 65 | /** |
tom | 13cb485 | 2014-09-11 12:44:17 -0700 | [diff] [blame] | 66 | * Returns the cluster with the specified ID. |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 67 | * |
tom | 13cb485 | 2014-09-11 12:44:17 -0700 | [diff] [blame] | 68 | * @param topology topology descriptor |
| 69 | * @param clusterId cluster identifier |
| 70 | * @return topology cluster |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 71 | */ |
tom | 13cb485 | 2014-09-11 12:44:17 -0700 | [diff] [blame] | 72 | TopologyCluster getCluster(Topology topology, ClusterId clusterId); |
| 73 | |
| 74 | /** |
| 75 | * Returns the set of devices that belong to the specified cluster. |
| 76 | * |
Thomas Vachuska | 48e64e4 | 2015-09-22 15:32:55 -0700 | [diff] [blame] | 77 | * @param topology topology descriptor |
| 78 | * @param cluster topology cluster |
tom | 13cb485 | 2014-09-11 12:44:17 -0700 | [diff] [blame] | 79 | * @return set of cluster devices |
| 80 | */ |
| 81 | Set<DeviceId> getClusterDevices(Topology topology, TopologyCluster cluster); |
| 82 | |
| 83 | /** |
| 84 | * Returns the set of links that form the specified cluster. |
| 85 | * |
Thomas Vachuska | 48e64e4 | 2015-09-22 15:32:55 -0700 | [diff] [blame] | 86 | * @param topology topology descriptor |
| 87 | * @param cluster topology cluster |
tom | 13cb485 | 2014-09-11 12:44:17 -0700 | [diff] [blame] | 88 | * @return set of cluster links |
| 89 | */ |
| 90 | Set<Link> getClusterLinks(Topology topology, TopologyCluster cluster); |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 91 | |
| 92 | /** |
tom | cfde062 | 2014-09-09 11:02:42 -0700 | [diff] [blame] | 93 | * Returns the set of all shortest paths, precomputed in terms of hop-count, |
| 94 | * between the specified source and destination devices. |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 95 | * |
| 96 | * @param topology topology descriptor |
| 97 | * @param src source device |
| 98 | * @param dst destination device |
| 99 | * @return set of all shortest paths between the two devices |
| 100 | */ |
| 101 | Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst); |
| 102 | |
| 103 | /** |
| 104 | * Returns the set of all shortest paths, computed using the supplied |
| 105 | * edge-weight entity, between the specified source and destination devices. |
| 106 | * |
| 107 | * @param topology topology descriptor |
| 108 | * @param src source device |
| 109 | * @param dst destination device |
Yuta HIGUCHI | 5c94727 | 2014-11-03 21:39:21 -0800 | [diff] [blame] | 110 | * @param weight edge-weight entity |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 111 | * @return set of all shortest paths between the two devices |
| 112 | */ |
| 113 | Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst, |
| 114 | LinkWeight weight); |
| 115 | |
| 116 | /** |
Nikhil Cheerla | 2ec191f | 2015-07-09 12:34:54 -0700 | [diff] [blame] | 117 | * Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count, |
| 118 | * between the specified source and destination devices. |
| 119 | * |
| 120 | * @param topology topology descriptor |
| 121 | * @param src source device |
| 122 | * @param dst destination device |
| 123 | * @return set of all shortest paths between the two devices |
| 124 | */ |
| 125 | Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst); |
| 126 | |
| 127 | /** |
| 128 | * Returns the set of all disjoint shortest path pairs, computed using the supplied |
| 129 | * edge-weight entity, between the specified source and destination devices. |
| 130 | * |
| 131 | * @param topology topology descriptor |
| 132 | * @param src source device |
| 133 | * @param dst destination device |
| 134 | * @param weight edge-weight entity |
| 135 | * @return set of all shortest paths between the two devices |
| 136 | */ |
| 137 | Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst, |
| 138 | LinkWeight weight); |
| 139 | |
| 140 | /** |
| 141 | * Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count, |
| 142 | * between the specified source and destination devices. |
| 143 | * |
Thomas Vachuska | 48e64e4 | 2015-09-22 15:32:55 -0700 | [diff] [blame] | 144 | * @param topology topology descriptor |
| 145 | * @param src source device |
| 146 | * @param dst destination device |
Nikhil Cheerla | 2ec191f | 2015-07-09 12:34:54 -0700 | [diff] [blame] | 147 | * @param riskProfile map of edges to risk profiles |
| 148 | * @return set of all shortest paths between the two devices |
| 149 | */ |
Thomas Vachuska | 48e64e4 | 2015-09-22 15:32:55 -0700 | [diff] [blame] | 150 | Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst, |
| 151 | Map<Link, Object> riskProfile); |
Nikhil Cheerla | 2ec191f | 2015-07-09 12:34:54 -0700 | [diff] [blame] | 152 | |
| 153 | /** |
| 154 | * Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count, |
| 155 | * between the specified source and destination devices. |
| 156 | * |
Thomas Vachuska | 48e64e4 | 2015-09-22 15:32:55 -0700 | [diff] [blame] | 157 | * @param topology topology descriptor |
| 158 | * @param src source device |
| 159 | * @param dst destination device |
| 160 | * @param weight edge-weight entity |
Nikhil Cheerla | 2ec191f | 2015-07-09 12:34:54 -0700 | [diff] [blame] | 161 | * @param riskProfile map of edges to risk profiles |
| 162 | * @return set of all shortest paths between the two devices |
| 163 | */ |
Thomas Vachuska | 48e64e4 | 2015-09-22 15:32:55 -0700 | [diff] [blame] | 164 | Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst, |
| 165 | LinkWeight weight, Map<Link, Object> riskProfile); |
| 166 | |
Nikhil Cheerla | 2ec191f | 2015-07-09 12:34:54 -0700 | [diff] [blame] | 167 | /** |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 168 | * Indicates whether the specified connection point is part of the network |
| 169 | * infrastructure or part of network edge. |
| 170 | * |
| 171 | * @param topology topology descriptor |
| 172 | * @param connectPoint connection point |
| 173 | * @return true of connection point is in infrastructure; false if edge |
| 174 | */ |
| 175 | boolean isInfrastructure(Topology topology, ConnectPoint connectPoint); |
| 176 | |
| 177 | |
| 178 | /** |
tom | 4d0dd3a | 2014-09-14 23:12:28 -0700 | [diff] [blame] | 179 | * Indicates whether broadcast is allowed for traffic received on the |
| 180 | * specified connection point. |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 181 | * |
| 182 | * @param topology topology descriptor |
| 183 | * @param connectPoint connection point |
| 184 | * @return true if broadcast is permissible |
| 185 | */ |
tom | 4d0dd3a | 2014-09-14 23:12:28 -0700 | [diff] [blame] | 186 | boolean isBroadcastPoint(Topology topology, ConnectPoint connectPoint); |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 187 | |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 188 | } |