blob: f094a2270a098614a0161f5522ad0e5901a1c9fd [file] [log] [blame]
Zoeycd48d222015-08-04 16:43:42 +08001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
Zoeycd48d222015-08-04 16:43:42 +08003 *
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 Sflow Table.
29 */
30public class Sflow extends AbstractOvsdbTableService {
31 /**
32 * Sflow table column name.
33 */
34 public enum SflowColumn {
35 TARGETS("targets"), AGENT("agent"), EXTERNALIDS("external_ids"), HAEDER("header"),
36 POLLING("polling"), SAMPLING("sampling");
37
38 private final String columnName;
39
40 private SflowColumn(String columnName) {
41 this.columnName = columnName;
42 }
43
44 /**
45 * Returns the table column name for SflowColumn.
46 * @return the table column name
47 */
48 public String columnName() {
49 return columnName;
50 }
51 }
52
53 /**
54 * Constructs a Sflow object. Generate Sflow Table Description.
55 * @param dbSchema DatabaseSchema
56 * @param row Row
57 */
58 public Sflow(DatabaseSchema dbSchema, Row row) {
59 super(dbSchema, row, OvsdbTable.SFLOW, 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(SflowColumn.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(SflowColumn.TARGETS.columnName(), "setTargets",
80 VersionNum.VERSION100);
81 super.setDataHandler(columndesc, targets);
82 }
83
84 /**
85 * Get the Column entity which column name is "agent" from the Row entity of
86 * attributes.
87 * @return the Column entity
88 */
89 public Column getAgentColumn() {
90 ColumnDescription columndesc = new ColumnDescription(SflowColumn.AGENT.columnName(),
91 "getAgentColumn", VersionNum.VERSION100);
92 return (Column) super.getColumnHandler(columndesc);
93 }
94
95 /**
96 * Add a Column entity which column name is "agent" to the Row entity of
97 * attributes.
98 * @param agent the column data which column name is "agent"
99 */
100 public void setAgent(Set<String> agent) {
101 ColumnDescription columndesc = new ColumnDescription(SflowColumn.AGENT.columnName(), "setAgent",
102 VersionNum.VERSION100);
103 super.setDataHandler(columndesc, agent);
104 }
105
106 /**
107 * Get the Column entity which column name is "external_ids" from the Row
108 * entity of attributes.
109 * @return the Column entity
110 */
111 public Column getExternalIdsColumn() {
112 ColumnDescription columndesc = new ColumnDescription(SflowColumn.EXTERNALIDS.columnName(),
113 "getExternalIdsColumn", VersionNum.VERSION100);
114 return (Column) super.getColumnHandler(columndesc);
115 }
116
117 /**
118 * Add a Column entity which column name is "external_ids" to the Row entity
119 * of attributes.
120 * @param externalIds the column data which column name is "external_ids"
121 */
122 public void setExternalIds(Map<String, String> externalIds) {
123 ColumnDescription columndesc = new ColumnDescription(SflowColumn.EXTERNALIDS.columnName(),
124 "setExternalIds", VersionNum.VERSION100);
125 super.setDataHandler(columndesc, externalIds);
126 }
127
128 /**
129 * Get the Column entity which column name is "header" from the Row entity
130 * of attributes.
131 * @return the Column entity
132 */
133 public Column getHeaderColumn() {
134 ColumnDescription columndesc = new ColumnDescription(SflowColumn.HAEDER.columnName(),
135 "getHeaderColumn", VersionNum.VERSION100);
136 return (Column) super.getColumnHandler(columndesc);
137 }
138
139 /**
140 * Add a Column entity which column name is "header" to the Row entity of
141 * attributes.
142 * @param header the column data which column name is "header"
143 */
144 public void setHeader(Set<Long> header) {
145 ColumnDescription columndesc = new ColumnDescription(SflowColumn.HAEDER.columnName(), "setHeader",
146 VersionNum.VERSION100);
147 super.setDataHandler(columndesc, header);
148 }
149
150 /**
151 * Get the Column entity which column name is "polling" from the Row entity
152 * of attributes.
153 * @return the Column entity
154 */
155 public Column getPollingColumn() {
156 ColumnDescription columndesc = new ColumnDescription(SflowColumn.POLLING.columnName(),
157 "getPollingColumn", VersionNum.VERSION100);
158 return (Column) super.getColumnHandler(columndesc);
159 }
160
161 /**
162 * Add a Column entity which column name is "polling" to the Row entity of
163 * attributes.
164 * @param polling the column data which column name is "polling"
165 */
166 public void setPolling(Set<Long> polling) {
167 ColumnDescription columndesc = new ColumnDescription(SflowColumn.POLLING.columnName(), "setPolling",
168 VersionNum.VERSION100);
169 super.setDataHandler(columndesc, polling);
170 }
171
172 /**
173 * Get the Column entity which column name is "sampling" from the Row entity
174 * of attributes.
175 * @return the Column entity
176 */
177 public Column getSamplingColumn() {
178 ColumnDescription columndesc = new ColumnDescription(SflowColumn.SAMPLING.columnName(),
179 "getSamplingColumn", VersionNum.VERSION100);
180 return (Column) super.getColumnHandler(columndesc);
181 }
182
183 /**
184 * Add a Column entity which column name is "sampling" to the Row entity of
185 * attributes.
186 * @param sampling the column data which column name is "sampling"
187 */
188 public void setSampling(Set<Long> sampling) {
189 ColumnDescription columndesc = new ColumnDescription(SflowColumn.SAMPLING.columnName(),
190 "setSampling", VersionNum.VERSION100);
191 super.setDataHandler(columndesc, sampling);
192 }
193}