Zoey | cd48d22 | 2015-08-04 16:43:42 +0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
Zoey | cd48d22 | 2015-08-04 16:43:42 +0800 | [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 | */ |
| 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; |
Zoey | cd48d22 | 2015-08-04 16:43:42 +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 Qos Table. |
| 30 | */ |
| 31 | public class Qos extends AbstractOvsdbTableService { |
| 32 | /** |
| 33 | * Qos table column name. |
| 34 | */ |
| 35 | public enum QosColumn { |
| 36 | QUEUES("queues"), TYPE("type"), OTHERCONFIG("other_config"), EXTERNALIDS("external_ids"); |
| 37 | |
| 38 | private final String columnName; |
| 39 | |
| 40 | private QosColumn(String columnName) { |
| 41 | this.columnName = columnName; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Returns the table column name for QosColumn. |
| 46 | * @return the table column name |
| 47 | */ |
| 48 | public String columnName() { |
| 49 | return columnName; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Constructs a Qos object. Generate Qos Table Description. |
| 55 | * @param dbSchema DatabaseSchema |
| 56 | * @param row Row |
| 57 | */ |
| 58 | public Qos(DatabaseSchema dbSchema, Row row) { |
| 59 | super(dbSchema, row, OvsdbTable.QOS, VersionNum.VERSION100); |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Get the Column entity which column name is "queues" from the Row entity |
| 64 | * of attributes. |
| 65 | * @return the Column entity |
| 66 | */ |
| 67 | public Column getQueuesColumn() { |
| 68 | ColumnDescription columndesc = new ColumnDescription(QosColumn.QUEUES.columnName(), |
| 69 | "getQueuesColumn", VersionNum.VERSION100); |
| 70 | return (Column) super.getColumnHandler(columndesc); |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Add a Column entity which column name is "queues" to the Row entity of |
| 75 | * attributes. |
| 76 | * @param queues the column data which column name is "queues" |
| 77 | */ |
Jonathan Hart | 51539b8 | 2015-10-29 09:53:04 -0700 | [diff] [blame] | 78 | public void setQueues(Map<Long, Uuid> queues) { |
Zoey | cd48d22 | 2015-08-04 16:43:42 +0800 | [diff] [blame] | 79 | ColumnDescription columndesc = new ColumnDescription(QosColumn.QUEUES.columnName(), "setQueues", |
| 80 | VersionNum.VERSION100); |
| 81 | super.setDataHandler(columndesc, queues); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Get the Column entity which column name is "type" from the Row entity of |
| 86 | * attributes. |
| 87 | * @return the Column entity |
| 88 | */ |
| 89 | public Column getTypeColumn() { |
| 90 | ColumnDescription columndesc = new ColumnDescription(QosColumn.TYPE.columnName(), "getTypeColumn", |
| 91 | VersionNum.VERSION100); |
| 92 | return (Column) super.getColumnHandler(columndesc); |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * Add a Column entity which column name is "type" to the Row entity of |
| 97 | * attributes. |
| 98 | * @param type the column data which column name is "type" |
| 99 | */ |
| 100 | public void setType(Set<String> type) { |
| 101 | ColumnDescription columndesc = new ColumnDescription(QosColumn.TYPE.columnName(), "setType", |
| 102 | VersionNum.VERSION100); |
| 103 | super.setDataHandler(columndesc, type); |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * Get the Column entity which column name is "other_config" from the Row |
| 108 | * entity of attributes. |
| 109 | * @return the Column entity |
| 110 | */ |
| 111 | public Column getOtherConfigColumn() { |
| 112 | ColumnDescription columndesc = new ColumnDescription(QosColumn.OTHERCONFIG.columnName(), |
| 113 | "getOtherConfigColumn", VersionNum.VERSION100); |
| 114 | return (Column) super.getColumnHandler(columndesc); |
| 115 | } |
| 116 | |
| 117 | /** |
| 118 | * Add a Column entity which column name is "other_config" to the Row entity |
| 119 | * of attributes. |
| 120 | * @param otherConfig the column data which column name is "other_config" |
| 121 | */ |
| 122 | public void setOtherConfig(Map<String, String> otherConfig) { |
| 123 | ColumnDescription columndesc = new ColumnDescription(QosColumn.OTHERCONFIG.columnName(), |
| 124 | "setOtherConfig", VersionNum.VERSION100); |
| 125 | super.setDataHandler(columndesc, otherConfig); |
| 126 | } |
| 127 | |
| 128 | /** |
| 129 | * Get the Column entity which column name is "external_ids" from the Row |
| 130 | * entity of attributes. |
| 131 | * @return the Column entity |
| 132 | */ |
| 133 | public Column getExternalIdsColumn() { |
| 134 | ColumnDescription columndesc = new ColumnDescription(QosColumn.EXTERNALIDS.columnName(), |
| 135 | "getExternalIdsColumn", VersionNum.VERSION100); |
| 136 | return (Column) super.getColumnHandler(columndesc); |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * Add a Column entity which column name is "external_ids" to the Row entity |
| 141 | * of attributes. |
| 142 | * @param externalIds the column data which column name is "external_ids" |
| 143 | */ |
| 144 | public void setExternalIds(Map<String, String> externalIds) { |
| 145 | ColumnDescription columndesc = new ColumnDescription(QosColumn.EXTERNALIDS.columnName(), |
| 146 | "setExternalIds", VersionNum.VERSION100); |
| 147 | super.setDataHandler(columndesc, externalIds); |
| 148 | } |
| 149 | } |