blob: 13d18425aa93bcafb246b7ca147f7cabfdf9faa4 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2014-present Open Networking Laboratory
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07003 *
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'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net.topology;
tomedf06bb2014-08-27 16:22:15 -070017
Thomas Vachuska42e8cce2015-07-29 19:25:18 -070018import org.onosproject.event.ListenerService;
Brian O'Connorabafb502014-12-02 22:26:20 -080019import org.onosproject.net.ConnectPoint;
20import org.onosproject.net.DeviceId;
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -070021import org.onosproject.net.DisjointPath;
Brian O'Connorabafb502014-12-02 22:26:20 -080022import org.onosproject.net.Link;
23import org.onosproject.net.Path;
tomedf06bb2014-08-27 16:22:15 -070024
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -070025import java.util.Map;
tom568581d2014-09-08 20:13:36 -070026import java.util.Set;
27
tomedf06bb2014-08-27 16:22:15 -070028/**
29 * Service for providing network topology information.
30 */
Thomas Vachuska42e8cce2015-07-29 19:25:18 -070031public interface TopologyService
Thomas Vachuska48e64e42015-09-22 15:32:55 -070032 extends ListenerService<TopologyEvent, TopologyListener> {
tomedf06bb2014-08-27 16:22:15 -070033
34 /**
35 * Returns the current topology descriptor.
36 *
37 * @return current topology
38 */
39 Topology currentTopology();
40
tom568581d2014-09-08 20:13:36 -070041 /**
tomdc361b62014-09-09 20:36:52 -070042 * Indicates whether the specified topology is the latest or not.
tome52ce702014-09-11 00:12:54 -070043 *
tomdc361b62014-09-09 20:36:52 -070044 * @param topology topology descriptor
45 * @return true if the topology is the most recent; false otherwise
46 */
47 boolean isLatest(Topology topology);
48
49 /**
tom13cb4852014-09-11 12:44:17 -070050 * 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 /**
tom568581d2014-09-08 20:13:36 -070058 * 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 /**
tom13cb4852014-09-11 12:44:17 -070066 * Returns the cluster with the specified ID.
tom568581d2014-09-08 20:13:36 -070067 *
tom13cb4852014-09-11 12:44:17 -070068 * @param topology topology descriptor
69 * @param clusterId cluster identifier
70 * @return topology cluster
tom568581d2014-09-08 20:13:36 -070071 */
tom13cb4852014-09-11 12:44:17 -070072 TopologyCluster getCluster(Topology topology, ClusterId clusterId);
73
74 /**
75 * Returns the set of devices that belong to the specified cluster.
76 *
Thomas Vachuska48e64e42015-09-22 15:32:55 -070077 * @param topology topology descriptor
78 * @param cluster topology cluster
tom13cb4852014-09-11 12:44:17 -070079 * @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 Vachuska48e64e42015-09-22 15:32:55 -070086 * @param topology topology descriptor
87 * @param cluster topology cluster
tom13cb4852014-09-11 12:44:17 -070088 * @return set of cluster links
89 */
90 Set<Link> getClusterLinks(Topology topology, TopologyCluster cluster);
tom568581d2014-09-08 20:13:36 -070091
92 /**
tomcfde0622014-09-09 11:02:42 -070093 * Returns the set of all shortest paths, precomputed in terms of hop-count,
94 * between the specified source and destination devices.
tom568581d2014-09-08 20:13:36 -070095 *
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 HIGUCHI5c947272014-11-03 21:39:21 -0800110 * @param weight edge-weight entity
tom568581d2014-09-08 20:13:36 -0700111 * @return set of all shortest paths between the two devices
Andrey Komarov2398d962016-09-26 15:11:23 +0300112 *
113 * @deprecated in Junco (1.9.0), use version with LinkWeigher instead
tom568581d2014-09-08 20:13:36 -0700114 */
Andrey Komarov2398d962016-09-26 15:11:23 +0300115 @Deprecated
tom568581d2014-09-08 20:13:36 -0700116 Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst,
117 LinkWeight weight);
118
119 /**
Andrey Komarov2398d962016-09-26 15:11:23 +0300120 * Returns the set of all shortest paths, computed using the supplied
121 * edge-weight entity, between the specified source and destination devices.
122 *
123 * @param topology topology descriptor
124 * @param src source device
125 * @param dst destination device
126 * @param weigher edge-weight entity
127 * @return set of all shortest paths between the two devices
128 */
129 Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst,
130 LinkWeigher weigher);
131
132 /**
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -0700133 * Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count,
134 * between the specified source and destination devices.
135 *
136 * @param topology topology descriptor
137 * @param src source device
138 * @param dst destination device
139 * @return set of all shortest paths between the two devices
140 */
141 Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst);
142
143 /**
144 * Returns the set of all disjoint shortest path pairs, computed using the supplied
145 * edge-weight entity, between the specified source and destination devices.
146 *
147 * @param topology topology descriptor
148 * @param src source device
149 * @param dst destination device
150 * @param weight edge-weight entity
151 * @return set of all shortest paths between the two devices
Andrey Komarov2398d962016-09-26 15:11:23 +0300152 *
153 * @deprecated in Junco (1.9.0), use version with LinkWeigher instead
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -0700154 */
Andrey Komarov2398d962016-09-26 15:11:23 +0300155 @Deprecated
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -0700156 Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
157 LinkWeight weight);
158
159 /**
Andrey Komarov2398d962016-09-26 15:11:23 +0300160 * Returns the set of all disjoint shortest path pairs, computed using the supplied
161 * edge-weight entity, between the specified source and destination devices.
162 *
163 * @param topology topology descriptor
164 * @param src source device
165 * @param dst destination device
166 * @param weigher edge-weight entity
167 * @return set of all shortest paths between the two devices
168 */
169 Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
170 LinkWeigher weigher);
171
172 /**
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -0700173 * Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count,
174 * between the specified source and destination devices.
175 *
Thomas Vachuska48e64e42015-09-22 15:32:55 -0700176 * @param topology topology descriptor
177 * @param src source device
178 * @param dst destination device
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -0700179 * @param riskProfile map of edges to risk profiles
180 * @return set of all shortest paths between the two devices
181 */
Thomas Vachuska48e64e42015-09-22 15:32:55 -0700182 Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
183 Map<Link, Object> riskProfile);
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -0700184
185 /**
186 * Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count,
187 * between the specified source and destination devices.
188 *
Thomas Vachuska48e64e42015-09-22 15:32:55 -0700189 * @param topology topology descriptor
190 * @param src source device
191 * @param dst destination device
192 * @param weight edge-weight entity
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -0700193 * @param riskProfile map of edges to risk profiles
194 * @return set of all shortest paths between the two devices
Andrey Komarov2398d962016-09-26 15:11:23 +0300195 *
196 * @deprecated in Junco (1.9.0), use version with LinkWeigher instead
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -0700197 */
Andrey Komarov2398d962016-09-26 15:11:23 +0300198 @Deprecated
Thomas Vachuska48e64e42015-09-22 15:32:55 -0700199 Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
200 LinkWeight weight, Map<Link, Object> riskProfile);
201
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -0700202 /**
Andrey Komarov2398d962016-09-26 15:11:23 +0300203 * Returns the set of all disjoint shortest path pairs, precomputed in terms of hop-count,
204 * between the specified source and destination devices.
205 *
206 * @param topology topology descriptor
207 * @param src source device
208 * @param dst destination device
209 * @param weigher edge-weight entity
210 * @param riskProfile map of edges to risk profiles
211 * @return set of all shortest paths between the two devices
212 */
213 Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
214 LinkWeigher weigher, Map<Link, Object> riskProfile);
215
216 /**
tom568581d2014-09-08 20:13:36 -0700217 * Indicates whether the specified connection point is part of the network
218 * infrastructure or part of network edge.
219 *
220 * @param topology topology descriptor
221 * @param connectPoint connection point
222 * @return true of connection point is in infrastructure; false if edge
223 */
224 boolean isInfrastructure(Topology topology, ConnectPoint connectPoint);
225
226
227 /**
tom4d0dd3a2014-09-14 23:12:28 -0700228 * Indicates whether broadcast is allowed for traffic received on the
229 * specified connection point.
tom568581d2014-09-08 20:13:36 -0700230 *
231 * @param topology topology descriptor
232 * @param connectPoint connection point
233 * @return true if broadcast is permissible
234 */
tom4d0dd3a2014-09-14 23:12:28 -0700235 boolean isBroadcastPoint(Topology topology, ConnectPoint connectPoint);
tomedf06bb2014-08-27 16:22:15 -0700236
tomedf06bb2014-08-27 16:22:15 -0700237}