blob: e4504c570eb1a2f45235e6a06a0b5269c4afa947 [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
112 */
113 Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst,
114 LinkWeight weight);
115
116 /**
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -0700117 * 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 Vachuska48e64e42015-09-22 15:32:55 -0700144 * @param topology topology descriptor
145 * @param src source device
146 * @param dst destination device
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -0700147 * @param riskProfile map of edges to risk profiles
148 * @return set of all shortest paths between the two devices
149 */
Thomas Vachuska48e64e42015-09-22 15:32:55 -0700150 Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
151 Map<Link, Object> riskProfile);
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -0700152
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 Vachuska48e64e42015-09-22 15:32:55 -0700157 * @param topology topology descriptor
158 * @param src source device
159 * @param dst destination device
160 * @param weight edge-weight entity
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -0700161 * @param riskProfile map of edges to risk profiles
162 * @return set of all shortest paths between the two devices
163 */
Thomas Vachuska48e64e42015-09-22 15:32:55 -0700164 Set<DisjointPath> getDisjointPaths(Topology topology, DeviceId src, DeviceId dst,
165 LinkWeight weight, Map<Link, Object> riskProfile);
166
Nikhil Cheerla2ec191f2015-07-09 12:34:54 -0700167 /**
tom568581d2014-09-08 20:13:36 -0700168 * 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 /**
tom4d0dd3a2014-09-14 23:12:28 -0700179 * Indicates whether broadcast is allowed for traffic received on the
180 * specified connection point.
tom568581d2014-09-08 20:13:36 -0700181 *
182 * @param topology topology descriptor
183 * @param connectPoint connection point
184 * @return true if broadcast is permissible
185 */
tom4d0dd3a2014-09-14 23:12:28 -0700186 boolean isBroadcastPoint(Topology topology, ConnectPoint connectPoint);
tomedf06bb2014-08-27 16:22:15 -0700187
tomedf06bb2014-08-27 16:22:15 -0700188}