Zoey | cd48d22 | 2015-08-04 16:43:42 +0800 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 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; |
| 23 | import org.onosproject.ovsdb.rfc.schema.DatabaseSchema; |
| 24 | import org.onosproject.ovsdb.rfc.tableservice.AbstractOvsdbTableService; |
| 25 | import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription; |
| 26 | |
| 27 | /** |
| 28 | * This class provides operations of Queue Table. |
| 29 | */ |
| 30 | public class Queue extends AbstractOvsdbTableService { |
| 31 | /** |
| 32 | * Queue table column name. |
| 33 | */ |
| 34 | public enum QueueColumn { |
| 35 | DSCP("dscp"), OTHERCONFIG("other_config"), EXTERNALIDS("external_ids"); |
| 36 | |
| 37 | private final String columnName; |
| 38 | |
| 39 | private QueueColumn(String columnName) { |
| 40 | this.columnName = columnName; |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Returns the table column name for QueueColumn. |
| 45 | * @return the table column name |
| 46 | */ |
| 47 | public String columnName() { |
| 48 | return columnName; |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Constructs a Queue object. Generate Queue Table Description. |
| 54 | * @param dbSchema DatabaseSchema |
| 55 | * @param row Row |
| 56 | */ |
| 57 | public Queue(DatabaseSchema dbSchema, Row row) { |
| 58 | super(dbSchema, row, OvsdbTable.QUEUE, VersionNum.VERSION100); |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Get the Column entity which column name is "dscp" from the Row entity of |
| 63 | * attributes. |
| 64 | * @return the Column entity |
| 65 | */ |
| 66 | public Column getDscpColumn() { |
| 67 | ColumnDescription columndesc = new ColumnDescription(QueueColumn.DSCP.columnName(), "getDscpColumn", |
| 68 | VersionNum.VERSION100); |
| 69 | return (Column) super.getColumnHandler(columndesc); |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Add a Column entity which column name is "dscp" to the Row entity of |
| 74 | * attributes. |
| 75 | * @param dscp the column data which column name is "dscp" |
| 76 | */ |
| 77 | public void setDscp(Set<Long> dscp) { |
| 78 | ColumnDescription columndesc = new ColumnDescription(QueueColumn.DSCP.columnName(), "setDscp", |
| 79 | VersionNum.VERSION100); |
| 80 | super.setDataHandler(columndesc, dscp); |
| 81 | } |
| 82 | |
| 83 | /** |
| 84 | * Get the Column entity which column name is "other_config" from the Row |
| 85 | * entity of attributes. |
| 86 | * @return the Column entity |
| 87 | */ |
| 88 | public Column getOtherConfigColumn() { |
| 89 | ColumnDescription columndesc = new ColumnDescription(QueueColumn.OTHERCONFIG.columnName(), |
| 90 | "getOtherConfigColumn", VersionNum.VERSION100); |
| 91 | return (Column) super.getColumnHandler(columndesc); |
| 92 | } |
| 93 | |
| 94 | /** |
| 95 | * Add a Column entity which column name is "other_config" to the Row entity |
| 96 | * of attributes. |
| 97 | * @param otherConfig the column data which column name is "other_config" |
| 98 | */ |
| 99 | public void setOtherConfig(Map<String, String> otherConfig) { |
| 100 | ColumnDescription columndesc = new ColumnDescription(QueueColumn.OTHERCONFIG.columnName(), |
| 101 | "setOtherConfig", VersionNum.VERSION100); |
| 102 | super.setDataHandler(columndesc, otherConfig); |
| 103 | } |
| 104 | |
| 105 | /** |
| 106 | * Get the Column entity which column name is "external_ids" from the Row |
| 107 | * entity of attributes. |
| 108 | * @return the Column entity |
| 109 | */ |
| 110 | public Column getExternalIdsColumn() { |
| 111 | ColumnDescription columndesc = new ColumnDescription(QueueColumn.EXTERNALIDS.columnName(), |
| 112 | "getExternalIdsColumn", VersionNum.VERSION100); |
| 113 | return (Column) super.getColumnHandler(columndesc); |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Add a Column entity which column name is "external_ids" to the Row entity |
| 118 | * of attributes. |
| 119 | * @param externalIds the column data which column name is "external_ids" |
| 120 | */ |
| 121 | public void setExternalIds(Map<String, String> externalIds) { |
| 122 | ColumnDescription columndesc = new ColumnDescription(QueueColumn.EXTERNALIDS.columnName(), |
| 123 | "setExternalIds", VersionNum.VERSION100); |
| 124 | super.setDataHandler(columndesc, externalIds); |
| 125 | } |
| 126 | } |