33 if (current_libraries.empty() && libraries_.empty()) {
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 <<
")");
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)) {
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);
Wrapper class that holds hooks libraries configuration.
bool equal(const HooksConfig &other) const
Compares two Hooks Config classes for equality.
isc::data::ElementPtr toElement() const
Unparse a configuration object.
void verifyLibraries(const isc::data::Element::Position &position) const
Verifies that libraries stored in libraries_ are valid.
void loadLibraries() const
Commits hooks libraries configuration.
static std::vector< std::string > getLibraryNames()
Return list of loaded libraries.
static bool loadLibraries(const HookLibsCollection &libraries)
Load and reload libraries.
static std::vector< std::string > validateLibraries(const std::vector< std::string > &libraries)
Validate library list.
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.