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