21 bool multi_threading_enabled)
const {
31 if (current_libraries.empty() && libraries_.empty()) {
38 multi_threading_enabled);
39 if (!error_libs.empty()) {
42 string error_list = error_libs[0];
43 for (
size_t i = 1; i < error_libs.size(); ++i) {
44 error_list += (string(
", ") + error_libs[i]);
47 "hooks libraries failed to validate - "
48 "library or libraries in error are: "
49 << error_list <<
" (" << position <<
")");
61 "One or more hook libraries failed to load");
76 for (
auto const& this_it : libraries_) {
78 for (
auto const& other_it : other.libraries_) {
79 if (this_it.first != other_it.first) {
89 if (this_it.second->equals(*other_it.second)) {
107 for (
auto const& hl : libraries_) {
114 map->set(
"parameters", hl.second);
static ElementPtr create(const Position &pos=ZERO_POSITION())
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
static ElementPtr createList(const Position &pos=ZERO_POSITION())
Creates an empty ListElement type ElementPtr.
Wrapper class that holds hooks libraries configuration.
bool equal(const HooksConfig &other) const
Compares two Hooks Config classes for equality.
void verifyLibraries(const isc::data::Element::Position &position, bool multi_threading_enabled) const
Verifies that libraries stored in libraries_ are valid.
isc::data::ElementPtr toElement() const
Unparse a configuration object.
void loadLibraries(bool multi_threading_enabled) const
Commits hooks libraries configuration.
static std::vector< std::string > getLibraryNames()
Return list of loaded libraries.
static std::vector< std::string > validateLibraries(const std::vector< std::string > &libraries, bool multi_threading_enabled=false)
Validate library list.
static bool loadLibraries(const HookLibsCollection &libraries, bool multi_threading_enabled=false)
Load and reload libraries.
Exception thrown when a library failed to validate.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
bool isNull(ConstElementPtr p)
Checks whether the given ElementPtr is a NULL pointer.
boost::shared_ptr< Element > ElementPtr
std::vector< std::string > extractNames(const isc::hooks::HookLibsCollection &libraries)
Extracts names from HookLibsCollection.
Defines the logger used by the top-level component of kea-lfc.
Represents the position of the data element within a configuration string.