blob: 7541f7510733bb2f7ae835a41549c574e0f9759b [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;
tom64b7aac2014-08-26 00:18:21 -070017
tom64b7aac2014-08-26 00:18:21 -070018/**
19 * Abstraction of a network infrastructure link.
20 */
Thomas Vachuskac96058a2014-10-20 23:00:16 -070021public interface Link extends Annotated, Provided, NetworkResource {
tom18567e92014-08-26 01:39:47 -070022
23 /**
24 * Coarse representation of the link type.
25 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070026 enum Type {
tom18567e92014-08-26 01:39:47 -070027 /**
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
tomd3097b02014-08-26 10:40:29 -070034 * underlying segments or hops, and as such should be used to tag
35 * links traversing optical paths, tunnels or intervening 'dark'
36 * switches.
tom18567e92014-08-26 01:39:47 -070037 */
tom80c0e5e2014-09-08 18:08:58 -070038 INDIRECT,
39
40 /**
41 * Signifies that this link is an edge, i.e. host link.
42 */
Thomas Vachuska0e752bd2014-10-22 22:33:41 -070043 EDGE,
44
45 /**
46 * Signifies that this link represents a logical link backed by
wei wei89ddc322015-03-22 16:29:04 -050047 * some form of a tunnel, e.g., GRE, MPLS, ODUk, OCH.
Thomas Vachuska0e752bd2014-10-22 22:33:41 -070048 */
49 TUNNEL,
50
51 /**
wei wei89ddc322015-03-22 16:29:04 -050052 * Signifies that this link is realized by fiber (either single channel or WDM).
Thomas Vachuska0e752bd2014-10-22 22:33:41 -070053 */
Thomas Vachuska7b438af2015-07-07 09:52:07 -070054 OPTICAL,
55
56 /**
57 * Signifies that this link is a virtual link or a pseudo-wire.
58 */
59 VIRTUAL
tom18567e92014-08-26 01:39:47 -070060 }
tom64b7aac2014-08-26 00:18:21 -070061
62 /**
Thomas Vachuska57126fe2014-11-11 17:13:24 -080063 * 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 SHIMIZU3310a342015-05-13 12:14:05 -070067 enum State {
Thomas Vachuska57126fe2014-11-11 17:13:24 -080068 /**
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 /**
tom64b7aac2014-08-26 00:18:21 -070080 * 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
tomeadbb462014-09-07 16:10:19 -070093 /**
94 * Returns the link type.
95 *
96 * @return link type
97 */
98 Type type();
99
Thomas Vachuska57126fe2014-11-11 17:13:24 -0800100 /**
101 * Returns the link state.
Thomas Vachuska112c7032014-11-16 11:05:14 -0800102 *
103 * @return link state
Thomas Vachuska57126fe2014-11-11 17:13:24 -0800104 */
105 State state();
106
107 /**
108 * Indicates if the link is to be considered durable.
109 *
Thomas Vachuska112c7032014-11-16 11:05:14 -0800110 * @return true if the link is durable
Thomas Vachuska57126fe2014-11-11 17:13:24 -0800111 */
112 boolean isDurable();
113
tom64b7aac2014-08-26 00:18:21 -0700114}