Kea 2.7.5
translator_logger.h
Go to the documentation of this file.
1// Copyright (C) 2018-2023 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_LOGGER_H
8#define ISC_TRANSLATOR_LOGGER_H 1
9
10#include <yang/translator.h>
11
12namespace isc {
13namespace yang {
14
84
93class TranslatorLogger : virtual public Translator {
94public:
99 TranslatorLogger(sysrepo::Session session, const std::string& model);
100
102 virtual ~TranslatorLogger() = default;
103
111 isc::data::ElementPtr getLogger(libyang::DataNode const& data_node);
112
117 void setLogger(const std::string& xpath, isc::data::ConstElementPtr elem);
118
119protected:
127 isc::data::ElementPtr getOutputOption(libyang::DataNode const& data_node);
128
136 isc::data::ElementPtr getOutputOptions(libyang::DataNode const& data_node);
137
142 void setOutputOption(const std::string& xpath,
144
150 void setOutputOptions(const std::string& xpath,
152
160 isc::data::ElementPtr getLoggerKea(libyang::DataNode const& data_node);
161
166 void setLoggerKea(const std::string& xpath,
168}; // TranslatorLogger
169
174class TranslatorLoggers : virtual public TranslatorLogger {
175public:
180 TranslatorLoggers(sysrepo::Session session, const std::string& model);
181
183 virtual ~TranslatorLoggers() = default;
184
192 isc::data::ConstElementPtr getLoggers(libyang::DataNode const& data_node);
193
202
208 void setLoggers(const std::string& xpath,
210
211protected:
219 isc::data::ElementPtr getLoggersKea(libyang::DataNode const& data_node);
220
226 void setLoggersKea(const std::string& xpath,
228}; // TranslatorLoggers
229
230} // namespace yang
231} // namespace isc
232
233#endif // ISC_TRANSLATOR_LOGGER_H
Logger translation between YANG and JSON.
isc::data::ElementPtr getOutputOptions(libyang::DataNode const &data_node)
Translate output options from YANG to JSON.
void setLogger(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set logger from JSON to YANG.
void setOutputOption(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set an output option from JSON to YANG.
void setLoggerKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setLogger for loggers.
isc::data::ElementPtr getLoggerKea(libyang::DataNode const &data_node)
getLogger JSON for loggers.
isc::data::ElementPtr getOutputOption(libyang::DataNode const &data_node)
Translate an output option from YANG to JSON.
TranslatorLogger(sysrepo::Session session, const std::string &model)
Constructor.
isc::data::ElementPtr getLogger(libyang::DataNode const &data_node)
Translate a logger from YANG to JSON.
void setOutputOptions(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set output options from JSON to YANG.
virtual ~TranslatorLogger()=default
Destructor.
A translator class for converting a logger list between YANG and JSON.
void setLoggers(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set loggers from JSON to YANG.
isc::data::ConstElementPtr getLoggersFromAbsoluteXpath(std::string const &xpath)
Translate loggers from YANG to JSON.
isc::data::ElementPtr getLoggersKea(libyang::DataNode const &data_node)
getLoggers JSON for loggers.
virtual ~TranslatorLoggers()=default
Destructor.
isc::data::ConstElementPtr getLoggers(libyang::DataNode const &data_node)
Translate loggers from YANG to JSON.
void setLoggersKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setLoggers for loggers.
TranslatorLoggers(sysrepo::Session session, const std::string &model)
Constructor.
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.