blob: 1db8137544438979e6b7934179e4472e0eba4060 [file] [log] [blame]
Thomas Vachuska58de4162015-09-10 16:15:33 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
Thomas Vachuska58de4162015-09-10 16:15:33 -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 */
lishuai2ddc4692015-07-31 15:15:16 +080016package org.onosproject.ovsdb.rfc.table;
17
18import java.util.Map;
19import java.util.Set;
20
21import org.onosproject.ovsdb.rfc.notation.Column;
22import org.onosproject.ovsdb.rfc.notation.Row;
Jonathan Hart51539b82015-10-29 09:53:04 -070023import org.onosproject.ovsdb.rfc.notation.Uuid;
lishuai2ddc4692015-07-31 15:15:16 +080024import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
25import org.onosproject.ovsdb.rfc.tableservice.AbstractOvsdbTableService;
26import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription;
27
28/**
29 * This class provides operations of Port Table.
30 */
31public class Port extends AbstractOvsdbTableService {
32
33 /**
34 * Port table column name.
35 */
36 public enum PortColumn {
37 NAME("name"), INTERFACES("interfaces"), TRUNKS("trunks"), TAG("tag"),
38 VLANMODE("vlan_mode"), QOS("qos"), MAC("mac"), BONDTYPE("bond_type"),
39 BONDMODE("bond_mode"), LACP("lacp"), BONDUPDELAY("bond_updelay"),
40 BONDDOWNDELAY("bond_downdelay"), BONDFAKEIFACE("bond_fake_iface"),
41 FAKEBRIDGE("fake_bridge"), STATUS("status"), STATISTICS("statistics"),
42 OTHERCONFIG("other_config"), EXTERNALIDS("external_ids");
43
44 private final String columnName;
45
46 private PortColumn(String columnName) {
47 this.columnName = columnName;
48 }
49
50 /**
51 * Returns the table column name for PortColumn.
52 * @return the table column name
53 */
54 public String columnName() {
55 return columnName;
56 }
57 }
58
59 /**
60 * Constructs a Port object. Generate Port Table Description.
61 * @param dbSchema DatabaseSchema
62 * @param row Row
63 */
64 public Port(DatabaseSchema dbSchema, Row row) {
65 super(dbSchema, row, OvsdbTable.PORT, VersionNum.VERSION100);
66 }
67
68 /**
69 * Get the Column entity which column name is "name" from the Row entity of
70 * attributes.
71 * @return the Column entity
72 */
73 public Column getNameColumn() {
74 ColumnDescription columndesc = new ColumnDescription(
75 PortColumn.NAME
76 .columnName(),
77 "getNameColumn",
78 VersionNum.VERSION100);
79 return (Column) super.getColumnHandler(columndesc);
80 }
81
82 /**
83 * Add a Column entity which column name is "name" to the Row entity of
84 * attributes.
85 * @param name the column data which column name is "name"
86 */
87 public void setName(String name) {
88 ColumnDescription columndesc = new ColumnDescription(
89 PortColumn.NAME
90 .columnName(),
91 "setName",
92 VersionNum.VERSION100);
93 super.setDataHandler(columndesc, name);
94 }
95
96 /**
97 * Get the Column entity which column name is "name" from the Row entity of
98 * attributes.
99 * @return the Column entity
100 */
101 public String getName() {
102 ColumnDescription columndesc = new ColumnDescription(
103 PortColumn.NAME
104 .columnName(),
105 "getName",
106 VersionNum.VERSION100);
107 return (String) super.getDataHandler(columndesc);
108 }
109
110 /**
111 * Get the Column entity which column name is "interfaces" from the Row
112 * entity of attributes.
113 * @return the Column entity
114 */
115 public Column getInterfacesColumn() {
116 ColumnDescription columndesc = new ColumnDescription(
117 PortColumn.INTERFACES
118 .columnName(),
119 "getInterfacesColumn",
120 VersionNum.VERSION100);
121 return (Column) super.getColumnHandler(columndesc);
122 }
123
124 /**
125 * Add a Column entity which column name is "interfaces" to the Row entity
126 * of attributes.
127 * @param interfaces the column data which column name is "interfaces"
128 */
Jonathan Hart51539b82015-10-29 09:53:04 -0700129 public void setInterfaces(Set<Uuid> interfaces) {
lishuai2ddc4692015-07-31 15:15:16 +0800130 ColumnDescription columndesc = new ColumnDescription(
131 PortColumn.INTERFACES
132 .columnName(),
133 "setInterfaces",
134 VersionNum.VERSION100);
135 super.setDataHandler(columndesc, interfaces);
136 }
137
138 /**
139 * Get the Column entity which column name is "trunks" from the Row entity
140 * of attributes.
141 * @return the Column entity
142 */
143 public Column getTrunksColumn() {
144 ColumnDescription columndesc = new ColumnDescription(
145 PortColumn.TRUNKS
146 .columnName(),
147 "getTrunksColumn",
148 VersionNum.VERSION100);
149 return (Column) super.getColumnHandler(columndesc);
150 }
151
152 /**
153 * Add a Column entity which column name is "trunks" to the Row entity of
154 * attributes.
155 * @param trunks the column data which column name is "trunks"
156 */
157 public void setTrunks(Set<Long> trunks) {
158 ColumnDescription columndesc = new ColumnDescription(
159 PortColumn.TRUNKS
160 .columnName(),
161 "setTrunks",
162 VersionNum.VERSION100);
163 super.setDataHandler(columndesc, trunks);
164 }
165
166 /**
167 * Get the Column entity which column name is "tag" from the Row entity of
168 * attributes.
169 * @return the Column entity
170 */
171 public Column getTagColumn() {
172 ColumnDescription columndesc = new ColumnDescription(
173 PortColumn.TAG
174 .columnName(),
175 "getTagColumn",
176 VersionNum.VERSION100);
177 return (Column) super.getColumnHandler(columndesc);
178 }
179
180 /**
181 * Add a Column entity which column name is "tag" to the Row entity of
182 * attributes.
183 * @param tag the column data which column name is "tag"
184 */
185 public void setTag(Set<Long> tag) {
186 ColumnDescription columndesc = new ColumnDescription(
187 PortColumn.TAG
188 .columnName(),
189 "setTag",
190 VersionNum.VERSION100);
191 super.setDataHandler(columndesc, tag);
192 }
193
194 /**
195 * Get the Column entity which column name is "vlan_mode" from the Row
196 * entity of attributes.
197 * @return the Column entity
198 */
199 public Column getVlanModeColumn() {
200 ColumnDescription columndesc = new ColumnDescription(
201 PortColumn.VLANMODE
202 .columnName(),
203 "getVlanModeColumn",
204 VersionNum.VERSION610);
205 return (Column) super.getColumnHandler(columndesc);
206 }
207
208 /**
209 * Add a Column entity which column name is "vlan_mode" to the Row entity of
210 * attributes.
211 * @param vlanMode the column data which column name is "vlan_mode"
212 */
213 public void setVlanMode(Set<String> vlanMode) {
214 ColumnDescription columndesc = new ColumnDescription(
215 PortColumn.VLANMODE
216 .columnName(),
217 "setVlanMode",
218 VersionNum.VERSION610);
219 super.setDataHandler(columndesc, vlanMode);
220 }
221
222 /**
223 * Get the Column entity which column name is "qos" from the Row entity of
224 * attributes.
225 * @return the Column entity
226 */
227 public Column getQosColumn() {
228 ColumnDescription columndesc = new ColumnDescription(
229 PortColumn.QOS
230 .columnName(),
231 "getQosColumn",
232 VersionNum.VERSION100);
233 return (Column) super.getColumnHandler(columndesc);
234 }
235
236 /**
237 * Add a Column entity which column name is "qos" to the Row entity of
238 * attributes.
239 * @param qos the column data which column name is "qos"
Frank Wange11a98d2016-10-26 17:04:03 +0800240 */
241 public void setQos(Uuid qos) {
242 ColumnDescription columndesc = new ColumnDescription(
lishuai2ddc4692015-07-31 15:15:16 +0800243 PortColumn.QOS
244 .columnName(),
245 "setQos",
246 VersionNum.VERSION100);
247 super.setDataHandler(columndesc, qos);
248 }
249
250 /**
251 * Get the Column entity which column name is "mac" from the Row entity of
252 * attributes.
253 * @return the Column entity
254 */
255 public Column getMacColumn() {
256 ColumnDescription columndesc = new ColumnDescription(
257 PortColumn.MAC
258 .columnName(),
259 "getMacColumn",
260 VersionNum.VERSION100);
261 return (Column) super.getColumnHandler(columndesc);
262 }
263
264 /**
265 * Add a Column entity which column name is "mac" to the Row entity of
266 * attributes.
267 * @param mac the column data which column name is "mac"
268 */
269 public void setMac(Set<String> mac) {
270 ColumnDescription columndesc = new ColumnDescription(
271 PortColumn.MAC
272 .columnName(),
273 "setMac",
274 VersionNum.VERSION100);
275 super.setDataHandler(columndesc, mac);
276 }
277
278 /**
279 * Get the Column entity which column name is "bond_type" from the Row
280 * entity of attributes.
281 * @return the Column entity
282 */
283 public Column getBondTypeColumn() {
284 ColumnDescription columndesc = new ColumnDescription(
285 PortColumn.BONDTYPE
286 .columnName(),
287 "getBondTypeColumn",
288 VersionNum.VERSION102,
289 VersionNum.VERSION103);
290 return (Column) super.getColumnHandler(columndesc);
291 }
292
293 /**
294 * Add a Column entity which column name is "bond_type" to the Row entity of
295 * attributes.
296 * @param bondtype the column data which column name is "bond_type"
297 */
298 public void setBondType(Set<String> bondtype) {
299 ColumnDescription columndesc = new ColumnDescription(
300 PortColumn.BONDTYPE
301 .columnName(),
302 "setBondType",
303 VersionNum.VERSION102,
304 VersionNum.VERSION103);
305 super.setDataHandler(columndesc, bondtype);
306 }
307
308 /**
309 * Get the Column entity which column name is "bond_mode" from the Row
310 * entity of attributes.
311 * @return the Column entity
312 */
313 public Column getBondModeColumn() {
314 ColumnDescription columndesc = new ColumnDescription(
315 PortColumn.BONDMODE
316 .columnName(),
317 "getBondModeColumn",
318 VersionNum.VERSION104);
319 return (Column) super.getColumnHandler(columndesc);
320 }
321
322 /**
323 * Add a Column entity which column name is "bond_mode" to the Row entity of
324 * attributes.
325 * @param bondmode the column data which column name is "bond_mode"
326 */
327 public void setBondMode(Set<String> bondmode) {
328 ColumnDescription columndesc = new ColumnDescription(
329 PortColumn.BONDMODE
330 .columnName(),
331 "setBondMode",
332 VersionNum.VERSION104);
333 super.setDataHandler(columndesc, bondmode);
334 }
335
336 /**
337 * Get the Column entity which column name is "lacp" from the Row entity of
338 * attributes.
339 * @return the Column entity
340 */
341 public Column getLacpColumn() {
342 ColumnDescription columndesc = new ColumnDescription(
343 PortColumn.LACP
344 .columnName(),
345 "getLacpColumn",
346 VersionNum.VERSION130);
347 return (Column) super.getColumnHandler(columndesc);
348 }
349
350 /**
351 * Add a Column entity which column name is "lacp" to the Row entity of
352 * attributes.
353 * @param lacp the column data which column name is "lacp"
354 */
355 public void setLacp(Set<String> lacp) {
356 ColumnDescription columndesc = new ColumnDescription(
357 PortColumn.LACP
358 .columnName(),
359 "setLacp",
360 VersionNum.VERSION130);
361 super.setDataHandler(columndesc, lacp);
362 }
363
364 /**
365 * Get the Column entity which column name is "bond_updelay" from the Row
366 * entity of attributes.
367 * @return the Column entity
368 */
369 public Column getBondUpDelayColumn() {
370 ColumnDescription columndesc = new ColumnDescription(
371 PortColumn.BONDUPDELAY
372 .columnName(),
373 "getBondUpDelayColumn",
374 VersionNum.VERSION100);
375 return (Column) super.getColumnHandler(columndesc);
376 }
377
378 /**
379 * Add a Column entity which column name is "bond_updelay" to the Row entity
380 * of attributes.
381 * @param bondUpDelay the column data which column name is "bond_updelay"
382 */
383 public void setBondUpDelay(Set<Long> bondUpDelay) {
384 ColumnDescription columndesc = new ColumnDescription(
385 PortColumn.BONDUPDELAY
386 .columnName(),
387 "setBondUpDelay",
388 VersionNum.VERSION100);
389 super.setDataHandler(columndesc, bondUpDelay);
390 }
391
392 /**
393 * Get the Column entity which column name is "bond_downdelay" from the Row
394 * entity of attributes.
395 * @return the Column entity
396 */
397 public Column getBondDownDelayColumn() {
398 ColumnDescription columndesc = new ColumnDescription(
399 PortColumn.BONDDOWNDELAY
400 .columnName(),
401 "getBondDownDelayColumn",
402 VersionNum.VERSION100);
403 return (Column) super.getColumnHandler(columndesc);
404 }
405
406 /**
407 * Add a Column entity which column name is "bond_downdelay" to the Row
408 * entity of attributes.
409 * @param bondDownDelay the column data which column name is
410 * "bond_downdelay"
411 */
412 public void setBondDownDelay(Set<Long> bondDownDelay) {
413 ColumnDescription columndesc = new ColumnDescription(
414 PortColumn.BONDDOWNDELAY
415 .columnName(),
416 "setBondDownDelay",
417 VersionNum.VERSION100);
418 super.setDataHandler(columndesc, bondDownDelay);
419 }
420
421 /**
422 * Get the Column entity which column name is "bond_fake_iface" from the Row
423 * entity of attributes.
424 * @return the Column entity
425 */
426 public Column getBondFakeInterfaceColumn() {
427 ColumnDescription columndesc = new ColumnDescription(
428 PortColumn.BONDFAKEIFACE
429 .columnName(),
430 "getBondFakeInterfaceColumn",
431 VersionNum.VERSION100);
432 return (Column) super.getColumnHandler(columndesc);
433 }
434
435 /**
436 * Add a Column entity which column name is "bond_fake_iface" to the Row
437 * entity of attributes.
438 * @param bondFakeInterface the column data which column name is
439 * "bond_fake_iface"
440 */
441 public void setBondFakeInterface(Set<Boolean> bondFakeInterface) {
442 ColumnDescription columndesc = new ColumnDescription(
443 PortColumn.BONDFAKEIFACE
444 .columnName(),
445 "setBondFakeInterface",
446 VersionNum.VERSION100);
447 super.setDataHandler(columndesc, bondFakeInterface);
448 }
449
450 /**
451 * Get the Column entity which column name is "fake_bridge" from the Row
452 * entity of attributes.
453 * @return the Column entity
454 */
455 public Column getFakeBridgeColumn() {
456 ColumnDescription columndesc = new ColumnDescription(
457 PortColumn.FAKEBRIDGE
458 .columnName(),
459 "getFakeBridgeColumn",
460 VersionNum.VERSION100);
461 return (Column) super.getColumnHandler(columndesc);
462 }
463
464 /**
465 * Add a Column entity which column name is "fake_bridge" to the Row entity
466 * of attributes.
467 * @param fakeBridge the column data which column name is "fake_bridge"
468 */
469 public void setFakeBridge(Set<Boolean> fakeBridge) {
470 ColumnDescription columndesc = new ColumnDescription(
471 PortColumn.FAKEBRIDGE
472 .columnName(),
473 "setFakeBridge",
474 VersionNum.VERSION100);
475 super.setDataHandler(columndesc, fakeBridge);
476 }
477
478 /**
479 * Get the Column entity which column name is "status" from the Row entity
480 * of attributes.
481 * @return the Column entity
482 */
483 public Column getStatusColumn() {
484 ColumnDescription columndesc = new ColumnDescription(
485 PortColumn.STATUS
486 .columnName(),
487 "getStatusColumn",
488 VersionNum.VERSION620);
489 return (Column) super.getColumnHandler(columndesc);
490 }
491
492 /**
493 * Add a Column entity which column name is "status" to the Row entity of
494 * attributes.
495 * @param status the column data which column name is "status"
496 */
497 public void setStatus(Map<String, String> status) {
498 ColumnDescription columndesc = new ColumnDescription(
499 PortColumn.STATUS
500 .columnName(),
501 "setStatus",
502 VersionNum.VERSION620);
503 super.setDataHandler(columndesc, status);
504 }
505
506 /**
507 * Get the Column entity which column name is "statistics" from the Row
508 * entity of attributes.
509 * @return the Column entity
510 */
511 public Column getStatisticsColumn() {
512 ColumnDescription columndesc = new ColumnDescription(
513 PortColumn.STATISTICS
514 .columnName(),
515 "getStatisticsColumn",
516 VersionNum.VERSION630);
517 return (Column) super.getColumnHandler(columndesc);
518 }
519
520 /**
521 * Add a Column entity which column name is "statistics" to the Row entity
522 * of attributes.
523 * @param statistics the column data which column name is "statistics"
524 */
525 public void setStatistics(Map<String, Long> statistics) {
526 ColumnDescription columndesc = new ColumnDescription(
527 PortColumn.STATISTICS
528 .columnName(),
529 "setStatistics",
530 VersionNum.VERSION630);
531 super.setDataHandler(columndesc, statistics);
532 }
533
534 /**
535 * Get the Column entity which column name is "other_config" from the Row
536 * entity of attributes.
537 * @return the Column entity
538 */
539 public Column getOtherConfigColumn() {
540 ColumnDescription columndesc = new ColumnDescription(
541 PortColumn.OTHERCONFIG
542 .columnName(),
543 "getOtherConfigColumn",
544 VersionNum.VERSION100);
545 return (Column) super.getColumnHandler(columndesc);
546 }
547
548 /**
549 * Add a Column entity which column name is "other_config" to the Row entity
550 * of attributes.
551 * @param otherConfig the column data which column name is "other_config"
552 */
553 public void setOtherConfig(Map<String, String> otherConfig) {
554 ColumnDescription columndesc = new ColumnDescription(
555 PortColumn.OTHERCONFIG
556 .columnName(),
557 "setOtherConfig",
558 VersionNum.VERSION100);
559 super.setDataHandler(columndesc, otherConfig);
560 }
561
562 /**
563 * Get the Column entity which column name is "external_ids" from the Row
564 * entity of attributes.
565 * @return the Column entity
566 */
567 public Column getExternalIdsColumn() {
568 ColumnDescription columndesc = new ColumnDescription(
569 PortColumn.EXTERNALIDS
570 .columnName(),
571 "getExternalIdsColumn",
572 VersionNum.VERSION100);
573 return (Column) super.getColumnHandler(columndesc);
574 }
575
576 /**
577 * Add a Column entity which column name is "external_ids" to the Row entity
578 * of attributes.
579 * @param externalIds the column data which column name is "external_ids"
580 */
581 public void setExternalIds(Map<String, String> externalIds) {
582 ColumnDescription columndesc = new ColumnDescription(
583 PortColumn.EXTERNALIDS
584 .columnName(),
585 "setExternalIds",
586 VersionNum.VERSION100);
587 super.setDataHandler(columndesc, externalIds);
588 }
589
590}