Thomas Vachuska | 58de416 | 2015-09-10 16:15:33 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Thomas Vachuska | 58de416 | 2015-09-10 16:15:33 -0700 | [diff] [blame] | 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 | */ |
lishuai | 2ddc469 | 2015-07-31 15:15:16 +0800 | [diff] [blame] | 16 | package org.onosproject.ovsdb.rfc.table; |
| 17 | |
| 18 | import java.util.Map; |
| 19 | import java.util.Set; |
| 20 | |
| 21 | import org.onosproject.ovsdb.rfc.notation.Column; |
| 22 | import org.onosproject.ovsdb.rfc.notation.Row; |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 23 | import org.onosproject.ovsdb.rfc.notation.Uuid; |
lishuai | 2ddc469 | 2015-07-31 15:15:16 +0800 | [diff] [blame] | 24 | import org.onosproject.ovsdb.rfc.schema.DatabaseSchema; |
| 25 | import org.onosproject.ovsdb.rfc.tableservice.AbstractOvsdbTableService; |
| 26 | import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription; |
| 27 | |
| 28 | /** |
| 29 | * This class provides operations of Open_vSwitch Table. |
| 30 | */ |
| 31 | public class OpenVSwitch extends AbstractOvsdbTableService { |
| 32 | |
| 33 | /** |
| 34 | * OpenVSwitch table column name. |
| 35 | */ |
| 36 | public enum OpenVSwitchColumn { |
| 37 | BRIDGES("bridges"), MANAGERS("managers"), |
| 38 | MANAGEROPTIONS("manager_options"), SSL("ssl"), |
| 39 | OTHERCONFIG("other_config"), EXTERNALIDS("external_ids"), |
| 40 | NEXTCFG("next_cfg"), CURCFG("cur_cfg"), CAPABILITIES("capabilities"), |
| 41 | STATISTICS("statistics"), OVSVERSION("ovs_version"), |
| 42 | DBVERSION("db_version"), SYSTEMTYPE("system_type"), |
| 43 | SYSTEMVERSION("system_version"); |
| 44 | |
| 45 | private final String columnName; |
| 46 | |
| 47 | private OpenVSwitchColumn(String columnName) { |
| 48 | this.columnName = columnName; |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * Returns the table column name for OpenVSwitchColumn. |
| 53 | * @return the table column name |
| 54 | */ |
| 55 | public String columnName() { |
| 56 | return columnName; |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Constructs a OpenVSwitch object. Generate Open_vSwitch Table Description. |
| 62 | * @param dbSchema DatabaseSchema |
| 63 | * @param row Row |
| 64 | */ |
| 65 | public OpenVSwitch(DatabaseSchema dbSchema, Row row) { |
| 66 | super(dbSchema, row, OvsdbTable.OPENVSWITCH, VersionNum.VERSION100); |
| 67 | } |
| 68 | |
| 69 | /** |
| 70 | * Get the Column entity which column name is "bridges" from the Row entity |
| 71 | * of attributes. |
| 72 | * @return the Column entity which column name is "bridges" |
| 73 | */ |
| 74 | public Column getBridgesColumn() { |
| 75 | ColumnDescription columndesc = new ColumnDescription( |
| 76 | OpenVSwitchColumn.BRIDGES |
| 77 | .columnName(), |
| 78 | "getBridgesColumn", |
| 79 | VersionNum.VERSION100); |
| 80 | return (Column) super.getColumnHandler(columndesc); |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Add a Column entity which column name is "bridges" to the Row entity of |
| 85 | * attributes. |
| 86 | * @param bridges the column data which column name is "bridges" |
| 87 | */ |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 88 | public void setBridges(Set<Uuid> bridges) { |
lishuai | 2ddc469 | 2015-07-31 15:15:16 +0800 | [diff] [blame] | 89 | ColumnDescription columndesc = new ColumnDescription( |
| 90 | OpenVSwitchColumn.BRIDGES |
| 91 | .columnName(), |
| 92 | "setBridges", |
| 93 | VersionNum.VERSION100); |
| 94 | super.setDataHandler(columndesc, bridges); |
| 95 | } |
| 96 | |
| 97 | /** |
| 98 | * Get the Column entity which column name is "managers" from the Row entity |
| 99 | * of attributes. |
| 100 | * @return the Column entity which column name is "managers" |
| 101 | */ |
| 102 | public Column getManagersColumn() { |
| 103 | ColumnDescription columndesc = new ColumnDescription( |
| 104 | OpenVSwitchColumn.MANAGERS |
| 105 | .columnName(), |
| 106 | "getManagersColumn", |
| 107 | VersionNum.VERSION100, |
| 108 | VersionNum.VERSION200); |
| 109 | return (Column) super.getDataHandler(columndesc); |
| 110 | } |
| 111 | |
| 112 | /** |
| 113 | * Add a Column entity which column name is "managers" to the Row entity of |
| 114 | * attributes. |
| 115 | * @param managers the column data which column name is "managers" |
| 116 | */ |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 117 | public void setManagers(Set<Uuid> managers) { |
lishuai | 2ddc469 | 2015-07-31 15:15:16 +0800 | [diff] [blame] | 118 | ColumnDescription columndesc = new ColumnDescription( |
| 119 | OpenVSwitchColumn.MANAGERS |
| 120 | .columnName(), |
| 121 | "setManagers", |
| 122 | VersionNum.VERSION100, |
| 123 | VersionNum.VERSION200); |
| 124 | super.setDataHandler(columndesc, managers); |
| 125 | } |
| 126 | |
| 127 | /** |
| 128 | * Get the Column entity which column name is "manager_options" from the Row |
| 129 | * entity of attributes. |
| 130 | * @return the Column entity which column name is "manager_options" |
| 131 | */ |
| 132 | public Column getManagerOptionsColumn() { |
| 133 | ColumnDescription columndesc = new ColumnDescription( |
| 134 | OpenVSwitchColumn.MANAGEROPTIONS |
| 135 | .columnName(), |
| 136 | "getManagerOptionsColumn", |
| 137 | VersionNum.VERSION100); |
| 138 | return (Column) super.getDataHandler(columndesc); |
| 139 | } |
| 140 | |
| 141 | /** |
| 142 | * Add a Column entity which column name is "manager_options" to the Row |
| 143 | * entity of attributes. |
| 144 | * @param managerOptions the column data which column name is |
| 145 | * "manager_options" |
| 146 | */ |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 147 | public void setManagerOptions(Set<Uuid> managerOptions) { |
lishuai | 2ddc469 | 2015-07-31 15:15:16 +0800 | [diff] [blame] | 148 | ColumnDescription columndesc = new ColumnDescription( |
| 149 | OpenVSwitchColumn.MANAGEROPTIONS |
| 150 | .columnName(), |
| 151 | "setManagerOptions", |
| 152 | VersionNum.VERSION100); |
| 153 | super.setDataHandler(columndesc, managerOptions); |
| 154 | } |
| 155 | |
| 156 | /** |
| 157 | * Get the Column entity which column name is "ssl" from the Row entity of |
| 158 | * attributes. |
| 159 | * @return the Column entity which column name is "ssl" |
| 160 | */ |
| 161 | public Column getSslColumn() { |
| 162 | ColumnDescription columndesc = new ColumnDescription( |
| 163 | OpenVSwitchColumn.SSL |
| 164 | .columnName(), |
| 165 | "getSslColumn", |
| 166 | VersionNum.VERSION100); |
| 167 | return (Column) super.getDataHandler(columndesc); |
| 168 | } |
| 169 | |
| 170 | /** |
| 171 | * Add a Column entity which column name is "ssl" to the Row entity of |
| 172 | * attributes. |
| 173 | * @param ssl the column data which column name is "ssl" |
| 174 | */ |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 175 | public void setSsl(Set<Uuid> ssl) { |
lishuai | 2ddc469 | 2015-07-31 15:15:16 +0800 | [diff] [blame] | 176 | ColumnDescription columndesc = new ColumnDescription( |
| 177 | OpenVSwitchColumn.SSL |
| 178 | .columnName(), |
| 179 | "setSsl", |
| 180 | VersionNum.VERSION100); |
| 181 | super.setDataHandler(columndesc, ssl); |
| 182 | } |
| 183 | |
| 184 | /** |
| 185 | * Get the Column entity which column name is "other_config" from the Row |
| 186 | * entity of attributes. |
| 187 | * @return the Column entity which column name is "other_config" |
| 188 | */ |
| 189 | public Column getOtherConfigColumn() { |
| 190 | ColumnDescription columndesc = new ColumnDescription( |
| 191 | OpenVSwitchColumn.OTHERCONFIG |
| 192 | .columnName(), |
| 193 | "getOtherConfigColumn", |
| 194 | VersionNum.VERSION510); |
| 195 | return (Column) super.getColumnHandler(columndesc); |
| 196 | } |
| 197 | |
| 198 | /** |
| 199 | * Add a Column entity which column name is "other_config" to the Row entity |
| 200 | * of attributes. |
| 201 | * @param otherConfig the column data which column name is "other_config" |
| 202 | */ |
| 203 | public void setOtherConfig(Map<String, String> otherConfig) { |
| 204 | ColumnDescription columndesc = new ColumnDescription( |
| 205 | OpenVSwitchColumn.OTHERCONFIG |
| 206 | .columnName(), |
| 207 | "setOtherConfig", |
| 208 | VersionNum.VERSION510); |
| 209 | super.setDataHandler(columndesc, otherConfig); |
| 210 | } |
| 211 | |
| 212 | /** |
| 213 | * Get the Column entity which column name is "external_ids" from the Row |
| 214 | * entity of attributes. |
| 215 | * @return the Column entity which column name is "external_ids" |
| 216 | */ |
| 217 | public Column getExternalIdsColumn() { |
| 218 | ColumnDescription columndesc = new ColumnDescription( |
| 219 | OpenVSwitchColumn.EXTERNALIDS |
| 220 | .columnName(), |
| 221 | "getExternalIdsColumn", |
| 222 | VersionNum.VERSION100); |
| 223 | return (Column) super.getColumnHandler(columndesc); |
| 224 | } |
| 225 | |
| 226 | /** |
| 227 | * Add a Column entity which column name is "external_ids" to the Row entity |
| 228 | * of attributes. |
| 229 | * @param externalIds the column data which column name is "external_ids" |
| 230 | */ |
| 231 | public void setExternalIds(Map<String, String> externalIds) { |
| 232 | ColumnDescription columndesc = new ColumnDescription( |
| 233 | OpenVSwitchColumn.EXTERNALIDS |
| 234 | .columnName(), |
| 235 | "setExternalIds", |
| 236 | VersionNum.VERSION100); |
| 237 | super.setDataHandler(columndesc, externalIds); |
| 238 | } |
| 239 | |
| 240 | /** |
| 241 | * Get the Column entity which column name is "next_cfg" from the Row entity |
| 242 | * of attributes. |
| 243 | * @return the Column entity which column name is "next_cfg" |
| 244 | */ |
| 245 | public Column getNextConfigColumn() { |
| 246 | ColumnDescription columndesc = new ColumnDescription( |
| 247 | OpenVSwitchColumn.NEXTCFG |
| 248 | .columnName(), |
| 249 | "getNextConfigColumn", |
| 250 | VersionNum.VERSION100); |
| 251 | return (Column) super.getColumnHandler(columndesc); |
| 252 | } |
| 253 | |
| 254 | /** |
| 255 | * Add a Column entity which column name is "next_cfg" to the Row entity of |
| 256 | * attributes. |
| 257 | * @param nextConfig the column data which column name is "next_cfg" |
| 258 | */ |
| 259 | public void setNextConfig(Long nextConfig) { |
| 260 | ColumnDescription columndesc = new ColumnDescription( |
| 261 | OpenVSwitchColumn.NEXTCFG |
| 262 | .columnName(), |
| 263 | "setNextConfig", |
| 264 | VersionNum.VERSION100); |
| 265 | super.setDataHandler(columndesc, nextConfig); |
| 266 | } |
| 267 | |
| 268 | /** |
| 269 | * Get the Column entity which column name is "cur_cfg" from the Row entity |
| 270 | * of attributes. |
| 271 | * @return the Column entity which column name is "cur_cfg" |
| 272 | */ |
| 273 | public Column getCurrentConfigColumn() { |
| 274 | ColumnDescription columndesc = new ColumnDescription( |
| 275 | OpenVSwitchColumn.CURCFG |
| 276 | .columnName(), |
| 277 | "getCurrentConfigColumn", |
| 278 | VersionNum.VERSION100); |
| 279 | return (Column) super.getColumnHandler(columndesc); |
| 280 | } |
| 281 | |
| 282 | /** |
| 283 | * Add a Column entity which column name is "cur_cfg" to the Row entity of |
| 284 | * attributes. |
| 285 | * @param currentConfig the column data which column name is "cur_cfg" |
| 286 | */ |
| 287 | public void setCurrentConfig(Long currentConfig) { |
| 288 | ColumnDescription columndesc = new ColumnDescription( |
| 289 | OpenVSwitchColumn.CURCFG |
| 290 | .columnName(), |
| 291 | "setCurrentConfig", |
| 292 | VersionNum.VERSION100); |
| 293 | super.setDataHandler(columndesc, currentConfig); |
| 294 | } |
| 295 | |
| 296 | /** |
| 297 | * Get the Column entity which column name is "capabilities" from the Row |
| 298 | * entity of attributes. |
| 299 | * @return the Column entity which column name is "capabilities" |
| 300 | */ |
| 301 | public Column getCapabilitiesColumn() { |
| 302 | ColumnDescription columndesc = new ColumnDescription( |
| 303 | OpenVSwitchColumn.CAPABILITIES |
| 304 | .columnName(), |
| 305 | "getCapabilitiesColumn", |
| 306 | VersionNum.VERSION100, |
| 307 | VersionNum.VERSION670); |
| 308 | return (Column) super.getColumnHandler(columndesc); |
| 309 | } |
| 310 | |
| 311 | /** |
| 312 | * Add a Column entity which column name is "capabilities" to the Row entity |
| 313 | * of attributes. |
| 314 | * @param capabilities the column data which column name is "capabilities" |
| 315 | */ |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 316 | public void setCapabilities(Map<String, Uuid> capabilities) { |
lishuai | 2ddc469 | 2015-07-31 15:15:16 +0800 | [diff] [blame] | 317 | ColumnDescription columndesc = new ColumnDescription( |
| 318 | OpenVSwitchColumn.CAPABILITIES |
| 319 | .columnName(), |
| 320 | "setCapabilities", |
| 321 | VersionNum.VERSION100, |
| 322 | VersionNum.VERSION670); |
| 323 | super.setDataHandler(columndesc, capabilities); |
| 324 | } |
| 325 | |
| 326 | /** |
| 327 | * Get the Column entity which column name is "statistics" from the Row |
| 328 | * entity of attributes. |
| 329 | * @return the Column entity which column name is "statistics" |
| 330 | */ |
| 331 | public Column getStatisticsColumn() { |
| 332 | ColumnDescription columndesc = new ColumnDescription( |
| 333 | OpenVSwitchColumn.STATISTICS |
| 334 | .columnName(), |
| 335 | "getStatisticsColumn", |
| 336 | VersionNum.VERSION100); |
| 337 | return (Column) super.getColumnHandler(columndesc); |
| 338 | } |
| 339 | |
| 340 | /** |
| 341 | * Add a Column entity which column name is "statistics" to the Row entity |
| 342 | * of attributes. |
| 343 | * @param statistics the column data which column name is "statistics" |
| 344 | */ |
| 345 | public void setStatistics(Map<String, Long> statistics) { |
| 346 | ColumnDescription columndesc = new ColumnDescription( |
| 347 | OpenVSwitchColumn.STATISTICS |
| 348 | .columnName(), |
| 349 | "setStatistics", |
| 350 | VersionNum.VERSION100); |
| 351 | super.setDataHandler(columndesc, statistics); |
| 352 | } |
| 353 | |
| 354 | /** |
| 355 | * Get the Column entity which column name is "ovs_version" from the Row |
| 356 | * entity of attributes. |
| 357 | * @return the Column entity which column name is "ovs_version" |
| 358 | */ |
| 359 | public Column getOvsVersionColumn() { |
| 360 | ColumnDescription columndesc = new ColumnDescription( |
| 361 | OpenVSwitchColumn.OVSVERSION |
| 362 | .columnName(), |
| 363 | "getOvsVersionColumn", |
| 364 | VersionNum.VERSION100); |
| 365 | return (Column) super.getColumnHandler(columndesc); |
| 366 | } |
| 367 | |
| 368 | /** |
| 369 | * Add a Column entity which column name is "ovs_version" to the Row entity |
| 370 | * of attributes. |
| 371 | * @param ovsVersion the column data which column name is "ovs_version" |
| 372 | */ |
| 373 | public void setOvsVersion(Set<String> ovsVersion) { |
| 374 | ColumnDescription columndesc = new ColumnDescription( |
| 375 | OpenVSwitchColumn.OVSVERSION |
| 376 | .columnName(), |
| 377 | "setOvsVersion", |
| 378 | VersionNum.VERSION100); |
| 379 | super.setDataHandler(columndesc, ovsVersion); |
| 380 | } |
| 381 | |
| 382 | /** |
| 383 | * Get the Column entity which column name is "db_version" from the Row |
| 384 | * entity of attributes. |
| 385 | * @return the Column entity which column name is "db_version" |
| 386 | */ |
| 387 | public Column getDbVersionColumn() { |
| 388 | ColumnDescription columndesc = new ColumnDescription( |
| 389 | OpenVSwitchColumn.DBVERSION |
| 390 | .columnName(), |
| 391 | "getDbVersionColumn", |
| 392 | VersionNum.VERSION100); |
| 393 | return (Column) super.getColumnHandler(columndesc); |
| 394 | } |
| 395 | |
| 396 | /** |
| 397 | * Add a Column entity which column name is "db_version" to the Row entity |
| 398 | * of attributes. |
| 399 | * @param dbVersion the column data which column name is "db_version" |
| 400 | */ |
| 401 | public void setDbVersion(Set<String> dbVersion) { |
| 402 | ColumnDescription columndesc = new ColumnDescription( |
| 403 | OpenVSwitchColumn.DBVERSION |
| 404 | .columnName(), |
| 405 | "setDbVersion", |
| 406 | VersionNum.VERSION100); |
| 407 | super.setDataHandler(columndesc, dbVersion); |
| 408 | } |
| 409 | |
| 410 | /** |
| 411 | * Get the Column entity which column name is "system_type" from the Row |
| 412 | * entity of attributes. |
| 413 | * @return the Column entity which column name is "system_type" |
| 414 | */ |
| 415 | public Column getSystemTypeColumn() { |
| 416 | ColumnDescription columndesc = new ColumnDescription( |
| 417 | OpenVSwitchColumn.SYSTEMTYPE |
| 418 | .columnName(), |
| 419 | "getSystemTypeColumn", |
| 420 | VersionNum.VERSION100); |
| 421 | return (Column) super.getColumnHandler(columndesc); |
| 422 | } |
| 423 | |
| 424 | /** |
| 425 | * Add a Column entity which column name is "system_type" to the Row entity |
| 426 | * of attributes. |
| 427 | * @param systemType the column data which column name is "system_type" |
| 428 | */ |
| 429 | public void setSystemType(Set<String> systemType) { |
| 430 | ColumnDescription columndesc = new ColumnDescription( |
| 431 | OpenVSwitchColumn.SYSTEMTYPE |
| 432 | .columnName(), |
| 433 | "setSystemType", |
| 434 | VersionNum.VERSION100); |
| 435 | super.setDataHandler(columndesc, systemType); |
| 436 | } |
| 437 | |
| 438 | /** |
| 439 | * Get the Column entity which column name is "system_version" from the Row |
| 440 | * entity of attributes. |
| 441 | * @return the Column entity which column name is "system_version" |
| 442 | */ |
| 443 | public Column getSystemVersionColumn() { |
| 444 | ColumnDescription columndesc = new ColumnDescription( |
| 445 | OpenVSwitchColumn.SYSTEMVERSION |
| 446 | .columnName(), |
| 447 | "getSystemVersionColumn", |
| 448 | VersionNum.VERSION100); |
| 449 | return (Column) super.getColumnHandler(columndesc); |
| 450 | } |
| 451 | |
| 452 | /** |
| 453 | * Add a Column entity which column name is "system_version" to the Row |
| 454 | * entity of attributes. |
| 455 | * @param systemVersion the column data which column name is |
| 456 | * "system_version" |
| 457 | */ |
| 458 | public void setSystemVersion(Set<String> systemVersion) { |
| 459 | ColumnDescription columndesc = new ColumnDescription( |
| 460 | OpenVSwitchColumn.SYSTEMVERSION |
| 461 | .columnName(), |
| 462 | "setSystemVersion", |
| 463 | VersionNum.VERSION100); |
| 464 | super.setDataHandler(columndesc, systemVersion); |
| 465 | } |
| 466 | } |