blob: 41eac2c4fd8069fd39efec296e4978df8a6a3fd4 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
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'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;
21import org.onosproject.net.Link;
22import org.onosproject.net.Path;
tomedf06bb2014-08-27 16:22:15 -070023
tom568581d2014-09-08 20:13:36 -070024import java.util.Set;
25
tomedf06bb2014-08-27 16:22:15 -070026/**
27 * Service for providing network topology information.
28 */
Thomas Vachuska42e8cce2015-07-29 19:25:18 -070029public interface TopologyService
30 extends ListenerService<TopologyEvent, TopologyListener> {
tomedf06bb2014-08-27 16:22:15 -070031
32 /**
33 * Returns the current topology descriptor.
34 *
35 * @return current topology
36 */
37 Topology currentTopology();
38
tom568581d2014-09-08 20:13:36 -070039 /**
tomdc361b62014-09-09 20:36:52 -070040 * Indicates whether the specified topology is the latest or not.
tome52ce702014-09-11 00:12:54 -070041 *
tomdc361b62014-09-09 20:36:52 -070042 * @param topology topology descriptor
43 * @return true if the topology is the most recent; false otherwise
44 */
45 boolean isLatest(Topology topology);
46
47 /**
tom13cb4852014-09-11 12:44:17 -070048 * 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 /**
tom568581d2014-09-08 20:13:36 -070056 * 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 /**
tom13cb4852014-09-11 12:44:17 -070064 * Returns the cluster with the specified ID.
tom568581d2014-09-08 20:13:36 -070065 *
tom13cb4852014-09-11 12:44:17 -070066 * @param topology topology descriptor
67 * @param clusterId cluster identifier
68 * @return topology cluster
tom568581d2014-09-08 20:13:36 -070069 */
tom13cb4852014-09-11 12:44:17 -070070 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);
tom568581d2014-09-08 20:13:36 -070089
90 /**
tomcfde0622014-09-09 11:02:42 -070091 * Returns the set of all shortest paths, precomputed in terms of hop-count,
92 * between the specified source and destination devices.
tom568581d2014-09-08 20:13:36 -070093 *
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 HIGUCHI5c947272014-11-03 21:39:21 -0800108 * @param weight edge-weight entity
tom568581d2014-09-08 20:13:36 -0700109 * @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 /**
tom4d0dd3a2014-09-14 23:12:28 -0700126 * Indicates whether broadcast is allowed for traffic received on the
127 * specified connection point.
tom568581d2014-09-08 20:13:36 -0700128 *
129 * @param topology topology descriptor
130 * @param connectPoint connection point
131 * @return true if broadcast is permissible
132 */
tom4d0dd3a2014-09-14 23:12:28 -0700133 boolean isBroadcastPoint(Topology topology, ConnectPoint connectPoint);
tomedf06bb2014-08-27 16:22:15 -0700134
tomedf06bb2014-08-27 16:22:15 -0700135}