32 vector<string> current_libraries = HooksManager::getLibraryNames();
33 if (current_libraries.empty() && libraries_.empty()) {
39 vector<string> error_libs = HooksManager::validateLibraries(lib_names);
40 if (!error_libs.empty()) {
43 string error_list = error_libs[0];
44 for (
size_t i = 1; i < error_libs.size(); ++i) {
45 error_list += (string(
", ") + error_libs[i]);
48 "hooks libraries failed to validate - "
49 "library or libraries in error are: "
50 << error_list <<
"(" << position <<
")");
55 HooksConfig::loadLibraries()
const {
60 if (!HooksManager::loadLibraries(libraries_)) {
62 "One or more hook libraries failed to load");
77 for (isc::hooks::HookLibsCollection::const_iterator this_it = libraries_.begin();
78 this_it != libraries_.end(); ++this_it) {
80 for (isc::hooks::HookLibsCollection::const_iterator other_it =
81 other.libraries_.begin(); other_it != other.libraries_.end(); ++other_it) {
82 if (this_it->first != other_it->first) {
85 if (
isNull(this_it->second) &&
isNull(other_it->second)) {
89 if (
isNull(this_it->second) ||
isNull(other_it->second)) {
92 if (this_it->second->equals(*other_it->second)) {
106 HooksConfig::toElement()
const {
110 for (HookLibsCollection::const_iterator hl = libraries_.begin();
111 hl != libraries_.end(); ++hl) {
115 map->set(
"library", Element::create(hl->first));
117 if (!
isNull(hl->second)) {
118 map->set(
"parameters", hl->second);
std::vector< std::string > extractNames(const isc::hooks::HookLibsCollection &libraries)
Extracts names from HookLibsCollection.
boost::shared_ptr< Element > ElementPtr
Wrapper class that holds hooks libraries configuration.
bool isNull(ConstElementPtr p)
Checks whether the given ElementPtr is a NULL pointer.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Represents the position of the data element within a configuration string.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Exception thrown when a library failed to validate.