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 | 64b7aac | 2014-08-26 00:18:21 -0700 | [diff] [blame] | 17 | |
Thomas Vachuska | 3afbc7f | 2016-02-01 15:55:38 -0800 | [diff] [blame] | 18 | import org.onosproject.net.driver.Projectable; |
| 19 | |
tom | 64b7aac | 2014-08-26 00:18:21 -0700 | [diff] [blame] | 20 | /** |
| 21 | * Abstraction of a network infrastructure link. |
| 22 | */ |
Thomas Vachuska | 3afbc7f | 2016-02-01 15:55:38 -0800 | [diff] [blame] | 23 | public interface Link extends Annotated, Provided, Projectable, NetworkResource { |
tom | 18567e9 | 2014-08-26 01:39:47 -0700 | [diff] [blame] | 24 | |
| 25 | /** |
| 26 | * Coarse representation of the link type. |
| 27 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 28 | enum Type { |
tom | 18567e9 | 2014-08-26 01:39:47 -0700 | [diff] [blame] | 29 | /** |
| 30 | * Signifies that this is a direct single-segment link. |
| 31 | */ |
| 32 | DIRECT, |
| 33 | |
| 34 | /** |
| 35 | * Signifies that this link is potentially comprised from multiple |
tom | d3097b0 | 2014-08-26 10:40:29 -0700 | [diff] [blame] | 36 | * underlying segments or hops, and as such should be used to tag |
| 37 | * links traversing optical paths, tunnels or intervening 'dark' |
| 38 | * switches. |
tom | 18567e9 | 2014-08-26 01:39:47 -0700 | [diff] [blame] | 39 | */ |
tom | 80c0e5e | 2014-09-08 18:08:58 -0700 | [diff] [blame] | 40 | INDIRECT, |
| 41 | |
| 42 | /** |
| 43 | * Signifies that this link is an edge, i.e. host link. |
| 44 | */ |
Thomas Vachuska | 0e752bd | 2014-10-22 22:33:41 -0700 | [diff] [blame] | 45 | EDGE, |
| 46 | |
| 47 | /** |
| 48 | * Signifies that this link represents a logical link backed by |
wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 49 | * some form of a tunnel, e.g., GRE, MPLS, ODUk, OCH. |
Thomas Vachuska | 0e752bd | 2014-10-22 22:33:41 -0700 | [diff] [blame] | 50 | */ |
| 51 | TUNNEL, |
| 52 | |
| 53 | /** |
wei wei | 89ddc32 | 2015-03-22 16:29:04 -0500 | [diff] [blame] | 54 | * Signifies that this link is realized by fiber (either single channel or WDM). |
Thomas Vachuska | 0e752bd | 2014-10-22 22:33:41 -0700 | [diff] [blame] | 55 | */ |
Thomas Vachuska | 7b438af | 2015-07-07 09:52:07 -0700 | [diff] [blame] | 56 | OPTICAL, |
| 57 | |
| 58 | /** |
| 59 | * Signifies that this link is a virtual link or a pseudo-wire. |
| 60 | */ |
| 61 | VIRTUAL |
tom | 18567e9 | 2014-08-26 01:39:47 -0700 | [diff] [blame] | 62 | } |
tom | 64b7aac | 2014-08-26 00:18:21 -0700 | [diff] [blame] | 63 | |
| 64 | /** |
Thomas Vachuska | 57126fe | 2014-11-11 17:13:24 -0800 | [diff] [blame] | 65 | * Representation of the link state, which applies primarily only to |
| 66 | * configured durable links, i.e. those that need to remain present, |
| 67 | * but instead be marked as inactive. |
| 68 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 69 | enum State { |
Thomas Vachuska | 57126fe | 2014-11-11 17:13:24 -0800 | [diff] [blame] | 70 | /** |
| 71 | * Signifies that a link is currently active. |
| 72 | */ |
| 73 | ACTIVE, |
| 74 | |
| 75 | /** |
Yuta HIGUCHI | 516a8ca | 2016-08-05 15:10:00 -0700 | [diff] [blame] | 76 | * Signifies that a link is currently inactive. |
Thomas Vachuska | 57126fe | 2014-11-11 17:13:24 -0800 | [diff] [blame] | 77 | */ |
| 78 | INACTIVE |
| 79 | } |
| 80 | |
| 81 | /** |
tom | 64b7aac | 2014-08-26 00:18:21 -0700 | [diff] [blame] | 82 | * Returns the link source connection point. |
| 83 | * |
| 84 | * @return link source connection point |
| 85 | */ |
| 86 | ConnectPoint src(); |
| 87 | |
| 88 | /** |
| 89 | * Returns the link destination connection point. |
| 90 | * |
| 91 | * @return link destination connection point |
| 92 | */ |
| 93 | ConnectPoint dst(); |
| 94 | |
tom | eadbb46 | 2014-09-07 16:10:19 -0700 | [diff] [blame] | 95 | /** |
| 96 | * Returns the link type. |
| 97 | * |
| 98 | * @return link type |
| 99 | */ |
| 100 | Type type(); |
| 101 | |
Thomas Vachuska | 57126fe | 2014-11-11 17:13:24 -0800 | [diff] [blame] | 102 | /** |
| 103 | * Returns the link state. |
Thomas Vachuska | 112c703 | 2014-11-16 11:05:14 -0800 | [diff] [blame] | 104 | * |
| 105 | * @return link state |
Thomas Vachuska | 57126fe | 2014-11-11 17:13:24 -0800 | [diff] [blame] | 106 | */ |
| 107 | State state(); |
| 108 | |
| 109 | /** |
Ray Milkey | d0dd135 | 2016-01-19 10:58:41 -0800 | [diff] [blame] | 110 | * Indicates if the link was created from a predefined configuration. |
| 111 | * |
| 112 | * @return true if the link was created from a predefined configuration, |
| 113 | * false otherwise. |
| 114 | */ |
| 115 | boolean isExpected(); |
tom | 64b7aac | 2014-08-26 00:18:21 -0700 | [diff] [blame] | 116 | } |