blob: f93cb7d7472db17625d06f4ae80d7d5398ca6d52 [file] [log] [blame]
lishuai2ddc4692015-07-31 15:15:16 +08001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2015-present Open Networking Foundation
lishuai2ddc4692015-07-31 15:15:16 +08003 *
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.schema.DatabaseSchema;
24import org.onosproject.ovsdb.rfc.tableservice.AbstractOvsdbTableService;
25import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription;
26
27/**
28 * This class provides operations of Controller Table.
29 */
30public class Controller extends AbstractOvsdbTableService {
31
32 /**
33 * Controller table column name.
34 */
35 public enum ControllerColumn {
36 TARGET("target"), BURSTLIMIT("controller_burst_limit"),
37 RATELIMIT("controller_rate_limit"), CONNECTIONMODE("connection_mode"),
38 ENABLEASYNCMESSAGES("enable_async_messages"),
39 EXTERNALIDS("external_ids"), LOCALNETMASK("local_netmask"),
40 LOCALGATEWAY("local_gateway"), STATUS("status"), ROLE("role"),
41 INACTIVITYPROBE("inactivity_probe"), ISCONNECTED("is_connected"),
42 OTHERCONFIG("other_config"), MAXBACKOFF("max_backoff"),
43 LOCALIP("local_ip"),
44 DISCOVERUPDATERESOLVCONF("discover_update_resolv_conf"),
45 DISCOVERACCEPTREGEX("discover_accept_regex");
46
47 private final String columnName;
48
49 private ControllerColumn(String columnName) {
50 this.columnName = columnName;
51 }
52
53 /**
54 * Returns the table column name for ControllerColumn.
55 * @return the table column name
56 */
57 public String columnName() {
58 return columnName;
59 }
60 }
61
62 /**
63 * Constructs a Controller object. Generate Controller Table Description.
64 * @param dbSchema DatabaseSchema
65 * @param row Row
66 */
67 public Controller(DatabaseSchema dbSchema, Row row) {
68 super(dbSchema, row, OvsdbTable.CONTROLLER, VersionNum.VERSION100);
69 }
70
71 /**
72 * Get the Column entity which column name is "target" from the Row entity
73 * of attributes.
74 * @return the Column entity which column name is "target"
75 */
76 public Column getTargetColumn() {
77 ColumnDescription columndesc = new ColumnDescription(
78 ControllerColumn.TARGET
79 .columnName(),
80 "getTargetColumn",
81 VersionNum.VERSION100);
82 return (Column) super.getColumnHandler(columndesc);
83 }
84
85 /**
86 * Add a Column entity which column name is "target" to the Row entity of
87 * attributes.
88 * @param target the column data which column name is "target"
89 */
90 public void setTarget(String target) {
91 ColumnDescription columndesc = new ColumnDescription(
92 ControllerColumn.TARGET
93 .columnName(),
94 "setTarget",
95 VersionNum.VERSION100);
96 super.setDataHandler(columndesc, target);
97 }
98
99 /**
100 * Get the Column entity which column name is "controller_burst_limit" from
101 * the Row entity of attributes.
102 * @return the Column entity which column name is "controller_burst_limit"
103 */
104 public Column getBurstLimitColumn() {
105 ColumnDescription columndesc = new ColumnDescription(
106 ControllerColumn.BURSTLIMIT
107 .columnName(),
108 "getBurstLimitColumn",
109 VersionNum.VERSION100);
110 return (Column) super.getColumnHandler(columndesc);
111 }
112
113 /**
114 * Add a Column entity which column name is "controller_burst_limit" to the
115 * Row entity of attributes.
116 * @param burstLimit the column data which column name is
117 * "controller_burst_limit"
118 */
119 public void setBurstLimit(Long burstLimit) {
120 ColumnDescription columndesc = new ColumnDescription(
121 ControllerColumn.BURSTLIMIT
122 .columnName(),
123 "setBurstLimit",
124 VersionNum.VERSION100);
125 super.setDataHandler(columndesc, burstLimit);
126 }
127
128 /**
129 * Get the Column entity which column name is "controller_rate_limit" from
130 * the Row entity of attributes.
131 * @return the Column entity which column name is "controller_rate_limit"
132 */
133 public Column getRateLimitColumn() {
134 ColumnDescription columndesc = new ColumnDescription(
135 ControllerColumn.RATELIMIT
136 .columnName(),
137 "getRateLimitColumn",
138 VersionNum.VERSION100);
139 return (Column) super.getColumnHandler(columndesc);
140 }
141
142 /**
143 * Add a Column entity which column name is "controller_rate_limit" to the
144 * Row entity of attributes.
145 * @param rateLimit the column data which column name is
146 * "controller_rate_limit"
147 */
148 public void setRateLimit(Long rateLimit) {
149 ColumnDescription columndesc = new ColumnDescription(
150 "controller_rate_limit",
151 "setRateLimit",
152 VersionNum.VERSION100);
153 super.setDataHandler(columndesc, rateLimit);
154 }
155
156 /**
157 * Get the Column entity which column name is "connection_mode" from the Row
158 * entity of attributes.
159 * @return the Column entity which column name is "connection_mode"
160 */
161 public Column getConnectionModeColumn() {
162 ColumnDescription columndesc = new ColumnDescription(
163 "connection_mode",
164 "getConnectionModeColumn",
165 VersionNum.VERSION100);
166 return (Column) super.getColumnHandler(columndesc);
167 }
168
169 /**
170 * Add a Column entity which column name is "connection_mode" to the Row
171 * entity of attributes.
172 * @param connectionMode the column data which column name is
173 * "connection_mode"
174 */
175 public void setConnectionMode(Set<String> connectionMode) {
176 ColumnDescription columndesc = new ColumnDescription(
177 ControllerColumn.RATELIMIT
178 .columnName(),
179 "setConnectionMode",
180 VersionNum.VERSION100);
181 super.setDataHandler(columndesc, connectionMode);
182 }
183
184 /**
185 * Get the Column entity which column name is "enable_async_messages" from
186 * the Row entity of attributes.
187 * @return the Column entity which column name is "enable_async_messages"
188 */
189 public Column getEnableAsyncMessagesColumn() {
190 ColumnDescription columndesc = new ColumnDescription(
191 ControllerColumn.ENABLEASYNCMESSAGES
192 .columnName(),
193 "getEnableAsyncMessagesColumn",
194 VersionNum.VERSION670);
195 return (Column) super.getColumnHandler(columndesc);
196 }
197
198 /**
199 * Add a Column entity which column name is "enable_async_messages" to the
200 * Row entity of attributes.
201 * @param enableAsyncMessages the column data which column name is
202 * "enable_async_messages"
203 */
204 public void setEnableAsyncMessages(Set<Boolean> enableAsyncMessages) {
205 ColumnDescription columndesc = new ColumnDescription(
206 ControllerColumn.ENABLEASYNCMESSAGES
207 .columnName(),
208 "setEnableAsyncMessages",
209 VersionNum.VERSION670);
210 super.setDataHandler(columndesc, enableAsyncMessages);
211 }
212
213 /**
214 * Get the Column entity which column name is "external_ids" from the Row
215 * entity of attributes.
216 * @return the Column entity which column name is "external_ids"
217 */
218 public Column getExternalIdsColumn() {
219 ColumnDescription columndesc = new ColumnDescription(
220 ControllerColumn.EXTERNALIDS
221 .columnName(),
222 "getExternalIdsColumn",
223 VersionNum.VERSION100);
224 return (Column) super.getColumnHandler(columndesc);
225 }
226
227 /**
228 * Add a Column entity which column name is "external_ids" to the Row entity
229 * of attributes.
230 * @param externalIds the column data which column name is "external_ids"
231 */
232 public void setExternalIds(Map<String, String> externalIds) {
233 ColumnDescription columndesc = new ColumnDescription(
234 ControllerColumn.EXTERNALIDS
235 .columnName(),
236 "setExternalIds",
237 VersionNum.VERSION100);
238 super.setDataHandler(columndesc, externalIds);
239 }
240
241 /**
242 * Get the Column entity which column name is "local_netmask" from the Row
243 * entity of attributes.
244 * @return the Column entity which column name is "local_netmask"
245 */
246 public Column getLocalNetmaskColumn() {
247 ColumnDescription columndesc = new ColumnDescription(
248 ControllerColumn.LOCALNETMASK
249 .columnName(),
250 "getLocalNetmaskColumn",
251 VersionNum.VERSION100);
252 return (Column) super.getColumnHandler(columndesc);
253 }
254
255 /**
256 * Add a Column entity which column name is "local_netmask" to the Row
257 * entity of attributes.
258 * @param localNetmask the column data which column name is "local_netmask"
259 */
260 public void setLocalNetmask(Set<String> localNetmask) {
261 ColumnDescription columndesc = new ColumnDescription(
262 ControllerColumn.LOCALNETMASK
263 .columnName(),
264 "setLocalNetmask",
265 VersionNum.VERSION100);
266 super.setDataHandler(columndesc, localNetmask);
267 }
268
269 /**
270 * Get the Column entity which column name is "local_gateway" from the Row
271 * entity of attributes.
272 * @return the Column entity which column name is "local_gateway"
273 */
274 public Column getLocalGatewayColumn() {
275 ColumnDescription columndesc = new ColumnDescription(
276 ControllerColumn.LOCALGATEWAY
277 .columnName(),
278 "getLocalGatewayColumn",
279 VersionNum.VERSION100);
280 return (Column) super.getColumnHandler(columndesc);
281 }
282
283 /**
284 * Add a Column entity which column name is "local_gateway" to the Row
285 * entity of attributes.
286 * @param localGateway the column data which column name is "local_gateway"
287 */
288 public void setLocalGateway(Set<String> localGateway) {
289 ColumnDescription columndesc = new ColumnDescription(
290 ControllerColumn.LOCALGATEWAY
291 .columnName(),
292 "setLocalGateway",
293 VersionNum.VERSION100);
294 super.setDataHandler(columndesc, localGateway);
295 }
296
297 /**
298 * Get the Column entity which column name is "status" from the Row entity
299 * of attributes.
300 * @return the Column entity which column name is "status"
301 */
302 public Column getStatusColumn() {
303 ColumnDescription columndesc = new ColumnDescription(
304 ControllerColumn.STATUS
305 .columnName(),
306 "getStatusColumn",
307 VersionNum.VERSION100);
308 return (Column) super.getColumnHandler(columndesc);
309 }
310
311 /**
312 * Add a Column entity which column name is "status" to the Row entity of
313 * attributes.
314 * @param status the column data which column name is "status"
315 */
316 public void setStatus(Map<String, String> status) {
317 ColumnDescription columndesc = new ColumnDescription(
318 ControllerColumn.STATUS
319 .columnName(),
320 "setStatus",
321 VersionNum.VERSION100);
322 super.setDataHandler(columndesc, status);
323 }
324
325 /**
326 * Get the Column entity which column name is "role" from the Row entity of
327 * attributes.
328 * @return the Column entity which column name is "role"
329 */
330 public Column getRoleColumn() {
331 ColumnDescription columndesc = new ColumnDescription(
332 ControllerColumn.ROLE
333 .columnName(),
334 "getRoleColumn",
335 VersionNum.VERSION110);
336 return (Column) super.getColumnHandler(columndesc);
337 }
338
339 /**
340 * Add a Column entity which column name is "role" to the Row entity of
341 * attributes.
342 * @param role the column data which column name is "role"
343 */
344 public void setRole(Set<String> role) {
345 ColumnDescription columndesc = new ColumnDescription(
346 ControllerColumn.ROLE
347 .columnName(),
348 "setRole",
349 VersionNum.VERSION110);
350 super.setDataHandler(columndesc, role);
351 }
352
353 /**
354 * Get the Column entity which column name is "inactivity_probe" from the
355 * Row entity of attributes.
356 * @return the Column entity which column name is "inactivity_probe"
357 */
358 public Column getInactivityProbeColumn() {
359 ColumnDescription columndesc = new ColumnDescription(
360 ControllerColumn.INACTIVITYPROBE
361 .columnName(),
362 "getInactivityProbeColumn",
363 VersionNum.VERSION100);
364 return (Column) super.getColumnHandler(columndesc);
365 }
366
367 /**
368 * Add a Column entity which column name is "inactivity_probe" to the Row
369 * entity of attributes.
370 * @param inactivityProbe the column data which column name is
371 * "inactivity_probe"
372 */
373 public void setInactivityProbe(Set<Long> inactivityProbe) {
374 ColumnDescription columndesc = new ColumnDescription(
375 ControllerColumn.INACTIVITYPROBE
376 .columnName(),
377 "setInactivityProbe",
378 VersionNum.VERSION100);
379 super.setDataHandler(columndesc, inactivityProbe);
380 }
381
382 /**
383 * Get the Column entity which column name is "is_connected" from the Row
384 * entity of attributes.
385 * @return the Column entity which column name is "is_connected"
386 */
387 public Column getIsConnectedColumn() {
388 ColumnDescription columndesc = new ColumnDescription(
389 ControllerColumn.ISCONNECTED
390 .columnName(),
391 "getIsConnectedColumn",
392 VersionNum.VERSION110);
393 return (Column) super.getColumnHandler(columndesc);
394 }
395
396 /**
397 * Add a Column entity which column name is "is_connected" to the Row entity
398 * of attributes.
399 * @param isConnected the column data which column name is "is_connected"
400 */
401 public void setIsConnected(Boolean isConnected) {
402 ColumnDescription columndesc = new ColumnDescription(
403 ControllerColumn.ISCONNECTED
404 .columnName(),
405 "setIsConnected",
406 VersionNum.VERSION110);
407 super.setDataHandler(columndesc, isConnected);
408 }
409
410 /**
411 * Get the Column entity which column name is "other_config" from the Row
412 * entity of attributes.
413 * @return the Column entity which column name is "other_config"
414 */
415 public Column getOtherConfigColumn() {
416 ColumnDescription columndesc = new ColumnDescription(
417 ControllerColumn.OTHERCONFIG
418 .columnName(),
419 "getOtherConfigColumn",
420 VersionNum.VERSION680);
421 return (Column) super.getColumnHandler(columndesc);
422 }
423
424 /**
425 * Add a Column entity which column name is "other_config" to the Row entity
426 * of attributes.
427 * @param otherConfig the column data which column name is "other_config"
428 */
429 public void setOtherConfig(Map<String, String> otherConfig) {
430 ColumnDescription columndesc = new ColumnDescription(
431 ControllerColumn.OTHERCONFIG
432 .columnName(),
433 "setOtherConfig",
434 VersionNum.VERSION680);
435 super.setDataHandler(columndesc, otherConfig);
436 }
437
438 /**
439 * Get the Column entity which column name is "max_backoff" from the Row
440 * entity of attributes.
441 * @return the Column entity which column name is "max_backoff"
442 */
443 public Column getMaxBackoffColumn() {
444 ColumnDescription columndesc = new ColumnDescription(
445 ControllerColumn.MAXBACKOFF
446 .columnName(),
447 "getMaxBackoffColumn",
448 VersionNum.VERSION100);
449 return (Column) super.getColumnHandler(columndesc);
450 }
451
452 /**
453 * Add a Column entity which column name is "max_backoff" to the Row entity
454 * of attributes.
455 * @param maxBackoff the column data which column name is "max_backoff"
456 */
457 public void setMaxBackoff(Long maxBackoff) {
458 ColumnDescription columndesc = new ColumnDescription(
459 ControllerColumn.MAXBACKOFF
460 .columnName(),
461 "setMaxBackoff",
462 VersionNum.VERSION100);
463 super.setDataHandler(columndesc, maxBackoff);
464 }
465
466 /**
467 * Get the Column entity which column name is "local_ip" from the Row entity
468 * of attributes.
469 * @return the Column entity which column name is "local_ip"
470 */
471 public Column getLocalIpColumn() {
472 ColumnDescription columndesc = new ColumnDescription(
473 ControllerColumn.LOCALIP
474 .columnName(),
475 "getLocalIpColumn",
476 VersionNum.VERSION100);
477 return (Column) super.getColumnHandler(columndesc);
478 }
479
480 /**
481 * Add a Column entity which column name is "local_ip" to the Row entity of
482 * attributes.
483 * @param localIp the column data which column name is "local_ip"
484 */
485 public void setLocalIp(Set<String> localIp) {
486 ColumnDescription columndesc = new ColumnDescription(
487 ControllerColumn.LOCALIP
488 .columnName(),
489 "setLocalIp",
490 VersionNum.VERSION100);
491 super.setDataHandler(columndesc, localIp);
492 }
493
494 /**
495 * Get the Column entity which column name is "discover_update_resolv_conf"
496 * from the Row entity of attributes.
497 * @return the Column entity which column name is
498 * "discover_update_resolv_conf"
499 */
500 public Column getDiscoverUpdateResolvConfColumn() {
501 ColumnDescription columndesc = new ColumnDescription(
502 ControllerColumn.DISCOVERUPDATERESOLVCONF
503 .columnName(),
504 "getDiscoverUpdateResolvConfColumn",
505 VersionNum.VERSION100,
506 VersionNum.VERSION300);
507 return (Column) super.getColumnHandler(columndesc);
508 }
509
510 /**
511 * Add a Column entity which column name is "discover_update_resolv_conf" to
512 * the Row entity of attributes.
513 * @param discoverUpdateResolvConf the column data which column name is
514 * "discover_update_resolv_conf"
515 */
516 public void setDiscoverUpdateResolvConf(Set<String> discoverUpdateResolvConf) {
517 ColumnDescription columndesc = new ColumnDescription(
518 ControllerColumn.DISCOVERUPDATERESOLVCONF
519 .columnName(),
520 "setDiscoverUpdateResolvConf",
521 VersionNum.VERSION100,
522 VersionNum.VERSION300);
523 super.setDataHandler(columndesc, discoverUpdateResolvConf);
524 }
525
526 /**
527 * Get the Column entity which column name is "discover_accept_regex" from
528 * the Row entity of attributes.
529 * @return the Column entity which column name is "discover_accept_regex"
530 */
531 public Column getDiscoverAcceptRegexColumn() {
532 ColumnDescription columndesc = new ColumnDescription(
533 ControllerColumn.DISCOVERACCEPTREGEX
534 .columnName(),
535 "getDiscoverAcceptRegexColumn",
536 VersionNum.VERSION100,
537 VersionNum.VERSION300);
538 return (Column) super.getColumnHandler(columndesc);
539 }
540
541 /**
542 * Add a Column entity which column name is "discover_accept_regex" to the
543 * Row entity of attributes.
544 * @param discoverAcceptRegex the column data which column name is
545 * "discover_accept_regex"
546 */
547 public void setDiscoverAcceptRegex(Set<String> discoverAcceptRegex) {
548 ColumnDescription columndesc = new ColumnDescription(
549 ControllerColumn.DISCOVERACCEPTREGEX
550 .columnName(),
551 "setDiscoverAcceptRegex",
552 VersionNum.VERSION100,
553 VersionNum.VERSION300);
554 super.setDataHandler(columndesc, discoverAcceptRegex);
555 }
556}