blob: 9314bb76a42f09db9147e11161bf12fdbafee078 [file] [log] [blame]
Sho SHIMIZU74361c12015-08-11 12:31:48 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Sho SHIMIZU74361c12015-08-11 12:31:48 -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 */
16package org.onosproject.pcepio.protocol;
17
18import java.util.LinkedList;
19
20import org.jboss.netty.buffer.ChannelBuffer;
21import org.onosproject.pcepio.exceptions.PcepParseException;
22import org.onosproject.pcepio.types.PcepObjectHeader;
23import org.onosproject.pcepio.types.PcepValueType;
24
25/**
26 * Abstraction of an entity providing PCEP LSPA Object.
27 */
28public interface PcepLspaObject {
29
30 /**
31 * Returns L flag in LSPA Object.
32 *
33 * @return L flag in LSPA Object
34 */
35 boolean getLFlag();
36
37 /**
38 * Sets L flag in LSPA Object.
39 *
40 * @param value L flag
41 */
42 void setLFlag(boolean value);
43
44 /**
45 * Returns Exclude Any field in LSPA Object.
46 *
47 * @return Exclude Any field in LSPA Object
48 */
49 int getExcludeAny();
50
51 /**
52 * Sets Exclude Any field in LSPA Object.
53 *
54 * @param value Exclude Any field
55 */
56 void setExcludeAny(int value);
57
58 /**
59 * Returns Include Any field in LSPA Object.
60 *
61 * @return Include Any field in LSPA Object
62 */
63 int getIncludeAny();
64
65 /**
66 * Sets Include Any field in LSPA Object.
67 *
68 * @param value Include Any field
69 */
70 void setIncludeAny(int value);
71
72 /**
73 * Returns Include All field in LSPA Object.
74 *
75 * @return Include All field in LSPA Object
76 */
77 int getIncludeAll();
78
79 /**
80 * Sets Include All field in LSPA Object.
81 *
82 * @param value Include All field
83 */
84 void setIncludeAll(int value);
85
86 /**
87 * Returns Setup Priority field in LSPA Object.
88 *
89 * @return Setup Priority field in LSPA Object
90 */
91 byte getSetupPriority();
92
93 /**
94 * Sets Setup Priority field in LSPA Object.
95 *
96 * @param value Setup Priority field
97 */
98 void setSetupPriority(byte value);
99
100 /**
101 * Returns Hold Priority field in LSPA Object.
102 *
103 * @return Hold Priority field in LSPA Object
104 */
105 byte getHoldPriority();
106
107 /**
108 * Sets Hold Priority field in LSPA Object.
109 *
110 * @param value Hold Priority field
111 */
112 void setHoldPriority(byte value);
113
114 /**
115 * Returns list of Optional Tlvs in LSPA Object.
116 *
117 * @return list of Optional Tlvs in LSPA Object
118 */
119 LinkedList<PcepValueType> getOptionalTlv();
120
121 /**
122 * Sets Optional Tlvs in LSPA Object.
123 *
124 * @param llOptionalTlv Optional Tlvs in LSPA Object
125 */
126 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
127
128 /**
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700129 * Writes the LSPA Object into channel buffer.
130 *
131 * @param bb channel buffer
132 * @return Returns the writerIndex of this buffer
133 * @throws PcepParseException while writing LSPA object into Channel Buffer.
134 */
135 int write(ChannelBuffer bb) throws PcepParseException;
136
137 /**
138 * Builder interface with get and set functions to build bandwidth object.
139 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -0700140 interface Builder {
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700141
142 /**
143 * Builds LSPA Object.
144 *
145 * @return LSPA Object
146 * @throws PcepParseException while building LSPA object.
147 */
148 PcepLspaObject build() throws PcepParseException;
149
150 /**
151 * Returns LSPA object header.
152 *
153 * @return LSPA object header
154 */
155 PcepObjectHeader getLspaObjHeader();
156
157 /**
158 * Sets LSPA object header and returns its builder.
159 *
160 * @param obj LSPA object header
161 * @return Builder by setting LSPA object header
162 */
163 Builder setLspaObjHeader(PcepObjectHeader obj);
164
165 /**
166 * Returns L flag in LSPA Object.
167 *
168 * @return L flag in LSPA Object
169 */
170 boolean getLFlag();
171
172 /**
173 * Sets L flag in LSPA Object and return its builder.
174 *
175 * @param value L flag in LSPA Object
176 * @return Builder by setting L flag
177 */
178 Builder setLFlag(boolean value);
179
180 /**
181 * Returns Exclude Any field in LSPA Object.
182 *
183 * @return Exclude Any field in LSPA Object
184 */
185 int getExcludeAny();
186
187 /**
188 * Sets Exclude Any field in LSPA Object and return its builder.
189 *
190 * @param value Exclude Any field in LSPA Object
191 * @return Builder by setting Exclude Any field
192 */
193 Builder setExcludeAny(int value);
194
195 /**
196 * Returns Include Any field in LSPA Object.
197 *
198 * @return Include Any field in LSPA Object
199 */
200 int getIncludeAny();
201
202 /**
203 * Sets Include Any field in LSPA Object and return its builder.
204 *
205 * @param value Include Any field in LSPA Object
206 * @return Builder by setting Include Any field
207 */
208 Builder setIncludeAny(int value);
209
210 /**
211 * Returns Include All field in LSPA Object.
212 *
213 * @return Include All field in LSPA Object
214 */
215 int getIncludeAll();
216
217 /**
218 * Sets Include All field in LSPA Object and return its builder.
219 *
220 * @param value Include All field in LSPA Object
221 * @return Builder by setting Include All field
222 */
223 Builder setIncludeAll(int value);
224
225 /**
226 * Returns Setup Priority field in LSPA Object.
227 *
228 * @return Setup Priority field in LSPA Object
229 */
230 byte getSetupPriority();
231
232 /**
233 * Sets Setup Priority field in LSPA Object and return its builder.
234 *
235 * @param value Setup Priority field in LSPA Object
236 * @return Builder by setting Setup Priority field
237 */
238 Builder setSetupPriority(byte value);
239
240 /**
241 * Returns Hold Priority field in LSPA Object.
242 *
243 * @return Hold Priority field in LSPA Object
244 */
245 byte getHoldPriority();
246
247 /**
248 * Sets Hold Priority field in LSPA Object and return its builder.
249 *
250 * @param value Hold Priority field in LSPA Object
251 * @return Builder by setting Hold Priority field
252 */
253 Builder setHoldPriority(byte value);
254
255 /**
256 * Returns list of Optional Tlvs in LSPA Object.
257 *
258 * @return list of Optional Tlvs in LSPA Object
259 */
260 LinkedList<PcepValueType> getOptionalTlv();
261
262 /**
263 * Sets list of Optional Tlvs in LSPA Object.
264 *
265 * @param llOptionalTlv list of Optional Tlvs
266 * @return builder by setting list of Optional Tlvs
267 */
268 Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
269
270 /**
271 * Sets P flag in LSPA object header and returns its builder.
272 *
273 * @param value boolean value to set P flag
274 * @return Builder by setting P flag
275 */
276 Builder setPFlag(boolean value);
277
278 /**
279 * Sets I flag in LSPA object header and returns its builder.
280 *
281 * @param value boolean value to set I flag
282 * @return Builder by setting I flag
283 */
284 Builder setIFlag(boolean value);
285 }
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -0700286}