blob: c2b52d51b86dded82bad6ff789873a28b520338b [file] [log] [blame]
Sho SHIMIZU74361c12015-08-11 12:31:48 -07001/*
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 */
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 /**
129 * Prints attributes of LSPA object.
130 */
131 void print();
132
133 /**
134 * Writes the LSPA Object into channel buffer.
135 *
136 * @param bb channel buffer
137 * @return Returns the writerIndex of this buffer
138 * @throws PcepParseException while writing LSPA object into Channel Buffer.
139 */
140 int write(ChannelBuffer bb) throws PcepParseException;
141
142 /**
143 * Builder interface with get and set functions to build bandwidth object.
144 */
145 public interface Builder {
146
147 /**
148 * Builds LSPA Object.
149 *
150 * @return LSPA Object
151 * @throws PcepParseException while building LSPA object.
152 */
153 PcepLspaObject build() throws PcepParseException;
154
155 /**
156 * Returns LSPA object header.
157 *
158 * @return LSPA object header
159 */
160 PcepObjectHeader getLspaObjHeader();
161
162 /**
163 * Sets LSPA object header and returns its builder.
164 *
165 * @param obj LSPA object header
166 * @return Builder by setting LSPA object header
167 */
168 Builder setLspaObjHeader(PcepObjectHeader obj);
169
170 /**
171 * Returns L flag in LSPA Object.
172 *
173 * @return L flag in LSPA Object
174 */
175 boolean getLFlag();
176
177 /**
178 * Sets L flag in LSPA Object and return its builder.
179 *
180 * @param value L flag in LSPA Object
181 * @return Builder by setting L flag
182 */
183 Builder setLFlag(boolean value);
184
185 /**
186 * Returns Exclude Any field in LSPA Object.
187 *
188 * @return Exclude Any field in LSPA Object
189 */
190 int getExcludeAny();
191
192 /**
193 * Sets Exclude Any field in LSPA Object and return its builder.
194 *
195 * @param value Exclude Any field in LSPA Object
196 * @return Builder by setting Exclude Any field
197 */
198 Builder setExcludeAny(int value);
199
200 /**
201 * Returns Include Any field in LSPA Object.
202 *
203 * @return Include Any field in LSPA Object
204 */
205 int getIncludeAny();
206
207 /**
208 * Sets Include Any field in LSPA Object and return its builder.
209 *
210 * @param value Include Any field in LSPA Object
211 * @return Builder by setting Include Any field
212 */
213 Builder setIncludeAny(int value);
214
215 /**
216 * Returns Include All field in LSPA Object.
217 *
218 * @return Include All field in LSPA Object
219 */
220 int getIncludeAll();
221
222 /**
223 * Sets Include All field in LSPA Object and return its builder.
224 *
225 * @param value Include All field in LSPA Object
226 * @return Builder by setting Include All field
227 */
228 Builder setIncludeAll(int value);
229
230 /**
231 * Returns Setup Priority field in LSPA Object.
232 *
233 * @return Setup Priority field in LSPA Object
234 */
235 byte getSetupPriority();
236
237 /**
238 * Sets Setup Priority field in LSPA Object and return its builder.
239 *
240 * @param value Setup Priority field in LSPA Object
241 * @return Builder by setting Setup Priority field
242 */
243 Builder setSetupPriority(byte value);
244
245 /**
246 * Returns Hold Priority field in LSPA Object.
247 *
248 * @return Hold Priority field in LSPA Object
249 */
250 byte getHoldPriority();
251
252 /**
253 * Sets Hold Priority field in LSPA Object and return its builder.
254 *
255 * @param value Hold Priority field in LSPA Object
256 * @return Builder by setting Hold Priority field
257 */
258 Builder setHoldPriority(byte value);
259
260 /**
261 * Returns list of Optional Tlvs in LSPA Object.
262 *
263 * @return list of Optional Tlvs in LSPA Object
264 */
265 LinkedList<PcepValueType> getOptionalTlv();
266
267 /**
268 * Sets list of Optional Tlvs in LSPA Object.
269 *
270 * @param llOptionalTlv list of Optional Tlvs
271 * @return builder by setting list of Optional Tlvs
272 */
273 Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
274
275 /**
276 * Sets P flag in LSPA object header and returns its builder.
277 *
278 * @param value boolean value to set P flag
279 * @return Builder by setting P flag
280 */
281 Builder setPFlag(boolean value);
282
283 /**
284 * Sets I flag in LSPA object header and returns its builder.
285 *
286 * @param value boolean value to set I flag
287 * @return Builder by setting I flag
288 */
289 Builder setIFlag(boolean value);
290 }
Phaneendra Manda1c0061d2015-08-06 12:29:38 +0530291}