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