blob: 60ccdb5e0470959c023dc0e181b7b126a6b0c6cb [file] [log] [blame]
Thomas Vachuska58de4162015-09-10 16:15:33 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
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 * @deprecated in Junco (1.9.1), use version with Uuid instead
lishuai2ddc4692015-07-31 15:15:16 +0800241 */
Frank Wange11a98d2016-10-26 17:04:03 +0800242 @Deprecated
Jonathan Hart51539b82015-10-29 09:53:04 -0700243 public void setQos(Set<Uuid> qos) {
lishuai2ddc4692015-07-31 15:15:16 +0800244 ColumnDescription columndesc = new ColumnDescription(
Frank Wange11a98d2016-10-26 17:04:03 +0800245 PortColumn.QOS
246 .columnName(),
247 "setQos",
248 VersionNum.VERSION100);
249 super.setDataHandler(columndesc, qos);
250 }
251
252 /**
253 * Add a Column entity which column name is "qos" to the Row entity of
254 * attributes.
255 * @param qos the column data which column name is "qos"
256 */
257 public void setQos(Uuid qos) {
258 ColumnDescription columndesc = new ColumnDescription(
lishuai2ddc4692015-07-31 15:15:16 +0800259 PortColumn.QOS
260 .columnName(),
261 "setQos",
262 VersionNum.VERSION100);
263 super.setDataHandler(columndesc, qos);
264 }
265
266 /**
267 * Get the Column entity which column name is "mac" from the Row entity of
268 * attributes.
269 * @return the Column entity
270 */
271 public Column getMacColumn() {
272 ColumnDescription columndesc = new ColumnDescription(
273 PortColumn.MAC
274 .columnName(),
275 "getMacColumn",
276 VersionNum.VERSION100);
277 return (Column) super.getColumnHandler(columndesc);
278 }
279
280 /**
281 * Add a Column entity which column name is "mac" to the Row entity of
282 * attributes.
283 * @param mac the column data which column name is "mac"
284 */
285 public void setMac(Set<String> mac) {
286 ColumnDescription columndesc = new ColumnDescription(
287 PortColumn.MAC
288 .columnName(),
289 "setMac",
290 VersionNum.VERSION100);
291 super.setDataHandler(columndesc, mac);
292 }
293
294 /**
295 * Get the Column entity which column name is "bond_type" from the Row
296 * entity of attributes.
297 * @return the Column entity
298 */
299 public Column getBondTypeColumn() {
300 ColumnDescription columndesc = new ColumnDescription(
301 PortColumn.BONDTYPE
302 .columnName(),
303 "getBondTypeColumn",
304 VersionNum.VERSION102,
305 VersionNum.VERSION103);
306 return (Column) super.getColumnHandler(columndesc);
307 }
308
309 /**
310 * Add a Column entity which column name is "bond_type" to the Row entity of
311 * attributes.
312 * @param bondtype the column data which column name is "bond_type"
313 */
314 public void setBondType(Set<String> bondtype) {
315 ColumnDescription columndesc = new ColumnDescription(
316 PortColumn.BONDTYPE
317 .columnName(),
318 "setBondType",
319 VersionNum.VERSION102,
320 VersionNum.VERSION103);
321 super.setDataHandler(columndesc, bondtype);
322 }
323
324 /**
325 * Get the Column entity which column name is "bond_mode" from the Row
326 * entity of attributes.
327 * @return the Column entity
328 */
329 public Column getBondModeColumn() {
330 ColumnDescription columndesc = new ColumnDescription(
331 PortColumn.BONDMODE
332 .columnName(),
333 "getBondModeColumn",
334 VersionNum.VERSION104);
335 return (Column) super.getColumnHandler(columndesc);
336 }
337
338 /**
339 * Add a Column entity which column name is "bond_mode" to the Row entity of
340 * attributes.
341 * @param bondmode the column data which column name is "bond_mode"
342 */
343 public void setBondMode(Set<String> bondmode) {
344 ColumnDescription columndesc = new ColumnDescription(
345 PortColumn.BONDMODE
346 .columnName(),
347 "setBondMode",
348 VersionNum.VERSION104);
349 super.setDataHandler(columndesc, bondmode);
350 }
351
352 /**
353 * Get the Column entity which column name is "lacp" from the Row entity of
354 * attributes.
355 * @return the Column entity
356 */
357 public Column getLacpColumn() {
358 ColumnDescription columndesc = new ColumnDescription(
359 PortColumn.LACP
360 .columnName(),
361 "getLacpColumn",
362 VersionNum.VERSION130);
363 return (Column) super.getColumnHandler(columndesc);
364 }
365
366 /**
367 * Add a Column entity which column name is "lacp" to the Row entity of
368 * attributes.
369 * @param lacp the column data which column name is "lacp"
370 */
371 public void setLacp(Set<String> lacp) {
372 ColumnDescription columndesc = new ColumnDescription(
373 PortColumn.LACP
374 .columnName(),
375 "setLacp",
376 VersionNum.VERSION130);
377 super.setDataHandler(columndesc, lacp);
378 }
379
380 /**
381 * Get the Column entity which column name is "bond_updelay" from the Row
382 * entity of attributes.
383 * @return the Column entity
384 */
385 public Column getBondUpDelayColumn() {
386 ColumnDescription columndesc = new ColumnDescription(
387 PortColumn.BONDUPDELAY
388 .columnName(),
389 "getBondUpDelayColumn",
390 VersionNum.VERSION100);
391 return (Column) super.getColumnHandler(columndesc);
392 }
393
394 /**
395 * Add a Column entity which column name is "bond_updelay" to the Row entity
396 * of attributes.
397 * @param bondUpDelay the column data which column name is "bond_updelay"
398 */
399 public void setBondUpDelay(Set<Long> bondUpDelay) {
400 ColumnDescription columndesc = new ColumnDescription(
401 PortColumn.BONDUPDELAY
402 .columnName(),
403 "setBondUpDelay",
404 VersionNum.VERSION100);
405 super.setDataHandler(columndesc, bondUpDelay);
406 }
407
408 /**
409 * Get the Column entity which column name is "bond_downdelay" from the Row
410 * entity of attributes.
411 * @return the Column entity
412 */
413 public Column getBondDownDelayColumn() {
414 ColumnDescription columndesc = new ColumnDescription(
415 PortColumn.BONDDOWNDELAY
416 .columnName(),
417 "getBondDownDelayColumn",
418 VersionNum.VERSION100);
419 return (Column) super.getColumnHandler(columndesc);
420 }
421
422 /**
423 * Add a Column entity which column name is "bond_downdelay" to the Row
424 * entity of attributes.
425 * @param bondDownDelay the column data which column name is
426 * "bond_downdelay"
427 */
428 public void setBondDownDelay(Set<Long> bondDownDelay) {
429 ColumnDescription columndesc = new ColumnDescription(
430 PortColumn.BONDDOWNDELAY
431 .columnName(),
432 "setBondDownDelay",
433 VersionNum.VERSION100);
434 super.setDataHandler(columndesc, bondDownDelay);
435 }
436
437 /**
438 * Get the Column entity which column name is "bond_fake_iface" from the Row
439 * entity of attributes.
440 * @return the Column entity
441 */
442 public Column getBondFakeInterfaceColumn() {
443 ColumnDescription columndesc = new ColumnDescription(
444 PortColumn.BONDFAKEIFACE
445 .columnName(),
446 "getBondFakeInterfaceColumn",
447 VersionNum.VERSION100);
448 return (Column) super.getColumnHandler(columndesc);
449 }
450
451 /**
452 * Add a Column entity which column name is "bond_fake_iface" to the Row
453 * entity of attributes.
454 * @param bondFakeInterface the column data which column name is
455 * "bond_fake_iface"
456 */
457 public void setBondFakeInterface(Set<Boolean> bondFakeInterface) {
458 ColumnDescription columndesc = new ColumnDescription(
459 PortColumn.BONDFAKEIFACE
460 .columnName(),
461 "setBondFakeInterface",
462 VersionNum.VERSION100);
463 super.setDataHandler(columndesc, bondFakeInterface);
464 }
465
466 /**
467 * Get the Column entity which column name is "fake_bridge" from the Row
468 * entity of attributes.
469 * @return the Column entity
470 */
471 public Column getFakeBridgeColumn() {
472 ColumnDescription columndesc = new ColumnDescription(
473 PortColumn.FAKEBRIDGE
474 .columnName(),
475 "getFakeBridgeColumn",
476 VersionNum.VERSION100);
477 return (Column) super.getColumnHandler(columndesc);
478 }
479
480 /**
481 * Add a Column entity which column name is "fake_bridge" to the Row entity
482 * of attributes.
483 * @param fakeBridge the column data which column name is "fake_bridge"
484 */
485 public void setFakeBridge(Set<Boolean> fakeBridge) {
486 ColumnDescription columndesc = new ColumnDescription(
487 PortColumn.FAKEBRIDGE
488 .columnName(),
489 "setFakeBridge",
490 VersionNum.VERSION100);
491 super.setDataHandler(columndesc, fakeBridge);
492 }
493
494 /**
495 * Get the Column entity which column name is "status" from the Row entity
496 * of attributes.
497 * @return the Column entity
498 */
499 public Column getStatusColumn() {
500 ColumnDescription columndesc = new ColumnDescription(
501 PortColumn.STATUS
502 .columnName(),
503 "getStatusColumn",
504 VersionNum.VERSION620);
505 return (Column) super.getColumnHandler(columndesc);
506 }
507
508 /**
509 * Add a Column entity which column name is "status" to the Row entity of
510 * attributes.
511 * @param status the column data which column name is "status"
512 */
513 public void setStatus(Map<String, String> status) {
514 ColumnDescription columndesc = new ColumnDescription(
515 PortColumn.STATUS
516 .columnName(),
517 "setStatus",
518 VersionNum.VERSION620);
519 super.setDataHandler(columndesc, status);
520 }
521
522 /**
523 * Get the Column entity which column name is "statistics" from the Row
524 * entity of attributes.
525 * @return the Column entity
526 */
527 public Column getStatisticsColumn() {
528 ColumnDescription columndesc = new ColumnDescription(
529 PortColumn.STATISTICS
530 .columnName(),
531 "getStatisticsColumn",
532 VersionNum.VERSION630);
533 return (Column) super.getColumnHandler(columndesc);
534 }
535
536 /**
537 * Add a Column entity which column name is "statistics" to the Row entity
538 * of attributes.
539 * @param statistics the column data which column name is "statistics"
540 */
541 public void setStatistics(Map<String, Long> statistics) {
542 ColumnDescription columndesc = new ColumnDescription(
543 PortColumn.STATISTICS
544 .columnName(),
545 "setStatistics",
546 VersionNum.VERSION630);
547 super.setDataHandler(columndesc, statistics);
548 }
549
550 /**
551 * Get the Column entity which column name is "other_config" from the Row
552 * entity of attributes.
553 * @return the Column entity
554 */
555 public Column getOtherConfigColumn() {
556 ColumnDescription columndesc = new ColumnDescription(
557 PortColumn.OTHERCONFIG
558 .columnName(),
559 "getOtherConfigColumn",
560 VersionNum.VERSION100);
561 return (Column) super.getColumnHandler(columndesc);
562 }
563
564 /**
565 * Add a Column entity which column name is "other_config" to the Row entity
566 * of attributes.
567 * @param otherConfig the column data which column name is "other_config"
568 */
569 public void setOtherConfig(Map<String, String> otherConfig) {
570 ColumnDescription columndesc = new ColumnDescription(
571 PortColumn.OTHERCONFIG
572 .columnName(),
573 "setOtherConfig",
574 VersionNum.VERSION100);
575 super.setDataHandler(columndesc, otherConfig);
576 }
577
578 /**
579 * Get the Column entity which column name is "external_ids" from the Row
580 * entity of attributes.
581 * @return the Column entity
582 */
583 public Column getExternalIdsColumn() {
584 ColumnDescription columndesc = new ColumnDescription(
585 PortColumn.EXTERNALIDS
586 .columnName(),
587 "getExternalIdsColumn",
588 VersionNum.VERSION100);
589 return (Column) super.getColumnHandler(columndesc);
590 }
591
592 /**
593 * Add a Column entity which column name is "external_ids" to the Row entity
594 * of attributes.
595 * @param externalIds the column data which column name is "external_ids"
596 */
597 public void setExternalIds(Map<String, String> externalIds) {
598 ColumnDescription columndesc = new ColumnDescription(
599 PortColumn.EXTERNALIDS
600 .columnName(),
601 "setExternalIds",
602 VersionNum.VERSION100);
603 super.setDataHandler(columndesc, externalIds);
604 }
605
606}