blob: 521a53feb8972f9703dc98555351e1ead550a6e0 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2014-present Open Networking Laboratory
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07003 *
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;
tom64b7aac2014-08-26 00:18:21 -070017
Thomas Vachuska3afbc7f2016-02-01 15:55:38 -080018import org.onosproject.net.driver.Projectable;
19
tom64b7aac2014-08-26 00:18:21 -070020/**
21 * Abstraction of a network infrastructure link.
22 */
Thomas Vachuska3afbc7f2016-02-01 15:55:38 -080023public interface Link extends Annotated, Provided, Projectable, NetworkResource {
tom18567e92014-08-26 01:39:47 -070024
25 /**
26 * Coarse representation of the link type.
27 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070028 enum Type {
tom18567e92014-08-26 01:39:47 -070029 /**
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
tomd3097b02014-08-26 10:40:29 -070036 * underlying segments or hops, and as such should be used to tag
37 * links traversing optical paths, tunnels or intervening 'dark'
38 * switches.
tom18567e92014-08-26 01:39:47 -070039 */
tom80c0e5e2014-09-08 18:08:58 -070040 INDIRECT,
41
42 /**
43 * Signifies that this link is an edge, i.e. host link.
44 */
Thomas Vachuska0e752bd2014-10-22 22:33:41 -070045 EDGE,
46
47 /**
48 * Signifies that this link represents a logical link backed by
wei wei89ddc322015-03-22 16:29:04 -050049 * some form of a tunnel, e.g., GRE, MPLS, ODUk, OCH.
Thomas Vachuska0e752bd2014-10-22 22:33:41 -070050 */
51 TUNNEL,
52
53 /**
wei wei89ddc322015-03-22 16:29:04 -050054 * Signifies that this link is realized by fiber (either single channel or WDM).
Thomas Vachuska0e752bd2014-10-22 22:33:41 -070055 */
Thomas Vachuska7b438af2015-07-07 09:52:07 -070056 OPTICAL,
57
58 /**
59 * Signifies that this link is a virtual link or a pseudo-wire.
60 */
61 VIRTUAL
tom18567e92014-08-26 01:39:47 -070062 }
tom64b7aac2014-08-26 00:18:21 -070063
64 /**
Thomas Vachuska57126fe2014-11-11 17:13:24 -080065 * 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 SHIMIZU3310a342015-05-13 12:14:05 -070069 enum State {
Thomas Vachuska57126fe2014-11-11 17:13:24 -080070 /**
71 * Signifies that a link is currently active.
72 */
73 ACTIVE,
74
75 /**
Yuta HIGUCHI516a8ca2016-08-05 15:10:00 -070076 * Signifies that a link is currently inactive.
Thomas Vachuska57126fe2014-11-11 17:13:24 -080077 */
78 INACTIVE
79 }
80
81 /**
tom64b7aac2014-08-26 00:18:21 -070082 * 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
tomeadbb462014-09-07 16:10:19 -070095 /**
96 * Returns the link type.
97 *
98 * @return link type
99 */
100 Type type();
101
Thomas Vachuska57126fe2014-11-11 17:13:24 -0800102 /**
103 * Returns the link state.
Thomas Vachuska112c7032014-11-16 11:05:14 -0800104 *
105 * @return link state
Thomas Vachuska57126fe2014-11-11 17:13:24 -0800106 */
107 State state();
108
109 /**
Ray Milkeyd0dd1352016-01-19 10:58:41 -0800110 * 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();
tom64b7aac2014-08-26 00:18:21 -0700116}