Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Open Networking Laboratory |
| 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; |
| 21 | import org.onosproject.net.Link; |
| 22 | import org.onosproject.net.Path; |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 23 | |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 24 | import java.util.Set; |
| 25 | |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 26 | /** |
| 27 | * Service for providing network topology information. |
| 28 | */ |
Thomas Vachuska | 42e8cce | 2015-07-29 19:25:18 -0700 | [diff] [blame^] | 29 | public interface TopologyService |
| 30 | extends ListenerService<TopologyEvent, TopologyListener> { |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 31 | |
| 32 | /** |
| 33 | * Returns the current topology descriptor. |
| 34 | * |
| 35 | * @return current topology |
| 36 | */ |
| 37 | Topology currentTopology(); |
| 38 | |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 39 | /** |
tom | dc361b6 | 2014-09-09 20:36:52 -0700 | [diff] [blame] | 40 | * Indicates whether the specified topology is the latest or not. |
tom | e52ce70 | 2014-09-11 00:12:54 -0700 | [diff] [blame] | 41 | * |
tom | dc361b6 | 2014-09-09 20:36:52 -0700 | [diff] [blame] | 42 | * @param topology topology descriptor |
| 43 | * @return true if the topology is the most recent; false otherwise |
| 44 | */ |
| 45 | boolean isLatest(Topology topology); |
| 46 | |
| 47 | /** |
tom | 13cb485 | 2014-09-11 12:44:17 -0700 | [diff] [blame] | 48 | * Returns the graph view of the specified topology. |
| 49 | * |
| 50 | * @param topology topology descriptor |
| 51 | * @return topology graph view |
| 52 | */ |
| 53 | TopologyGraph getGraph(Topology topology); |
| 54 | |
| 55 | /** |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 56 | * Returns the set of clusters in the specified topology. |
| 57 | * |
| 58 | * @param topology topology descriptor |
| 59 | * @return set of topology clusters |
| 60 | */ |
| 61 | Set<TopologyCluster> getClusters(Topology topology); |
| 62 | |
| 63 | /** |
tom | 13cb485 | 2014-09-11 12:44:17 -0700 | [diff] [blame] | 64 | * Returns the cluster with the specified ID. |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 65 | * |
tom | 13cb485 | 2014-09-11 12:44:17 -0700 | [diff] [blame] | 66 | * @param topology topology descriptor |
| 67 | * @param clusterId cluster identifier |
| 68 | * @return topology cluster |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 69 | */ |
tom | 13cb485 | 2014-09-11 12:44:17 -0700 | [diff] [blame] | 70 | TopologyCluster getCluster(Topology topology, ClusterId clusterId); |
| 71 | |
| 72 | /** |
| 73 | * Returns the set of devices that belong to the specified cluster. |
| 74 | * |
| 75 | * @param topology topology descriptor |
| 76 | * @param cluster topology cluster |
| 77 | * @return set of cluster devices |
| 78 | */ |
| 79 | Set<DeviceId> getClusterDevices(Topology topology, TopologyCluster cluster); |
| 80 | |
| 81 | /** |
| 82 | * Returns the set of links that form the specified cluster. |
| 83 | * |
| 84 | * @param topology topology descriptor |
| 85 | * @param cluster topology cluster |
| 86 | * @return set of cluster links |
| 87 | */ |
| 88 | Set<Link> getClusterLinks(Topology topology, TopologyCluster cluster); |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 89 | |
| 90 | /** |
tom | cfde062 | 2014-09-09 11:02:42 -0700 | [diff] [blame] | 91 | * Returns the set of all shortest paths, precomputed in terms of hop-count, |
| 92 | * between the specified source and destination devices. |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 93 | * |
| 94 | * @param topology topology descriptor |
| 95 | * @param src source device |
| 96 | * @param dst destination device |
| 97 | * @return set of all shortest paths between the two devices |
| 98 | */ |
| 99 | Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst); |
| 100 | |
| 101 | /** |
| 102 | * Returns the set of all shortest paths, computed using the supplied |
| 103 | * edge-weight entity, between the specified source and destination devices. |
| 104 | * |
| 105 | * @param topology topology descriptor |
| 106 | * @param src source device |
| 107 | * @param dst destination device |
Yuta HIGUCHI | 5c94727 | 2014-11-03 21:39:21 -0800 | [diff] [blame] | 108 | * @param weight edge-weight entity |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 109 | * @return set of all shortest paths between the two devices |
| 110 | */ |
| 111 | Set<Path> getPaths(Topology topology, DeviceId src, DeviceId dst, |
| 112 | LinkWeight weight); |
| 113 | |
| 114 | /** |
| 115 | * Indicates whether the specified connection point is part of the network |
| 116 | * infrastructure or part of network edge. |
| 117 | * |
| 118 | * @param topology topology descriptor |
| 119 | * @param connectPoint connection point |
| 120 | * @return true of connection point is in infrastructure; false if edge |
| 121 | */ |
| 122 | boolean isInfrastructure(Topology topology, ConnectPoint connectPoint); |
| 123 | |
| 124 | |
| 125 | /** |
tom | 4d0dd3a | 2014-09-14 23:12:28 -0700 | [diff] [blame] | 126 | * Indicates whether broadcast is allowed for traffic received on the |
| 127 | * specified connection point. |
tom | 568581d | 2014-09-08 20:13:36 -0700 | [diff] [blame] | 128 | * |
| 129 | * @param topology topology descriptor |
| 130 | * @param connectPoint connection point |
| 131 | * @return true if broadcast is permissible |
| 132 | */ |
tom | 4d0dd3a | 2014-09-14 23:12:28 -0700 | [diff] [blame] | 133 | boolean isBroadcastPoint(Topology topology, ConnectPoint connectPoint); |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 134 | |
tom | edf06bb | 2014-08-27 16:22:15 -0700 | [diff] [blame] | 135 | } |