Kea 2.7.0
translator_database.h
Go to the documentation of this file.
1// Copyright (C) 2018-2024 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef ISC_TRANSLATOR_DATABASE_H
8#define ISC_TRANSLATOR_DATABASE_H 1
9
10#include <yang/translator.h>
11
12namespace isc {
13namespace yang {
14
97
104class TranslatorDatabase : virtual public Translator {
105public:
110 TranslatorDatabase(sysrepo::Session session, const std::string& model);
111
113 virtual ~TranslatorDatabase() = default;
114
122 isc::data::ElementPtr getDatabase(libyang::DataNode const& data_node);
123
136 isc::data::ElementPtr getDatabaseFromAbsoluteXpath(std::string const& xpath);
137
145 void setDatabase(const std::string& xpath,
147 bool skip = false);
148
149protected:
157 isc::data::ElementPtr getDatabaseKea(libyang::DataNode const& data_node);
158
165 void setDatabaseKea(const std::string& xpath,
167 bool skip);
168}; // TranslatorDatabase
169
175public:
180 TranslatorDatabases(sysrepo::Session session, const std::string& model);
181
183 virtual ~TranslatorDatabases() = default;
184
193 isc::data::ElementPtr getDatabases(libyang::DataNode const& data_node,
194 std::string const& xpath);
195
209
216 void setDatabases(const std::string& xpath,
218
219protected:
228 isc::data::ElementPtr getDatabasesKea(libyang::DataNode const& data_node,
229 std::string const& xpath);
230
237 void setDatabasesKea(const std::string& xpath,
239}; // TranslatorDatabases
240
241} // namespace yang
242} // namespace isc
243
244#endif // ISC_TRANSLATOR_DATABASE_H
Database access translation between YANG and JSON.
isc::data::ElementPtr getDatabaseKea(libyang::DataNode const &data_node)
getDatabase JSON for kea-dhcp[46]-server models.
isc::data::ElementPtr getDatabase(libyang::DataNode const &data_node)
Translate a database access from YANG to JSON.
TranslatorDatabase(sysrepo::Session session, const std::string &model)
Constructor.
isc::data::ElementPtr getDatabaseFromAbsoluteXpath(std::string const &xpath)
Translate a database access from YANG to JSON.
void setDatabase(const std::string &xpath, isc::data::ConstElementPtr elem, bool skip=false)
Translate and set database access from JSON to YANG.
virtual ~TranslatorDatabase()=default
Destructor.
void setDatabaseKea(const std::string &xpath, isc::data::ConstElementPtr elem, bool skip)
setDatabase for kea-dhcp[46]-server models.
A translator class for converting a database access list between YANG and JSON.
void setDatabasesKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setDatabases for kea-dhcp[46]-server models.
isc::data::ElementPtr getDatabasesFromAbsoluteXpath(std::string const &xpath)
Translate database accesses from YANG to JSON.
void setDatabases(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set database accesses from JSON to YANG.
isc::data::ElementPtr getDatabases(libyang::DataNode const &data_node, std::string const &xpath)
Translate database accesses from YANG to JSON.
virtual ~TranslatorDatabases()=default
Destructor.
TranslatorDatabases(sysrepo::Session session, const std::string &model)
Constructor.
isc::data::ElementPtr getDatabasesKea(libyang::DataNode const &data_node, std::string const &xpath)
getDatabases JSON for kea-dhcp[46]-server models.
Between YANG and JSON translator class for basic values.
Definition translator.h:23
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
Defines the logger used by the top-level component of kea-lfc.