blob: a0d892d7694fbe6a085692650cd3b053382f3b9d [file] [log] [blame]
cheng fan48e832c2015-05-29 01:54:47 +08001/*
2 * Copyright 2015 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 */
16
17package org.onosproject.pcep.api;
18
19import java.util.List;
20
21/**
cheng fan93258c72015-06-02 23:42:32 +080022 * Abstraction of a generalized PCEP Tunnel entity (bandwidth pipe) for L2
23 * networks or L1/L0 networks, representation of e.g., VLAN, L1 ODUk connection,
24 * WDM OCH, etc..
cheng fan48e832c2015-05-29 01:54:47 +080025 */
26public interface PcepTunnel extends PcepOperator {
27
28 /**
29 * Describe the type of a tunnel.
30 */
31 public static enum Type {
32
33 /**
34 * Signifies that this is a L0 OCH tunnel.
35 */
36 OCH,
37
38 /**
39 * Signifies that this is a L1 OTN tunnel.
40 */
41 OTN,
42
43 /**
44 * Signifies that this is a L2 tunnel.
45 */
46 UNI,
47 }
48
49 /**
50 * The ability of a tunnel.
51 */
52 public static enum Ability {
53 /**
54 * no protected tunnel,if the tunnel is broken ,then the user is out of
55 * service.
56 */
57 NOPROTECTED,
58
59 /**
60 * tunnel with rerouter ability.if a tunnel is broken, the tunnel will
61 * try to find another path to provider service.
62 */
63 SILVER,
64
65 /**
66 * tunnel with 1 + 1 rerouter ability.if a tunnel is broken, there'll be
67 * another tunnel providing service at once.
68 */
69 DIAMOND
70 }
71
72 public static enum PATHTYPE {
73
74 /**
cheng fan93258c72015-06-02 23:42:32 +080075 * Indicates path is the preferred path.
cheng fan48e832c2015-05-29 01:54:47 +080076 */
77 FIRST,
78
79 /**
cheng fan93258c72015-06-02 23:42:32 +080080 * Indicates path is the alternate path.
cheng fan48e832c2015-05-29 01:54:47 +080081 */
82 SECOND
83 }
84
85 /**
cheng fan93258c72015-06-02 23:42:32 +080086 * Represents state of the path, work normally or broken down.
87 *
88 */
89 public static enum PathState {
90 NORMAL, BROKEN
91 }
92
93 /**
94 * Returns the type of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +080095 *
96 * @return tunnel type
97 */
98 public Type type();
99
100 /**
cheng fan93258c72015-06-02 23:42:32 +0800101 * Returns the name of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800102 *
103 * @return tunnel name
104 */
105 public String name();
106
107 /**
cheng fan93258c72015-06-02 23:42:32 +0800108 * Returns the device id of destination endpoint of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800109 *
110 * @return device id
111 */
112 public PcepDpid srcDeviceID();
113
114 /**
cheng fan93258c72015-06-02 23:42:32 +0800115 * Returns the device id of source endpoint of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800116 *
117 * @return device id
118 */
119 public PcepDpid dstDeviceId();
120
121 /**
cheng fan93258c72015-06-02 23:42:32 +0800122 * Returns source port of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800123 *
124 * @return port number
125 */
126 public long srcPort();
127
128 /**
cheng fan93258c72015-06-02 23:42:32 +0800129 * Returns destination port of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800130 *
131 * @return port number
132 */
133 public long dstPort();
134
135 /**
cheng fan93258c72015-06-02 23:42:32 +0800136 * Returns the bandwidth of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800137 *
138 * @return bandwidth
139 */
140 public long bandWidth();
141
142 /**
cheng fan93258c72015-06-02 23:42:32 +0800143 * Returns the tunnel id.
cheng fan48e832c2015-05-29 01:54:47 +0800144 *
145 * @return id of the PCEP tunnel
146 */
147 public long id();
148
149 /**
cheng fan93258c72015-06-02 23:42:32 +0800150 * Returns the detail hop list of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800151 *
152 * @return hop list
153 */
154 public List<PcepHopNodeDescription> getHopList();
155
156 /**
cheng fan93258c72015-06-02 23:42:32 +0800157 * Returns the instance of a pcep tunnel,a instance is used to mark the times of
158 * a tunnel created. instance and id identify a tunnel together.
cheng fan48e832c2015-05-29 01:54:47 +0800159 *
160 * @return the instance of a tunnel.
161 */
162 public int getInstance();
163
164 /**
cheng fan93258c72015-06-02 23:42:32 +0800165 * Returns the state of a path.
166 *
167 * @return normal or broken
168 */
169 public PathState getPathState();
170
171 /**
172 * Returns the ability of a tunnel.
cheng fan48e832c2015-05-29 01:54:47 +0800173 *
174 * @return ability of the tunenl
175 */
176 public Ability getSla();
177
178 /**
cheng fan93258c72015-06-02 23:42:32 +0800179 * Returns the path type of a path if the tunnel's ability is diamond .
cheng fan48e832c2015-05-29 01:54:47 +0800180 *
181 * @return the type of a path, the preferred or alternate.
182 */
183 public PATHTYPE getPathType();
184
185 /**
186 * Get the under lay tunnel id of VLAN tunnel.
187 *
188 * @return the tunnel id of a OCH tunnel under lay of a VLAN tunnel.
189 */
cheng fan93258c72015-06-02 23:42:32 +0800190 public long underlayTunnelId();
cheng fan48e832c2015-05-29 01:54:47 +0800191
192}