Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2014-present Open Networking Foundation |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 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; |
tom | 43387f3 | 2014-08-27 14:42:43 -0700 | [diff] [blame] | 17 | |
Andrey Komarov | 2398d96 | 2016-09-26 15:11:23 +0300 | [diff] [blame] | 18 | import org.onlab.graph.Weight; |
| 19 | |
tom | 43387f3 | 2014-08-27 14:42:43 -0700 | [diff] [blame] | 20 | import java.util.List; |
| 21 | |
| 22 | /** |
| 23 | * Representation of a contiguous directed path in a network. Path comprises |
| 24 | * of a sequence of links, where adjacent links must share the same device, |
| 25 | * meaning that destination of the source of one link must coincide with the |
Andrey Komarov | 2398d96 | 2016-09-26 15:11:23 +0300 | [diff] [blame] | 26 | * destination of the previous link. Path weight (cost) is an aggregation |
| 27 | * of the weights of the links the path consists of. |
tom | 43387f3 | 2014-08-27 14:42:43 -0700 | [diff] [blame] | 28 | */ |
| 29 | public interface Path extends Link { |
| 30 | |
| 31 | /** |
| 32 | * Returns sequence of links comprising the path. |
| 33 | * |
| 34 | * @return list of links |
| 35 | */ |
| 36 | List<Link> links(); |
| 37 | |
tom | 9793755 | 2014-09-11 10:48:42 -0700 | [diff] [blame] | 38 | /** |
| 39 | * Returns the path cost as a unit-less value. |
| 40 | * |
| 41 | * @return unit-less path cost |
Andrey Komarov | 2398d96 | 2016-09-26 15:11:23 +0300 | [diff] [blame] | 42 | * |
| 43 | * @deprecated in Junco (1.9.0), use weight() instead |
tom | 9793755 | 2014-09-11 10:48:42 -0700 | [diff] [blame] | 44 | */ |
Andrey Komarov | 2398d96 | 2016-09-26 15:11:23 +0300 | [diff] [blame] | 45 | @Deprecated |
tom | 9793755 | 2014-09-11 10:48:42 -0700 | [diff] [blame] | 46 | double cost(); |
| 47 | |
Andrey Komarov | 2398d96 | 2016-09-26 15:11:23 +0300 | [diff] [blame] | 48 | /** |
| 49 | * Returns the path cost as an weight instance. |
| 50 | * |
| 51 | * @return weight path cost |
| 52 | */ |
| 53 | Weight weight(); |
| 54 | |
tom | 43387f3 | 2014-08-27 14:42:43 -0700 | [diff] [blame] | 55 | } |