YuanyouZhang | 362c7ab | 2015-08-03 17:07:20 +0800 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2015-present Open Networking Laboratory |
YuanyouZhang | 362c7ab | 2015-08-03 17:07:20 +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; |
| 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 FlowTable Table. |
| 29 | */ |
| 30 | public class FlowTable extends AbstractOvsdbTableService { |
| 31 | /** |
| 32 | * FlowTable table column name. |
| 33 | */ |
| 34 | public enum FlowTableColumn { |
| 35 | FLOWLIMIT("flow_limit"), OVERFLOWPOLICY("overflow_policy"), GROUPS("groups"), NAME("name"), |
| 36 | PREFIXES("prefixes"), EXTERNALIDS("external_ids"); |
| 37 | |
| 38 | private final String columnName; |
| 39 | |
| 40 | private FlowTableColumn(String columnName) { |
| 41 | this.columnName = columnName; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Returns the table column name for FlowTableColumn. |
| 46 | * @return the table column name |
| 47 | */ |
| 48 | public String columnName() { |
| 49 | return columnName; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Constructs a FlowTable object. Generate FlowTable Table Description. |
| 55 | * @param dbSchema DatabaseSchema |
| 56 | * @param row Row |
| 57 | */ |
| 58 | public FlowTable(DatabaseSchema dbSchema, Row row) { |
| 59 | super(dbSchema, row, OvsdbTable.FLWTABLE, VersionNum.VERSION650); |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Get the Column entity which column name is "flow_limit" from the Row |
| 64 | * entity of attributes. |
| 65 | * @return the Column entity which column name is "flow_limit" |
| 66 | */ |
| 67 | public Column getFlowLimitColumn() { |
| 68 | ColumnDescription columndesc = new ColumnDescription(FlowTableColumn.FLOWLIMIT.columnName(), |
| 69 | "getFlowLimitColumn", VersionNum.VERSION650); |
| 70 | return (Column) super.getColumnHandler(columndesc); |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Add a Column entity which column name is "flow_limit" to the Row entity |
| 75 | * of attributes. |
| 76 | * @param flowLimit the column data which column name is "flow_limit" |
| 77 | */ |
| 78 | public void setFlowLimit(Set<Long> flowLimit) { |
| 79 | ColumnDescription columndesc = new ColumnDescription(FlowTableColumn.FLOWLIMIT.columnName(), |
| 80 | "setFlowLimit", VersionNum.VERSION650); |
| 81 | super.setDataHandler(columndesc, flowLimit); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Get the Column entity which column name is "overflow_policy" from the Row |
| 86 | * entity of attributes. |
| 87 | * @return the Column entity which column name is "overflow_policy" |
| 88 | */ |
| 89 | public Column getOverflowPolicyColumn() { |
| 90 | ColumnDescription columndesc = new ColumnDescription(FlowTableColumn.OVERFLOWPOLICY.columnName(), |
| 91 | "getOverflowPolicyColumn", VersionNum.VERSION650); |
| 92 | return (Column) super.getColumnHandler(columndesc); |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * Add a Column entity which column name is "overflow_policy" to the Row |
| 97 | * entity of attributes. |
| 98 | * @param overflowPolicy the column data which column name is |
| 99 | * "overflow_policy" |
| 100 | */ |
| 101 | public void setOverflowPolicy(Set<String> overflowPolicy) { |
| 102 | ColumnDescription columndesc = new ColumnDescription(FlowTableColumn.OVERFLOWPOLICY.columnName(), |
| 103 | "setOverflowPolicy", VersionNum.VERSION650); |
| 104 | super.setDataHandler(columndesc, overflowPolicy); |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Get the Column entity which column name is "groups" from the Row entity |
| 109 | * of attributes. |
| 110 | * @return the Column entity which column name is "groups" |
| 111 | */ |
| 112 | public Column getGroupsColumn() { |
| 113 | ColumnDescription columndesc = new ColumnDescription(FlowTableColumn.GROUPS.columnName(), |
| 114 | "getGroupsColumn", VersionNum.VERSION650); |
| 115 | return (Column) super.getColumnHandler(columndesc); |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Add a Column entity which column name is "groups" to the Row entity of |
| 120 | * attributes. |
| 121 | * @param groups the column data which column name is "groups" |
| 122 | */ |
| 123 | public void setGroups(Set<String> groups) { |
| 124 | ColumnDescription columndesc = new ColumnDescription(FlowTableColumn.GROUPS.columnName(), |
| 125 | "setGroups", VersionNum.VERSION650); |
| 126 | super.setDataHandler(columndesc, groups); |
| 127 | } |
| 128 | |
| 129 | /** |
| 130 | * Get the Column entity which column name is "name" from the Row entity of |
| 131 | * attributes. |
| 132 | * @return the Column entity which column name is "name" |
| 133 | */ |
| 134 | public Column getNameColumn() { |
| 135 | ColumnDescription columndesc = new ColumnDescription(FlowTableColumn.NAME.columnName(), |
| 136 | "getNameColumn", VersionNum.VERSION650); |
| 137 | return (Column) super.getColumnHandler(columndesc); |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * Add a Column entity which column name is "name" to the Row entity of |
| 142 | * attributes. |
| 143 | * @param name the column data which column name is "name" |
| 144 | */ |
| 145 | public void setName(Set<String> name) { |
| 146 | ColumnDescription columndesc = new ColumnDescription(FlowTableColumn.NAME.columnName(), |
| 147 | "setName", |
| 148 | VersionNum.VERSION650); |
| 149 | super.setDataHandler(columndesc, name); |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * Get the Column entity which column name is "prefixes" from the Row entity |
| 154 | * of attributes. |
| 155 | * @return the Column entity which column name is "prefixes" |
| 156 | */ |
| 157 | public Column getPrefixesColumn() { |
| 158 | ColumnDescription columndesc = new ColumnDescription(FlowTableColumn.PREFIXES.columnName(), |
| 159 | "getPrefixesColumn", VersionNum.VERSION740); |
| 160 | return (Column) super.getColumnHandler(columndesc); |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * Add a Column entity which column name is "prefixes" to the Row entity of |
| 165 | * attributes. |
| 166 | * @param prefixes the column data which column name is "prefixes" |
| 167 | */ |
| 168 | public void setPrefixes(Set<String> prefixes) { |
| 169 | ColumnDescription columndesc = new ColumnDescription(FlowTableColumn.PREFIXES.columnName(), |
| 170 | "setPrefixes", VersionNum.VERSION740); |
| 171 | super.setDataHandler(columndesc, prefixes); |
| 172 | } |
| 173 | |
| 174 | /** |
| 175 | * Get the Column entity which column name is "external_ids" from the Row |
| 176 | * entity of attributes. |
| 177 | * @return the Column entity which column name is "external_ids" |
| 178 | */ |
| 179 | public Column getExternalIdsColumn() { |
| 180 | ColumnDescription columndesc = new ColumnDescription(FlowTableColumn.EXTERNALIDS.columnName(), |
| 181 | "getExternalIdsColumn", VersionNum.VERSION750); |
| 182 | return (Column) super.getColumnHandler(columndesc); |
| 183 | } |
| 184 | |
| 185 | /** |
| 186 | * Add a Column entity which column name is "external_ids" to the Row entity |
| 187 | * of attributes. |
| 188 | * @param externalIds the column data which column name is "external_ids" |
| 189 | */ |
| 190 | public void setExternalIds(Map<String, String> externalIds) { |
| 191 | ColumnDescription columndesc = new ColumnDescription(FlowTableColumn.EXTERNALIDS.columnName(), |
| 192 | "setExternalIds", VersionNum.VERSION750); |
| 193 | super.setDataHandler(columndesc, externalIds); |
| 194 | } |
| 195 | |
| 196 | } |