Kea 2.2.0
adaptor.h
Go to the documentation of this file.
1// Copyright (C) 2018-2022 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_ADAPTOR_H
8#define ISC_ADAPTOR_H 1
9
11#include <cc/data.h>
12
13namespace isc {
14namespace yang {
15
17class MissingKey : public isc::Exception {
18public:
19 MissingKey(const char* file, size_t line, const char* what) :
20 isc::Exception(file, line, what)
21 {}
22};
23
30class Adaptor {
31public:
32
34 Adaptor();
35
37 virtual ~Adaptor();
38
52
62 static void fromParent(const std::string& name,
65
75 static void toParent(const std::string& name,
78
124 static void modify(isc::data::ConstElementPtr path,
126 isc::data::ElementPtr config);
127
128};
129
130} // end of namespace isc::yang
131} // end of namespace isc
132
133#endif // ISC_ADAPTOR_H
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
JSON adaptor between canonical Kea and YANG models.
Definition: adaptor.h:30
static void fromParent(const std::string &name, isc::data::ConstElementPtr parent, isc::data::ConstElementPtr list)
Moves a parameter from parent to a list of children.
Definition: adaptor.cc:45
Adaptor()
Constructor.
Definition: adaptor.cc:20
static isc::data::ConstElementPtr getContext(isc::data::ConstElementPtr parent)
Get user context.
Definition: adaptor.cc:27
static void toParent(const std::string &name, isc::data::ElementPtr parent, isc::data::ConstElementPtr list)
Moves a parameter to a parent.
Definition: adaptor.cc:61
virtual ~Adaptor()
Destructor.
Definition: adaptor.cc:23
static void modify(isc::data::ConstElementPtr path, isc::data::ConstElementPtr actions, isc::data::ElementPtr config)
Modify a configuration in its JSON element format.
Definition: adaptor.cc:302
Missing key error.
Definition: adaptor.h:17
MissingKey(const char *file, size_t line, const char *what)
Definition: adaptor.h:19
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:27
boost::shared_ptr< Element > ElementPtr
Definition: data.h:24
Defines the logger used by the top-level component of kea-lfc.