blob: 932a225ad67d22ed430fff5097d94fec1a2b2fe3 [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 RP Object.
27 */
28public interface PcepRPObject {
29
30 /**
31 * Returns RequestId Number in RP Object.
32 *
33 * @return RequestId Number in RP Object
34 */
35 int getRequestIdNum();
36
37 /**
38 * Sets RequestId Number with specified value.
39 *
40 * @param value RequestId Number
41 */
42 void setRequestIdNum(int value);
43
44 /**
45 * Returns O flag in RP Object.
46 *
47 * @return O flag in RP Object
48 */
49 boolean getOFlag();
50
51 /**
52 * Sets O flag with specified value.
53 *
54 * @param value O flag
55 */
56 void setOFlag(boolean value);
57
58 /**
59 * Returns B flag in RP Object.
60 *
61 * @return B flag in RP Object
62 */
63 boolean getBFlag();
64
65 /**
66 * Sets B flag with specified value.
67 *
68 * @param value B flag
69 */
70 void setBFlag(boolean value);
71
72 /**
73 * Returns R flag in RP Object.
74 *
75 * @return R flag in RP Object
76 */
77 boolean getRFlag();
78
79 /**
80 * Sets R flag with specified value.
81 *
82 * @param value R flag
83 */
84 void setRFlag(boolean value);
85
86 /**
87 * Returns Priority Flag in RP Object.
88 *
89 * @return Priority Flag in RP Object
90 */
91 byte getPriFlag();
92
93 /**
94 * Sets Priority Flag with specified value.
95 *
96 * @param value Priority Flag
97 */
98 void setPriFlag(byte value);
99
100 /**
101 * Returns list of Optional Tlvs in RP Object.
102 *
103 * @return list of Optional Tlvs in RP Object
104 */
105 LinkedList<PcepValueType> getOptionalTlv();
106
107 /**
108 * Sets list of Optional Tlvs in RP Object and returns its builder.
109 *
110 * @param llOptionalTlv list of Optional Tlvs
111 */
112 void setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
113
114 /**
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700115 * Writes the RP Object into channel buffer.
116 *
117 * @param bb channel buffer
118 * @return Returns the writerIndex of this buffer
119 * @throws PcepParseException while writing RP object into Channel Buffer.
120 */
121 int write(ChannelBuffer bb) throws PcepParseException;
122
123 /**
124 * Builder interface with get and set functions to build bandwidth object.
125 */
Sho SHIMIZU260f6ef2015-08-11 13:53:31 -0700126 interface Builder {
Sho SHIMIZU74361c12015-08-11 12:31:48 -0700127
128 /**
129 * Builds RP Object.
130 *
131 * @return RP Object
132 */
133 PcepRPObject build();
134
135 /**
136 * Returns RP object header.
137 *
138 * @return RP object header
139 */
140 PcepObjectHeader getRPObjHeader();
141
142 /**
143 * Sets RP object header and returns its builder.
144 *
145 * @param obj RP object header
146 * @return Builder by setting RP object header
147 */
148 Builder setRPObjHeader(PcepObjectHeader obj);
149
150 /**
151 * Returns Request Id Number in RP Object.
152 *
153 * @return Request Id Number in RP Object
154 */
155 int getRequestIdNum();
156
157 /**
158 * Sets Request Id Number and returns its builder.
159 *
160 * @param value Request Id Number
161 * @return Builder by setting Request Id Number
162 */
163 Builder setRequestIdNum(int value);
164
165 /**
166 * Returns O flag in RP Object.
167 *
168 * @return O flag in RP Object
169 */
170 boolean getOFlag();
171
172 /**
173 * Sets O flag and returns its builder.
174 *
175 * @param value O flag
176 * @return Builder by setting O flag
177 */
178 Builder setOFlag(boolean value);
179
180 /**
181 * Returns B flag in RP Object.
182 *
183 * @return B flag in RP Object
184 */
185 boolean getBFlag();
186
187 /**
188 * Sets B flag and returns its builder.
189 *
190 * @param value B flag
191 * @return Builder by setting B flag
192 */
193 Builder setBFlag(boolean value);
194
195 /**
196 * Returns R flag in RP Object.
197 *
198 * @return R flag in RP Object
199 */
200 boolean getRFlag();
201
202 /**
203 * Sets R flag and returns its builder.
204 *
205 * @param value R flag
206 * @return Builder by setting R flag
207 */
208 Builder setRFlag(boolean value);
209
210 /**
211 * Returns Priority Flag in RP Object.
212 *
213 * @return Priority Flag in RP Object
214 */
215 byte getPriFlag();
216
217 /**
218 * Sets Priority Flag and returns its builder.
219 *
220 * @param value Priority Flag
221 * @return Builder by setting Priority Flag
222 */
223 Builder setPriFlag(byte value);
224
225 /**
226 * Returns list of Optional Tlvs in RP Object.
227 *
228 * @return list of Optional Tlvs
229 */
230 LinkedList<PcepValueType> getOptionalTlv();
231
232 /**
233 * Sets list of Optional Tlvs and returns its builder.
234 *
235 * @param llOptionalTlv list of Optional Tlvs
236 * @return Builder by setting list of Optional Tlvs
237 */
238 Builder setOptionalTlv(LinkedList<PcepValueType> llOptionalTlv);
239
240 /**
241 * Sets P flag in RP object header and returns its builder.
242 *
243 * @param value boolean value to set P flag
244 * @return Builder by setting P flag
245 */
246 Builder setPFlag(boolean value);
247
248 /**
249 * Sets I flag in RP object header and returns its builder.
250 *
251 * @param value boolean value to set I flag
252 * @return Builder by setting I flag
253 */
254 Builder setIFlag(boolean value);
255 }
256}