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