blob: ed144ee3bb86ec42442f771f5d7e69b31cf72089 [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;
19
20import org.onosproject.ovsdb.rfc.notation.Column;
21import org.onosproject.ovsdb.rfc.notation.Row;
22import org.onosproject.ovsdb.rfc.schema.DatabaseSchema;
23import org.onosproject.ovsdb.rfc.tableservice.AbstractOvsdbTableService;
24import org.onosproject.ovsdb.rfc.tableservice.ColumnDescription;
25
26/**
27 * This class provides operations of Ssl Table.
28 */
29public class Ssl extends AbstractOvsdbTableService {
30 /**
31 * Ssl table column name.
32 */
33 public enum SslColumn {
34 CACERT("ca_cert"), EXTERNALIDS("external_ids"), BOOTSTRAPCACERT("bootstrap_ca_cert"),
35 CERTIFICATE("certificate"), PRIVATEKEY("private_key");
36
37 private final String columnName;
38
39 private SslColumn(String columnName) {
40 this.columnName = columnName;
41 }
42
43 /**
44 * Returns the table column name for SslColumn.
45 * @return the table column name
46 */
47 public String columnName() {
48 return columnName;
49 }
50 }
51
52 /**
53 * Constructs a Ssl object. Generate Ssl Table Description.
54 * @param dbSchema DatabaseSchema
55 * @param row Row
56 */
57 public Ssl(DatabaseSchema dbSchema, Row row) {
58 super(dbSchema, row, OvsdbTable.SSL, VersionNum.VERSION100);
59 }
60
61 /**
62 * Get the Column entity which column name is "ca_cert" from the Row entity
63 * of attributes.
64 * @return the Column entity
65 */
66 public Column getCaCertColumn() {
67 ColumnDescription columndesc = new ColumnDescription(SslColumn.CACERT.columnName(),
68 "getCaCertColumn", VersionNum.VERSION100);
69 return (Column) super.getColumnHandler(columndesc);
70 }
71
72 /**
73 * Add a Column entity which column name is "ca_cert" to the Row entity of
74 * attributes.
75 * @param caCert the column data which column name is "ca_cert"
76 */
77 public void setCaCert(String caCert) {
78 ColumnDescription columndesc = new ColumnDescription(SslColumn.CACERT.columnName(), "setCaCert",
79 VersionNum.VERSION100);
80 super.setDataHandler(columndesc, caCert);
81 }
82
83 /**
84 * Get the Column entity which column name is "external_ids" from the Row
85 * entity of attributes.
86 * @return the Column entity
87 */
88 public Column getExternalIdsColumn() {
89 ColumnDescription columndesc = new ColumnDescription(SslColumn.EXTERNALIDS.columnName(),
90 "getExternalIdsColumn", VersionNum.VERSION100);
91 return (Column) super.getColumnHandler(columndesc);
92 }
93
94 /**
95 * Add a Column entity which column name is "external_ids" to the Row entity
96 * of attributes.
97 * @param externalIds the column data which column name is "external_ids"
98 */
99 public void setExternalIds(Map<String, String> externalIds) {
100 ColumnDescription columndesc = new ColumnDescription(SslColumn.EXTERNALIDS.columnName(),
101 "setExternalIds", VersionNum.VERSION100);
102 super.setDataHandler(columndesc, externalIds);
103 }
104
105 /**
106 * Get the Column entity which column name is "bootstrap_ca_cert" from the
107 * Row entity of attributes.
108 * @return the Column entity
109 */
110 public Column getBootstrapCaCertColumn() {
111 ColumnDescription columndesc = new ColumnDescription(SslColumn.BOOTSTRAPCACERT.columnName(),
112 "getBootstrapCaCertColumn",
113 VersionNum.VERSION100);
114 return (Column) super.getColumnHandler(columndesc);
115 }
116
117 /**
118 * Add a Column entity which column name is "bootstrap_ca_cert" to the Row
119 * entity of attributes.
120 * @param bootstrapCaCert the column data which column name is
121 * "bootstrap_ca_cert"
122 */
123 public void setBootstrapCaCert(Boolean bootstrapCaCert) {
124 ColumnDescription columndesc = new ColumnDescription(SslColumn.BOOTSTRAPCACERT.columnName(),
125 "setBootstrapCaCert", VersionNum.VERSION100);
126 super.setDataHandler(columndesc, bootstrapCaCert);
127 }
128
129 /**
130 * Get the Column entity which column name is "certificate" from the Row
131 * entity of attributes.
132 * @return the Column entity
133 */
134 public Column getCertificateColumn() {
135 ColumnDescription columndesc = new ColumnDescription(SslColumn.CERTIFICATE.columnName(),
136 "getCertificateColumn", VersionNum.VERSION100);
137 return (Column) super.getColumnHandler(columndesc);
138 }
139
140 /**
141 * Add a Column entity which column name is "certificate" to the Row entity
142 * of attributes.
143 * @param certificate the column data which column name is "certificate"
144 */
145 public void setCertificate(String certificate) {
146 ColumnDescription columndesc = new ColumnDescription(SslColumn.CERTIFICATE.columnName(),
147 "setCertificate", VersionNum.VERSION100);
148 super.setDataHandler(columndesc, certificate);
149 }
150
151 /**
152 * Get the Column entity which column name is "private_key" from the Row
153 * entity of attributes.
154 * @return the Column entity
155 */
156 public Column getPrivateKeyColumn() {
157 ColumnDescription columndesc = new ColumnDescription(SslColumn.PRIVATEKEY.columnName(),
158 "getPrivateKeyColumn", VersionNum.VERSION100);
159 return (Column) super.getColumnHandler(columndesc);
160 }
161
162 /**
163 * Add a Column entity which column name is "private_key" to the Row entity
164 * of attributes.
165 * @param privatekey the column data which column name is "private_key"
166 */
167 public void setPrivateKey(String privatekey) {
168 ColumnDescription columndesc = new ColumnDescription(SslColumn.PRIVATEKEY.columnName(),
169 "setPrivateKey", VersionNum.VERSION100);
170 super.setDataHandler(columndesc, privatekey);
171 }
172}