aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/onos/protocols/ovsdb/rfc/src/main/java/org/onosproject/ovsdb/rfc/table/Mirror.java
blob: ec022fee09eec39d824f5e49fae7159f85f7aa85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
/*
 * Copyright 2015 Open Networking Laboratory
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.onosproject.ovsdb.rfc.table;

import java.util.Map;
import java.util.Set;

import org.onosproject.ovsdb.rfc.notation.Column;
import org.onosproject.ovsdb.rfc.notation.Row;
import org.onosproject.ovsdb.rfc.notation.UUID;
import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
import org.onosproject.ovsdb.rfc.tableservice.AbstractOvsdbTableService;
import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription;

/**
 * This class provides operations of Mirror Table.
 */
public class Mirror extends AbstractOvsdbTableService {
    /**
     * Mirror table column name.
     */
    public enum MirrorColumn {
        NAME("name"), SELECTSRCPORT("select_src_port"), SELECTDSTPORT("select_dst_port"),
        SELECTVLAN("select_vlan"), OUTPUTPORT("output_port"), EXTERNALIDS("external_ids"),
        OUTPUTVLAN("output_vlan"), STATISTICS("statistics"), SELECTALL("select_all");

        private final String columnName;

        private MirrorColumn(String columnName) {
            this.columnName = columnName;
        }

        /**
         * Returns the table column name for MirrorColumn.
         * @return the table column name
         */
        public String columnName() {
            return columnName;
        }
    }

    /**
     * Constructs a Mirror object. Generate Mirror Table Description.
     * @param dbSchema DatabaseSchema
     * @param row Row
     */
    public Mirror(DatabaseSchema dbSchema, Row row) {
        super(dbSchema, row, OvsdbTable.MIRROR, VersionNum.VERSION100);
    }

