summaryrefslogtreecommitdiffstats
path: root/framework/src/onos/core/api/src/main/java/org/onosproject/net/Link.java
blob: 7541f7510733bb2f7ae835a41549c574e0f9759b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/*
 * Copyright 2014 Open Networking Laboratory
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.onosproject.net;

/**
 * Abstraction of a network infrastructure link.
 */
public interface Link extends Annotated, Provided, NetworkResource {

    /**
     * Coarse representation of the link type.
     */
    enum Type {
        /**
         * Signifies that this is a direct single-segment link.
         */
        DIRECT,

        /**
         * Signifies that this link is potentially comprised from multiple
         * underlying segments or hops, and as such should be used to tag
         * links traversing optical paths, tunnels or intervening 'dark'
         * switches.
         */
        INDIRECT,

        /**
         * Signifies that this link is an edge, i.e. host link.
         */
        EDGE,

        /**
         * Signifies that this link represents a logical link backed by
         * some form of a tunnel, e.g., GRE, MPLS, ODUk, OCH.
         */
        TUNNEL,

        /**
         * Signifies that this link is realized by fiber (either single channel or WDM).
         */
        OPTICAL,

        /**
         * Signifies that this link is a virtual link or a pseudo-wire.
         */
        VIRTUAL
    }

    /**
     * Representation of the link state, which applies primarily only to
     * configured durable links, i.e. those that need to remain present,
     * but instead be marked as inactive.
     */
    enum State {
        /**
         * Signifies that a link is currently active.
         */
        ACTIVE,

        /**
         * Signifies that a link is currently active.
         */
        INACTIVE
    }

    /**
     * Returns the link source connection point.
     *
     * @return link source connection point
     */
    ConnectPoint src();

    /**
     * Returns the link destination connection point.
     *
     * @return link destination connection point
     */
    ConnectPoint dst();

    /**
     * Returns the link type.
     *
     * @return link type
     */
    Type type();

    /**
     * Returns the link state.
     *
     * @return link state
     */
    State state();

    /**
     * Indicates if the link is to be considered durable.
     *
     * @return true if the link is durable
     */
    boolean isDurable();

}