blob: f091dc42be79608845e1438cd0c6bffe4269b303 [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 */
tom64b7aac2014-08-26 00:18:21 -070016package org.onlab.onos.net;
17
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 */
26 public enum Type {
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
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
47 * some form of a tunnel.
48 */
49 TUNNEL,
50
51 /**
52 * Signifies that this link is realized by optical connection.
53 */
54 OPTICAL
tom18567e92014-08-26 01:39:47 -070055 }
tom64b7aac2014-08-26 00:18:21 -070056
57 /**
Thomas Vachuska57126fe2014-11-11 17:13:24 -080058 * Representation of the link state, which applies primarily only to
59 * configured durable links, i.e. those that need to remain present,
60 * but instead be marked as inactive.
61 */
62 public enum State {
63 /**
64 * Signifies that a link is currently active.
65 */
66 ACTIVE,
67
68 /**
69 * Signifies that a link is currently active.
70 */
71 INACTIVE
72 }
73
74 /**
tom64b7aac2014-08-26 00:18:21 -070075 * Returns the link source connection point.
76 *
77 * @return link source connection point
78 */
79 ConnectPoint src();
80
81 /**
82 * Returns the link destination connection point.
83 *
84 * @return link destination connection point
85 */
86 ConnectPoint dst();
87
tomeadbb462014-09-07 16:10:19 -070088 /**
89 * Returns the link type.
90 *
91 * @return link type
92 */
93 Type type();
94
Thomas Vachuska57126fe2014-11-11 17:13:24 -080095 /**
96 * Returns the link state.
Thomas Vachuska112c7032014-11-16 11:05:14 -080097 *
98 * @return link state
Thomas Vachuska57126fe2014-11-11 17:13:24 -080099 */
100 State state();
101
102 /**
103 * Indicates if the link is to be considered durable.
104 *
Thomas Vachuska112c7032014-11-16 11:05:14 -0800105 * @return true if the link is durable
Thomas Vachuska57126fe2014-11-11 17:13:24 -0800106 */
107 boolean isDurable();
108
tom64b7aac2014-08-26 00:18:21 -0700109}