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; |
| 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 Netflow Table. |
| 29 | */ |
| 30 | public class Netflow extends AbstractOvsdbTableService { |
| 31 | /** |
| 32 | * Netflow table column name. |
| 33 | */ |
| 34 | public enum NetflowColumn { |
| 35 | TARGETS("targets"), ACTIVETIMEOUT("active_timeout"), ENGINETYPE("engine_type"), |
| 36 | EXTERNALIDS("external_ids"), ADDIDTOINTERFACE("add_id_to_interface"), ENGINEID("engine_id"); |
| 37 | |
| 38 | private final String columnName; |
| 39 | |
| 40 | private NetflowColumn(String columnName) { |
| 41 | this.columnName = columnName; |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Returns the table column name for NetflowColumn. |
| 46 | * @return the table column name |
| 47 | */ |
| 48 | public String columnName() { |
| 49 | return columnName; |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Constructs a NetFlow object. Generate Netflow Table Description. |
| 55 | * @param dbSchema DatabaseSchema |
| 56 | * @param row Row |
| 57 | */ |
| 58 | public Netflow(DatabaseSchema dbSchema, Row row) { |
| 59 | super(dbSchema, row, OvsdbTable.NETFLOW, VersionNum.VERSION100); |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Get the Column entity which column name is "targets" from the Row entity |
| 64 | * of attributes. |
| 65 | * @return the Column entity |
| 66 | */ |
| 67 | public Column getTargetsColumn() { |
| 68 | ColumnDescription columndesc = new ColumnDescription(NetflowColumn.TARGETS.columnName(), |
| 69 | "getTargetsColumn", VersionNum.VERSION100); |
| 70 | return (Column) super.getColumnHandler(columndesc); |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * Add a Column entity which column name is "targets" to the Row entity of |
| 75 | * attributes. |
| 76 | * @param targets the column data which column name is "targets" |
| 77 | */ |
| 78 | public void setTargets(Set<String> targets) { |
| 79 | ColumnDescription columndesc = new ColumnDescription(NetflowColumn.TARGETS.columnName(), |
| 80 | "setTargets", VersionNum.VERSION100); |
| 81 | super.setDataHandler(columndesc, targets); |
| 82 | } |
| 83 | |
| 84 | /** |
| 85 | * Get the Column entity which column name is "active_timeout" from the Row |
| 86 | * entity of attributes. |
| 87 | * @return the Column entity |
| 88 | */ |
| 89 | public Column getActiveTimeoutColumn() { |
| 90 | ColumnDescription columndesc = new ColumnDescription(NetflowColumn.ACTIVETIMEOUT.columnName(), |
| 91 | "getActiveTimeoutColumn", VersionNum.VERSION100); |
| 92 | return (Column) super.getColumnHandler(columndesc); |
| 93 | } |
| 94 | |
| 95 | /** |
| 96 | * Add a Column entity which column name is "active_timeout" to the Row |
| 97 | * entity of attributes. |
| 98 | * @param activeTimeout the column data which column name is |
| 99 | * "active_timeout" |
| 100 | */ |
| 101 | public void setActiveTimeout(Long activeTimeout) { |
| 102 | ColumnDescription columndesc = new ColumnDescription(NetflowColumn.ACTIVETIMEOUT.columnName(), |
| 103 | "setActiveTimeout", VersionNum.VERSION100); |
| 104 | super.setDataHandler(columndesc, activeTimeout); |
| 105 | } |
| 106 | |
| 107 | /** |
| 108 | * Get the Column entity which column name is "engine_type" from the Row |
| 109 | * entity of attributes. |
| 110 | * @return the Column entity |
| 111 | */ |
| 112 | public Column getEngineTypeColumn() { |
| 113 | ColumnDescription columndesc = new ColumnDescription(NetflowColumn.ENGINETYPE.columnName(), |
| 114 | "getEngineTypeColumn", VersionNum.VERSION100); |
| 115 | return (Column) super.getColumnHandler(columndesc); |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Add a Column entity which column name is "engine_type" to the Row entity |
| 120 | * of attributes. |
| 121 | * @param engineType the column data which column name is "engine_type" |
| 122 | */ |
| 123 | public void setEngineType(Set<Long> engineType) { |
| 124 | ColumnDescription columndesc = new ColumnDescription(NetflowColumn.ENGINETYPE.columnName(), |
| 125 | "setEngineType", VersionNum.VERSION100); |
| 126 | super.setDataHandler(columndesc, engineType); |
| 127 | } |
| 128 | |
| 129 | /** |
| 130 | * Get the Column entity which column name is "external_ids" from the Row |
| 131 | * entity of attributes. |
| 132 | * @return the Column entity |
| 133 | */ |
| 134 | public Column getExternalIdsColumn() { |
| 135 | ColumnDescription columndesc = new ColumnDescription(NetflowColumn.EXTERNALIDS.columnName(), |
| 136 | "getExternalIdsColumn", VersionNum.VERSION100); |
| 137 | return (Column) super.getColumnHandler(columndesc); |
| 138 | } |
| 139 | |
| 140 | /** |
| 141 | * Add a Column entity which column name is "external_ids" to the Row entity |
| 142 | * of attributes. |
| 143 | * @param externalIds the column data which column name is "external_ids" |
| 144 | */ |
| 145 | public void setExternalIds(Map<String, String> externalIds) { |
| 146 | ColumnDescription columndesc = new ColumnDescription(NetflowColumn.EXTERNALIDS.columnName(), |
| 147 | "setExternalIds", VersionNum.VERSION100); |
| 148 | super.setDataHandler(columndesc, externalIds); |
| 149 | } |
| 150 | |
| 151 | /** |
| 152 | * Get the Column entity which column name is "add_id_to_interface" from the |
| 153 | * Row entity of attributes. |
| 154 | * @return the Column entity |
| 155 | */ |
| 156 | public Column getAddIdToInterfaceColumn() { |
| 157 | ColumnDescription columndesc = new ColumnDescription(NetflowColumn.ADDIDTOINTERFACE.columnName(), |
| 158 | "getAddIdToInterfaceColumn", |
| 159 | VersionNum.VERSION100); |
| 160 | return (Column) super.getColumnHandler(columndesc); |
| 161 | } |
| 162 | |
| 163 | /** |
| 164 | * Add a Column entity which column name is "add_id_to_interface" to the Row |
| 165 | * entity of attributes. |
| 166 | * @param addIdToInterface the column data which column name is |
| 167 | * "add_id_to_interface" |
| 168 | */ |
| 169 | public void setAddIdToInterface(Boolean addIdToInterface) { |
| 170 | ColumnDescription columndesc = new ColumnDescription(NetflowColumn.ADDIDTOINTERFACE.columnName(), |
| 171 | "setAddIdToInterface", VersionNum.VERSION100); |
| 172 | super.setDataHandler(columndesc, addIdToInterface); |
| 173 | } |
| 174 | |
| 175 | /** |
| 176 | * Get the Column entity which column name is "engine_id" from the Row |
| 177 | * entity of attributes. |
| 178 | * @return the Column entity |
| 179 | */ |
| 180 | public Column getEngineIdColumn() { |
| 181 | ColumnDescription columndesc = new ColumnDescription(NetflowColumn.ENGINETYPE.columnName(), |
| 182 | "getEngineIdColumn", VersionNum.VERSION100); |
| 183 | return (Column) super.getColumnHandler(columndesc); |
| 184 | } |
| 185 | |
| 186 | /** |
| 187 | * Add a Column entity which column name is "engine_id" to the Row entity of |
| 188 | * attributes. |
| 189 | * @param engineId the column data which column name is "engine_id" |
| 190 | */ |
| 191 | public void setEngineId(Set<Long> engineId) { |
| 192 | ColumnDescription columndesc = new ColumnDescription(NetflowColumn.ENGINETYPE.columnName(), |
| 193 | "setEngineId", VersionNum.VERSION100); |
| 194 | super.setDataHandler(columndesc, engineId); |
| 195 | } |
| 196 | |
| 197 | } |