blob: c29f2e01f0b974bb74eb61c5e16867ee8812ef15 [file] [log] [blame]
YuanyouZhang362c7ab2015-08-03 17:07:20 +08001/*
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 */
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 Ipfix Table.
29 */
30public class Ipfix extends AbstractOvsdbTableService {
31 /**
32 * Ipfix table column name.
33 */
34 public enum IpfixColumn {
35 TARGETS("targets"), SAMPLING("sampling"), OBSDOMAINID("obs_domain_id"), OBSPOINTID("obs_point_id"),
36 CACHEACTIVETIMEOUT("cache_active_timeout"), EXTERNALIDS("external_ids"),
37 CACHEMAXFLOWS("cache_max_flows");
38
39 private final String columnName;
40
41 private IpfixColumn(String columnName) {
42 this.columnName = columnName;
43 }
44
45 /**
46 * Returns the table column name for IpfixColumn.
47 * @return the table column name
48 */
49 public String columnName() {
50 return columnName;
51 }
52 }
53
54 /**
55 * Constructs a Ipfix object. Generate Ipfix Table Description.
56 * @param dbSchema DatabaseSchema
57 * @param row Row
58 */
59 public Ipfix(DatabaseSchema dbSchema, Row row) {
60 super(dbSchema, row, OvsdbTable.IPFIX, VersionNum.VERSION710);
61 }
62
63 /**
64 * Get the Column entity which column name is "targets" from the Row entity
65 * of attributes.
66 * @return the Column entity which column name is "targets"
67 */
68 public Column getTargetsColumn() {
69 ColumnDescription columndesc = new ColumnDescription(IpfixColumn.TARGETS.columnName(),
70 "getTargetsColumn", VersionNum.VERSION710);
71 return (Column) super.getColumnHandler(columndesc);
72 }
73
74 /**
75 * Add a Column entity which column name is "targets" to the Row entity of
76 * attributes.
77 * @param targets the column data which column name is "targets"
78 */
79 public void setTargets(Set<String> targets) {
80 ColumnDescription columndesc = new ColumnDescription(IpfixColumn.TARGETS.columnName(),
81 "setTargets",
82 VersionNum.VERSION710);
83 super.setDataHandler(columndesc, targets);
84 }
85
86 /**
87 * Get the Column entity which column name is "sampling" from the Row entity
88 * of attributes.
89 * @return the Column entity which column name is "sampling"
90 */
91 public Column getSamplingColumn() {
92 ColumnDescription columndesc = new ColumnDescription(IpfixColumn.SAMPLING.columnName(),
93 "getSamplingColumn", VersionNum.VERSION710);
94 return (Column) super.getColumnHandler(columndesc);
95 }
96
97 /**
98 * Add a Column entity which column name is "sampling" to the Row entity of
99 * attributes.
100 * @param sampling the column data which column name is "sampling"
101 */
102 public void setSampling(Set<Long> sampling) {
103 ColumnDescription columndesc = new ColumnDescription(IpfixColumn.SAMPLING.columnName(),
104 "setSampling", VersionNum.VERSION710);
105 super.setDataHandler(columndesc, sampling);
106 }
107
108 /**
109 * Get the Column entity which column name is "obs_domain_id" from the Row
110 * entity of attributes.
111 * @return the Column entity which column name is "obs_domain_id"
112 */
113 public Column getObsDomainIdColumn() {
114 ColumnDescription columndesc = new ColumnDescription(IpfixColumn.OBSDOMAINID.columnName(),
115 "getObsDomainIdColumn", VersionNum.VERSION710);
116 return (Column) super.getColumnHandler(columndesc);
117 }
118
119 /**
120 * Add a Column entity which column name is "obs_domain_id" to the Row
121 * entity of attributes.
122 * @param obsdomainid the column data which column name is "obs_domain_id"
123 */
124 public void setObsDomainId(Set<Long> obsdomainid) {
125 ColumnDescription columndesc = new ColumnDescription(IpfixColumn.OBSDOMAINID.columnName(),
126 "setObsDomainId", VersionNum.VERSION710);
127 super.setDataHandler(columndesc, obsdomainid);
128 }
129
130 /**
131 * Get the Column entity which column name is "obs_point_id" from the Row
132 * entity of attributes.
133 * @return the Column entity which column name is "obs_point_id"
134 */
135 public Column getObsPointIdColumn() {
136 ColumnDescription columndesc = new ColumnDescription(IpfixColumn.OBSPOINTID.columnName(),
137 "getObsPointIdColumn", VersionNum.VERSION710);
138 return (Column) super.getColumnHandler(columndesc);
139 }
140
141 /**
142 * Add a Column entity which column name is "obs_point_id" to the Row entity
143 * of attributes.
144 * @param obsPointId the column data which column name is "obs_point_id"
145 */
146 public void setObsPointId(Set<Long> obsPointId) {
147 ColumnDescription columndesc = new ColumnDescription(IpfixColumn.OBSPOINTID.columnName(),
148 "setObsPointId", VersionNum.VERSION710);
149 super.setDataHandler(columndesc, obsPointId);
150 }
151
152 /**
153 * Get the Column entity which column name is "cache_active_timeout" from
154 * the Row entity of attributes.
155 * @return the Column entity which column name is "cache_active_timeout"
156 */
157 public Column getCacheActiveTimeoutColumn() {
158 ColumnDescription columndesc = new ColumnDescription(IpfixColumn.CACHEACTIVETIMEOUT.columnName(),
159 "getCacheActiveTimeoutColumn",
160 VersionNum.VERSION730);
161 return (Column) super.getColumnHandler(columndesc);
162 }
163
164 /**
165 * Add a Column entity which column name is "cache_active_timeout" to the
166 * Row entity of attributes.
167 * @param cacheActiveTimeout the column data which column name is
168 * "cache_active_timeout"
169 */
170 public void setCacheActiveTimeout(Set<Long> cacheActiveTimeout) {
171 ColumnDescription columndesc = new ColumnDescription(IpfixColumn.CACHEACTIVETIMEOUT.columnName(),
172 "setCacheActiveTimeout", VersionNum.VERSION730);
173 super.setDataHandler(columndesc, cacheActiveTimeout);
174 }
175
176 /**
177 * Get the Column entity which column name is "cache_max_flows" from the Row
178 * entity of attributes.
179 * @return the Column entity which column name is "cache_max_flows"
180 */
181 public Column getCacheMaxFlowsColumn() {
182 ColumnDescription columndesc = new ColumnDescription(IpfixColumn.CACHEMAXFLOWS.columnName(),
183 "getCacheMaxFlowsColumn", VersionNum.VERSION730);
184 return (Column) super.getColumnHandler(columndesc);
185 }
186
187 /**
188 * Add a Column entity which column name is "cache_max_flows" to the Row
189 * entity of attributes.
190 * @param cacheMaxFlows the column data which column name is
191 * "cache_max_flows"
192 */
193 public void setCacheMaxFlows(Set<Long> cacheMaxFlows) {
194 ColumnDescription columndesc = new ColumnDescription(IpfixColumn.CACHEMAXFLOWS.columnName(),
195 "setCacheMaxFlows", VersionNum.VERSION730);
196 super.setDataHandler(columndesc, cacheMaxFlows);
197 }
198
199 /**
200 * Get the Column entity which column name is "external_ids" from the Row
201 * entity of attributes.
202 * @return the Column entity which column name is "external_ids"
203 */
204 public Column getExternalIdsColumn() {
205 ColumnDescription columndesc = new ColumnDescription(IpfixColumn.EXTERNALIDS.columnName(),
206 "getExternalIdsColumn", VersionNum.VERSION710);
207 return (Column) super.getColumnHandler(columndesc);
208 }
209
210 /**
211 * Add a Column entity which column name is "external_ids" to the Row entity
212 * of attributes.
213 * @param externalIds the column data which column name is "external_ids"
214 */
215 public void setExternalIds(Map<String, String> externalIds) {
216 ColumnDescription columndesc = new ColumnDescription(IpfixColumn.EXTERNALIDS.columnName(),
217 "setExternalIds", VersionNum.VERSION710);
218 super.setDataHandler(columndesc, externalIds);
219 }
220}