    /**
     * Get the Column entity which column name is "name" from the Row entity of
     * attributes.
     * @return the Column entity which column name is "name"
     */
    public Column getNameColumn() {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.NAME.columnName(),
                                                             "getNameColumn",
                                                             VersionNum.VERSION100);
        return (Column) super.getColumnHandler(columndesc);
    }

    /**
     * Add a Column entity which column name is "name" to the Row entity of
     * attributes.
     * @param name the column data which column name is "name"
     */
    public void setName(Set<String> name) {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.NAME.columnName(),
                                                             "setName",
                                                             VersionNum.VERSION100);
        super.setDataHandler(columndesc, name);
    }

    /**
     * Get the column data which column name is "name" from the Row entity of
     * attributes.
     * @return the column data which column name is "name"
     */
    public Set<String> getName() {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.NAME.columnName(),
                                                             "getName",
                                                             VersionNum.VERSION100);
        return (Set<String>) super.getDataHandler(columndesc);
    }

    /**
     * Get the Column entity which column name is "select_src_port" from the Row
     * entity of attributes.
     * @return the Column entity which column name is "select_src_port"
     */
    public Column getSelectSrcPortColumn() {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.SELECTSRCPORT.columnName(),
                                                             "getSelectSrcPortColumn", VersionNum.VERSION100);
        return (Column) super.getColumnHandler(columndesc);
    }

    /**
     * Add a Column entity which column name is "select_src_port" to the Row
     * entity of attributes.
     * @param selectSrcPort the column data which column name is
     *            "select_src_port"
     */
    public void setSelectSrcPort(Set<UUID> selectSrcPort) {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.SELECTSRCPORT.columnName(),
                                                             "setSelectSrcPort", VersionNum.VERSION100);
        super.setDataHandler(columndesc, selectSrcPort);
    }

    /**
     * Get the Column entity which column name is "select_dst_port" from the Row
     * entity of attributes.
     * @return the Column entity which column name is "select_dst_port"
     */
    public Column getSelectDstPortColumn() {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.SELECTDSTPORT.columnName(),
                                                             "getSelectDstPortColumn", VersionNum.VERSION100);
        return (Column) super.getColumnHandler(columndesc);
    }

    /**
     * Add a Column entity which column name is "select_dst_port" to the Row
     * entity of attributes.
     * @param selectDstPrt the column data which column name is
     *            "select_dst_port"
     */
    public void setSelectDstPort(Set<UUID> selectDstPrt) {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.SELECTDSTPORT.columnName(),
                                                             "setSelectDstPort", VersionNum.VERSION100);
        super.setDataHandler(columndesc, selectDstPrt);
    }

    /**
     * Get the Column entity which column name is "select_vlan" from the Row
     * entity of attributes.
     * @return the Column entity which column name is "select_vlan"
     */
    public Column getSelectVlanColumn() {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.SELECTVLAN.columnName(),
                                                             "getSelectVlanColumn", VersionNum.VERSION100);
        return (Column) super.getColumnHandler(columndesc);
    }

    /**
     * Add a Column entity which column name is "select_vlan" to the Row entity
     * of attributes.
     * @param selectVlan the column data which column name is "select_vlan"
     */
    public void setSelectVlan(Set<Long> selectVlan) {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.SELECTVLAN.columnName(),
                                                             "setSelectVlan", VersionNum.VERSION100);
        super.setDataHandler(columndesc, selectVlan);
    }

    /**
     * Get the Column entity which column name is "output_port" from the Row
     * entity of attributes.
     * @return the Column entity which column name is "output_port"
     */
    public Column getOutputPortColumn() {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.OUTPUTPORT.columnName(),
                                                             "getOutputPortColumn", VersionNum.VERSION100);
        return (Column) super.getColumnHandler(columndesc);
    }

    /**
     * Add a Column entity which column name is "output_port" to the Row entity
     * of attributes.
     * @param outputPort the column data which column name is "output_port"
     */
    public void setOutputPort(Set<UUID> outputPort) {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.OUTPUTPORT.columnName(),
                                                             "setOutputPort", VersionNum.VERSION100);
        super.setDataHandler(columndesc, outputPort);
    }

    /**
     * Get the Column entity which column name is "output_vlan" from the Row
     * entity of attributes.
     * @return the Column entity which column name is "output_vlan"
     */
    public Column getOutputVlanColumn() {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.OUTPUTVLAN.columnName(),
                                                             "getOutputVlanColumn", VersionNum.VERSION100);
        return (Column) super.getColumnHandler(columndesc);
    }

    /**
     * Add a Column entity which column name is "output_vlan" to the Row entity
     * of attributes.
     * @param outputVlan the column data which column name is "output_vlan"
     */
    public void setOutputVlan(Set<Long> outputVlan) {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.OUTPUTVLAN.columnName(),
                                                             "setOutputVlan", VersionNum.VERSION100);
        super.setDataHandler(columndesc, outputVlan);
    }

    /**
     * Get the Column entity which column name is "statistics" from the Row
     * entity of attributes.
     * @return the Column entity which column name is "statistics"
     */
    public Column getStatisticsColumn() {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.STATISTICS.columnName(),
                                                             "getStatisticsColumn", VersionNum.VERSION640);
        return (Column) super.getColumnHandler(columndesc);
    }

    /**
     * Add a Column entity which column name is "statistics" to the Row entity
     * of attributes.
     * @param statistics the column data which column name is "statistics"
     */
    public void setStatistics(Map<String, Long> statistics) {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.STATISTICS.columnName(),
                                                             "setStatistics", VersionNum.VERSION640);
        super.setDataHandler(columndesc, statistics);
    }

    /**
     * Get the Column entity which column name is "external_ids" from the Row
     * entity of attributes.
     * @return the Column entity which column name is "external_ids"
     */
    public Column getExternalIdsColumn() {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.EXTERNALIDS.columnName(),
                                                             "getExternalIdsColumn", VersionNum.VERSION100);
        return (Column) super.getColumnHandler(columndesc);
    }

    /**
     * Add a Column entity which column name is "external_ids" to the Row entity
     * of attributes.
     * @param externalIds the column data which column name is "external_ids"
     */
    public void setExternalIds(Map<String, String> externalIds) {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.EXTERNALIDS.columnName(),
                                                             "setExternalIds", VersionNum.VERSION100);
        super.setDataHandler(columndesc, externalIds);
    }

    /**
     * Get the Column entity which column name is "select_all" from the Row
     * entity of attributes.
     * @return the Column entity which column name is "select_all"
     */
    public Column getSelectAllColumn() {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.SELECTALL.columnName(),
                                                             "getSelectAllColumn", VersionNum.VERSION620);
        return (Column) super.getColumnHandler(columndesc);
    }

    /**
     * Add a Column entity which column name is "select_all" to the Row entity
     * of attributes.
     * @param selectAll the column data which column name is "select_all"
     */
    public void setSelectAll(Boolean selectAll) {
        ColumnDescription columndesc = new ColumnDescription(MirrorColumn.SELECTALL.columnName(),
                                                             "setSelectAll", VersionNum.VERSION620);
        super.setDataHandler(columndesc, selectAll);
    }
}