blob: e1a00baf251b0b75458117d12df3ff3f4686a2e5 [file] [log] [blame]
lishuai2ddc4692015-07-31 15:15:16 +08001/*
2 * Copyright 2015 Open Networking Laboratory
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 */
16package org.onosproject.ovsdb.rfc.table;
17
lishuai2ddc4692015-07-31 15:15:16 +080018import org.onosproject.ovsdb.rfc.notation.Column;
andreaed976a42015-10-05 14:38:25 -070019import org.onosproject.ovsdb.rfc.notation.OvsdbSet;
lishuai2ddc4692015-07-31 15:15:16 +080020import org.onosproject.ovsdb.rfc.notation.Row;
Jonathan Hart51539b82015-10-29 09:53:04 -070021import org.onosproject.ovsdb.rfc.notation.Uuid;
lishuai2ddc4692015-07-31 15:15:16 +080022import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
23import org.onosproject.ovsdb.rfc.tableservice.AbstractOvsdbTableService;
24import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription;
25
andreaed976a42015-10-05 14:38:25 -070026import java.util.Map;
27import java.util.Set;
28
lishuai2ddc4692015-07-31 15:15:16 +080029/**
30 * This class provides operations of Bridge Table.
31 */
32public class Bridge extends AbstractOvsdbTableService {
33
34 /**
35 * Bridge table column name.
36 */
37 public enum BridgeColumn {
38 NAME("name"), DATAPATHTYPE("datapath_type"), DATAPATHID("datapath_id"),
39 STPENABLE("stpenable"), PORTS("ports"), MIRRORS("mirrors"),
40 NETFLOW("netflow"), SFLOW("sflow"), IPFIX("ipfix"),
41 CONTROLLER("controller"), PROTOCOLS("protocols"),
42 FAILMODE("fail_mode"), STATUS("status"), OTHERCONFIG("other_config"),
43 EXTERNALIDS("external_ids"), FLOODVLANS("flood_vlans"),
44 FLOWTABLES("flow_tables");
45
46 private final String columnName;
47
48 private BridgeColumn(String columnName) {
49 this.columnName = columnName;
50 }
51
52 /**
53 * Returns the table column name for BridgeColumn.
54 * @return the table column name
55 */
56 public String columnName() {
57 return columnName;
58 }
59 }
60
61 /**
62 * Constructs a Bridge object. Generate Bridge Table Description.
63 * @param dbSchema DatabaseSchema
64 * @param row Row
65 */
66 public Bridge(DatabaseSchema dbSchema, Row row) {
67 super(dbSchema, row, OvsdbTable.BRIDGE, VersionNum.VERSION100);
68 }
69
70 /**
71 * Get the Column entity which column name is "name" from the Row entity of
72 * attributes.
73 * @return the Column entity which column name is "name"
74 */
75 public Column getNameColumn() {
76 ColumnDescription columndesc = new ColumnDescription(
77 BridgeColumn.NAME
78 .columnName(),
79 "getNameColumn",
80 VersionNum.VERSION100);
81 return (Column) super.getColumnHandler(columndesc);
82 }
83
84 /**
85 * Add a Column entity which column name is "name" to the Row entity of
86 * attributes.
87 * @param name the column data which column name is "name"
88 */
89 public void setName(String name) {
90 ColumnDescription columndesc = new ColumnDescription(
91 BridgeColumn.NAME
92 .columnName(),
93 "setName",
94 VersionNum.VERSION100);
95 super.setDataHandler(columndesc, name);
96 }
97
98 /**
99 * Get the column data which column name is "name" from the Row entity of
100 * attributes.
101 * @return the column data which column name is "name"
102 */
103 public String getName() {
104 ColumnDescription columndesc = new ColumnDescription(
105 BridgeColumn.NAME
106 .columnName(),
107 "getName",
108 VersionNum.VERSION100);
109 return (String) super.getDataHandler(columndesc);
110 }
111
112 /**
113 * Get the Column entity which column name is "datapath_type" from the Row
114 * entity of attributes.
115 * @return the Column entity which column name is "datapath_type"
116 */
117 public Column getDatapathTypeColumn() {
118 ColumnDescription columndesc = new ColumnDescription(
119 BridgeColumn.DATAPATHTYPE
120 .columnName(),
121 "getDatapathTypeColumn",
122 VersionNum.VERSION100);
123 return (Column) super.getColumnHandler(columndesc);
124 }
125
126 /**
127 * Add a Column entity which column name is "datapath_type" to the Row
128 * entity of attributes.
129 * @param datapathType the column data which column name is "datapath_type"
130 */
131 public void setDatapathType(String datapathType) {
132 ColumnDescription columndesc = new ColumnDescription(
133 BridgeColumn.DATAPATHTYPE
134 .columnName(),
135 "setDatapathType",
136 VersionNum.VERSION100);
137 super.setDataHandler(columndesc, datapathType);
138 }
139
140 /**
141 * Get the Column entity which column name is "datapath_id" from the Row
142 * entity of attributes.
143 * @return the Column entity which column name is "datapath_id"
144 */
145 public Column getDatapathIdColumn() {
146 ColumnDescription columndesc = new ColumnDescription(
147 BridgeColumn.DATAPATHID
148 .columnName(),
149 "getDatapathIdColumn",
150 VersionNum.VERSION100);
151 return (Column) super.getColumnHandler(columndesc);
152 }
153
154 /**
155 * Add a Column entity which column name is "datapath_id" to the Row entity
156 * of attributes.
157 * @param datapathId the column data which column name is "datapath_id"
158 */
159 public void setDatapathId(Set<String> datapathId) {
160 ColumnDescription columndesc = new ColumnDescription(
161 BridgeColumn.DATAPATHID
162 .columnName(),
163 "setDatapathId",
164 VersionNum.VERSION100);
165 super.setDataHandler(columndesc, datapathId);
166 }
167
168 /**
169 * Get the Column entity which column name is "stpenable" from the Row
170 * entity of attributes.
171 * @return the Column entity which column name is "stpenable"
172 */
173 public Column getStpEnableColumn() {
174 ColumnDescription columndesc = new ColumnDescription(
175 BridgeColumn.STPENABLE
176 .columnName(),
177 "getStpEnableColumn",
178 VersionNum.VERSION620);
179 return (Column) super.getColumnHandler(columndesc);
180 }
181
182 /**
183 * Add a Column entity which column name is "stpenable" to the Row entity of
184 * attributes.
185 * @param stpenable the column data which column name is "stpenable"
186 */
187 public void setStpEnable(Boolean stpenable) {
188 ColumnDescription columndesc = new ColumnDescription(
189 BridgeColumn.STPENABLE
190 .columnName(),
191 "setStpEnable",
192 VersionNum.VERSION620);
193 super.setDataHandler(columndesc, stpenable);
194 }
195
196 /**
197 * Get the Column entity which column name is "ports" from the Row entity of
198 * attributes.
199 * @return the Column entity which column name is "ports"
200 */
201 public Column getPortsColumn() {
202 ColumnDescription columndesc = new ColumnDescription(
203 BridgeColumn.PORTS
204 .columnName(),
205 "getPortsColumn",
206 VersionNum.VERSION100);
207 return (Column) super.getColumnHandler(columndesc);
208 }
209
210 /**
211 * Add a Column entity which column name is "ports" to the Row entity of
212 * attributes.
213 * @param ports the column data which column name is "ports"
214 */
Jonathan Hart51539b82015-10-29 09:53:04 -0700215 public void setPorts(Set<Uuid> ports) {
lishuai2ddc4692015-07-31 15:15:16 +0800216 ColumnDescription columndesc = new ColumnDescription(
217 BridgeColumn.PORTS
218 .columnName(),
219 "setPorts",
220 VersionNum.VERSION100);
221 super.setDataHandler(columndesc, ports);
222 }
223
224 /**
225 * Get the Column entity which column name is "mirrors" from the Row entity
226 * of attributes.
227 * @return the Column entity which column name is "mirrors"
228 */
229 public Column getMirrorsColumn() {
230 ColumnDescription columndesc = new ColumnDescription(
231 BridgeColumn.MIRRORS
232 .columnName(),
233 "getMirrorsColumn",
234 VersionNum.VERSION100);
235 return (Column) super.getColumnHandler(columndesc);
236 }
237
238 /**
239 * Add a Column entity which column name is "mirrors" to the Row entity of
240 * attributes.
241 * @param mirrors the column data which column name is "mirrors"
242 */
Jonathan Hart51539b82015-10-29 09:53:04 -0700243 public void setMirrors(Set<Uuid> mirrors) {
lishuai2ddc4692015-07-31 15:15:16 +0800244 ColumnDescription columndesc = new ColumnDescription(
245 BridgeColumn.MIRRORS
246 .columnName(),
247 "setMirrors",
248 VersionNum.VERSION100);
249 super.setDataHandler(columndesc, mirrors);
250 }
251
252 /**
253 * Get the Column entity which column name is "netflow" from the Row entity
254 * of attributes.
255 * @return the Column entity which column name is "netflow"
256 */
257 public Column getNetflowColumn() {
258 ColumnDescription columndesc = new ColumnDescription(
259 BridgeColumn.NETFLOW
260 .columnName(),
261 "getNetflowColumn",
262 VersionNum.VERSION100);
263 return (Column) super.getColumnHandler(columndesc);
264 }
265
266 /**
267 * Add a Column entity which column name is "netflow" to the Row entity of
268 * attributes.
269 * @param netflow the column data which column name is "netflow"
270 */
Jonathan Hart51539b82015-10-29 09:53:04 -0700271 public void setNetflow(Set<Uuid> netflow) {
lishuai2ddc4692015-07-31 15:15:16 +0800272 ColumnDescription columndesc = new ColumnDescription(
273 BridgeColumn.NETFLOW
274 .columnName(),
275 "setNetflow",
276 VersionNum.VERSION100);
277 super.setDataHandler(columndesc, netflow);
278 }
279
280 /**
281 * Get the Column entity which column name is "sflow" from the Row entity of
282 * attributes.
283 * @return the Column entity which column name is "sflow"
284 */
285 public Column getSflowColumn() {
286 ColumnDescription columndesc = new ColumnDescription(
287 BridgeColumn.SFLOW
288 .columnName(),
289 "getSflowColumn",
290 VersionNum.VERSION100);
291 return (Column) super.getColumnHandler(columndesc);
292 }
293
294 /**
295 * Add a Column entity which column name is "sflow" to the Row entity of
296 * attributes.
297 * @param sflow the column data which column name is "sflow"
298 */
Jonathan Hart51539b82015-10-29 09:53:04 -0700299 public void setSflow(Set<Uuid> sflow) {
lishuai2ddc4692015-07-31 15:15:16 +0800300 ColumnDescription columndesc = new ColumnDescription(
301 BridgeColumn.SFLOW
302 .columnName(),
303 "setSflow",
304 VersionNum.VERSION100);
305 super.setDataHandler(columndesc, sflow);
306 }
307
308 /**
309 * Get the Column entity which column name is "ipfix" from the Row entity of
310 * attributes.
311 * @return the Column entity which column name is "ipfix"
312 */
313 public Column getIpfixColumn() {
314 ColumnDescription columndesc = new ColumnDescription(
315 BridgeColumn.IPFIX
316 .columnName(),
317 "getIpfixColumn",
318 VersionNum.VERSION710);
319 return (Column) super.getColumnHandler(columndesc);
320 }
321
322 /**
323 * Add a Column entity which column name is "ipfix" to the Row entity of
324 * attributes.
325 * @param ipfix the column data which column name is "ipfix"
326 */
Jonathan Hart51539b82015-10-29 09:53:04 -0700327 public void setIpfix(Set<Uuid> ipfix) {
lishuai2ddc4692015-07-31 15:15:16 +0800328 ColumnDescription columndesc = new ColumnDescription(
329 BridgeColumn.IPFIX
330 .columnName(),
331 "setIpfix",
332 VersionNum.VERSION710);
333 super.setDataHandler(columndesc, ipfix);
334 }
335
336 /**
337 * Get the Column entity which column name is "controller" from the Row
338 * entity of attributes.
339 * @return the Column entity which column name is "controller"
340 */
341 public Column getControllerColumn() {
342 ColumnDescription columndesc = new ColumnDescription(
343 BridgeColumn.CONTROLLER
344 .columnName(),
345 "getControllerColumn",
346 VersionNum.VERSION100);
347 return (Column) super.getColumnHandler(columndesc);
348 }
349
350 /**
351 * Add a Column entity which column name is "controller" to the Row entity
352 * of attributes.
353 * @param controller the column data which column name is "controller"
354 */
andreaed976a42015-10-05 14:38:25 -0700355 public void setController(OvsdbSet controller) {
lishuai2ddc4692015-07-31 15:15:16 +0800356 ColumnDescription columndesc = new ColumnDescription(
357 BridgeColumn.CONTROLLER
358 .columnName(),
359 "setController",
360 VersionNum.VERSION100);
361 super.setDataHandler(columndesc, controller);
362 }
363
364 /**
365 * Get the Column entity which column name is "protocols" from the Row
366 * entity of attributes.
367 * @return the Column entity which column name is "protocols"
368 */
369 public Column getProtocolsColumn() {
370 ColumnDescription columndesc = new ColumnDescription(
371 BridgeColumn.PROTOCOLS
372 .columnName(),
373 "getProtocolsColumn",
374 VersionNum.VERSION6111);
375 return (Column) super.getColumnHandler(columndesc);
376 }
377
378 /**
379 * Add a Column entity which column name is "protocols" to the Row entity of
380 * attributes.
381 * @param protocols the column data which column name is "protocols"
382 */
383 public void setProtocols(Set<String> protocols) {
384 ColumnDescription columndesc = new ColumnDescription(
385 BridgeColumn.PROTOCOLS
386 .columnName(),
387 "setProtocols",
388 VersionNum.VERSION6111);
389 super.setDataHandler(columndesc, protocols);
390 }
391
392 /**
393 * Get the Column entity which column name is "fail_mode" from the Row
394 * entity of attributes.
395 * @return the Column entity which column name is "fail_mode"
396 */
397 public Column getFailModeColumn() {
398 ColumnDescription columndesc = new ColumnDescription(
399 BridgeColumn.FAILMODE
400 .columnName(),
401 "getFailModeColumn",
402 VersionNum.VERSION100);
403 return (Column) super.getColumnHandler(columndesc);
404 }
405
406 /**
407 * Add a Column entity which column name is "fail_mode" to the Row entity of
408 * attributes.
409 * @param failMode the column data which column name is "fail_mode"
410 */
411 public void setFailMode(Set<String> failMode) {
412 ColumnDescription columndesc = new ColumnDescription(
413 BridgeColumn.FAILMODE
414 .columnName(),
415 "setFailMode",
416 VersionNum.VERSION100);
417 super.setDataHandler(columndesc, failMode);
418 }
419
420 /**
421 * Get the Column entity which column name is "status" from the Row entity
422 * of attributes.
423 * @return the Column entity which column name is "status"
424 */
425 public Column getStatusColumn() {
426 ColumnDescription columndesc = new ColumnDescription(
427 BridgeColumn.STATUS
428 .columnName(),
429 "getStatusColumn",
430 VersionNum.VERSION620);
431 return (Column) super.getColumnHandler(columndesc);
432 }
433
434 /**
435 * Add a Column entity which column name is "status" to the Row entity of
436 * attributes.
437 * @param status the column data which column name is "status"
438 */
439 public void setStatus(Map<String, String> status) {
440 ColumnDescription columndesc = new ColumnDescription(
441 BridgeColumn.STATUS
442 .columnName(),
443 "setStatus",
444 VersionNum.VERSION620);
445 super.setDataHandler(columndesc, status);
446 }
447
448 /**
449 * Get the Column entity which column name is "other_config" from the Row
450 * entity of attributes.
451 * @return the Column entity which column name is "other_config"
452 */
453 public Column getOtherConfigColumn() {
454 ColumnDescription columndesc = new ColumnDescription(
455 BridgeColumn.OTHERCONFIG
456 .columnName(),
457 "getOtherConfigColumn",
458 VersionNum.VERSION100);
459 return (Column) super.getColumnHandler(columndesc);
460 }
461
462 /**
463 * Add a Column entity which column name is "other_config" to the Row entity
464 * of attributes.
465 * @param otherConfig the column data which column name is "other_config"
466 */
467 public void setOtherConfig(Map<String, String> otherConfig) {
468 ColumnDescription columndesc = new ColumnDescription(
469 BridgeColumn.OTHERCONFIG
470 .columnName(),
471 "setOtherConfig",
472 VersionNum.VERSION100);
473 super.setDataHandler(columndesc, otherConfig);
474 }
475
476 /**
477 * Get the Column entity which column name is "external_ids" from the Row
478 * entity of attributes.
479 * @return the Column entity which column name is "external_ids"
480 */
481 public Column getExternalIdsColumn() {
482 ColumnDescription columndesc = new ColumnDescription(
483 BridgeColumn.EXTERNALIDS
484 .columnName(),
485 "getExternalIdsColumn",
486 VersionNum.VERSION100);
487 return (Column) super.getColumnHandler(columndesc);
488 }
489
490 /**
491 * Add a Column entity which column name is "external_ids" to the Row entity
492 * of attributes.
493 * @param externalIds the column data which column name is "external_ids"
494 */
495 public void setExternalIds(Map<String, String> externalIds) {
496 ColumnDescription columndesc = new ColumnDescription(
497 BridgeColumn.EXTERNALIDS
498 .columnName(),
499 "setExternalIds",
500 VersionNum.VERSION100);
501 super.setDataHandler(columndesc, externalIds);
502 }
503
504 /**
505 * Get the Column entity which column name is "flood_vlans" from the Row
506 * entity of attributes.
507 * @return the Column entity which column name is "flood_vlans"
508 */
509 public Column getFloodVlansColumn() {
510 ColumnDescription columndesc = new ColumnDescription(
511 BridgeColumn.FLOODVLANS
512 .columnName(),
513 "getFloodVlansColumn",
514 VersionNum.VERSION100);
515 return (Column) super.getColumnHandler(columndesc);
516 }
517
518 /**
519 * Add a Column entity which column name is "flood_vlans" to the Row entity
520 * of attributes.
521 * @param vlans the column data which column name is "flood_vlans"
522 */
523 public void setFloodVlans(Set<Long> vlans) {
524 ColumnDescription columndesc = new ColumnDescription(
525 BridgeColumn.FLOODVLANS
526 .columnName(),
527 "setFloodVlans",
528 VersionNum.VERSION100);
529 super.setDataHandler(columndesc, vlans);
530 }
531
532 /**
533 * Get the Column entity which column name is "flow_tables" from the Row
534 * entity of attributes.
535 * @return the Column entity which column name is "flow_tables"
536 */
537 public Column getFlowTablesColumn() {
538 ColumnDescription columndesc = new ColumnDescription(
539 BridgeColumn.FLOWTABLES
540 .columnName(),
541 "getFlowTablesColumn",
542 VersionNum.VERSION650);
543 return (Column) super.getColumnHandler(columndesc);
544 }
545
546 /**
547 * Add a Column entity which column name is "flow_tables" to the Row entity
548 * of attributes.
549 * @param flowTables the column data which column name is "flow_tables"
550 */
Jonathan Hart51539b82015-10-29 09:53:04 -0700551 public void setFlowTables(Map<Long, Uuid> flowTables) {
lishuai2ddc4692015-07-31 15:15:16 +0800552 ColumnDescription columndesc = new ColumnDescription(
553 BridgeColumn.FLOWTABLES
554 .columnName(),
555 "setFlowTables",
556 VersionNum.VERSION650);
557 super.setDataHandler(columndesc, flowTables);
558 }
559
560}