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