Kea  1.9.9-git
translator_logger.h
Go to the documentation of this file.
1 // Copyright (C) 2018-2019,2021 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 #include <list>
12 
13 namespace isc {
14 namespace yang {
15 
86 
95 class TranslatorLogger : virtual public TranslatorBasic {
96 public:
97 
102 #ifndef HAVE_PRE_0_7_6_SYSREPO
103  TranslatorLogger(sysrepo::S_Session session, const std::string& model);
104 #else
105  TranslatorLogger(S_Session session, const std::string& model);
106 #endif
107 
109  virtual ~TranslatorLogger();
110 
116  isc::data::ElementPtr getLogger(const std::string& xpath);
117 
122  void setLogger(const std::string& xpath, isc::data::ConstElementPtr elem);
123 
124 protected:
130  isc::data::ElementPtr getOutputOption(const std::string& xpath);
131 
137  isc::data::ElementPtr getOutputOptions(const std::string& xpath);
138 
143  void setOutputOption(const std::string& xpath,
145 
151  void setOutputOptions(const std::string& xpath,
153 
159  isc::data::ElementPtr getLoggerKea(const std::string& xpath);
160 
165  void setLoggerKea(const std::string& xpath,
167 };
168 
173 class TranslatorLoggers : virtual public TranslatorLogger {
174 public:
175 
180 #ifndef HAVE_PRE_0_7_6_SYSREPO
181  TranslatorLoggers(sysrepo::S_Session session, const std::string& model);
182 #else
183  TranslatorLoggers(S_Session session, const std::string& model);
184 #endif
185 
187  virtual ~TranslatorLoggers();
188 
194  isc::data::ConstElementPtr getLoggers(const std::string& xpath);
195 
200  void setLoggers(const std::string& xpath,
202 
203 protected:
209  isc::data::ElementPtr getLoggersKea(const std::string& xpath);
210 
216  void setLoggersKea(const std::string& xpath,
218 };
219 
220 }; // end of namespace isc::yang
221 }; // end of namespace isc
222 
223 #endif // ISC_TRANSLATOR_LOGGER_H
TranslatorLoggers(sysrepo::S_Session session, const std::string &model)
Constructor.
Between YANG and JSON translator class for basic values.
Definition: translator.h:27
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
isc::data::ConstElementPtr getLoggers(const std::string &xpath)
Get and translate loggeres from YANG to JSON.
TranslatorLogger(sysrepo::S_Session session, const std::string &model)
Constructor.
isc::data::ElementPtr getOutputOption(const std::string &xpath)
Get and translate an output option from YANG to JSON.
void setLoggerKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setLogger for loggers.
isc::data::ElementPtr getLoggerKea(const std::string &xpath)
getLogger JSON for loggers.
void setLoggersKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setLoggers for loggers.
isc::data::ElementPtr getLoggersKea(const std::string &xpath)
getLoggers JSON for loggers.
A translator class for converting a logger list between YANG and JSON.
void setLogger(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set logger from JSON to YANG.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
isc::data::ElementPtr getOutputOptions(const std::string &xpath)
Get and translate output options from YANG to JSON.
void setLoggers(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set loggeres from JSON to YANG.
void setOutputOption(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set an output option from JSON to YANG.
Logger translation between YANG and JSON.
Defines the logger used by the top-level component of kea-dhcp-ddns.
void setOutputOptions(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set output options from JSON to YANG.
virtual ~TranslatorLogger()
Destructor.
virtual ~TranslatorLoggers()
Destructor.
isc::data::ElementPtr getLogger(const std::string &xpath)
Get and translate a logger from YANG to JSON.