| 213 | } |
| 214 | |
| 215 | bool ConfigurableComponent::getDynamicProperty(const std::string name, std::string &value) const { |
| 216 | std::lock_guard<std::mutex> lock(configuration_mutex_); |
| 217 | |
| 218 | auto &&it = dynamic_properties_.find(name); |
| 219 | if (it != dynamic_properties_.end()) { |
| 220 | const Property& item = it->second; |
| 221 | if (item.getValue().getValue() == nullptr) { |
| 222 | // empty property value |
| 223 | if (item.getRequired()) { |
| 224 | logger_->log_error("Component %s required dynamic property %s is empty", name, item.getName()); |
| 225 | throw std::runtime_error("Required dynamic property is empty: " + item.getName()); |
| 226 | } |
| 227 | logger_->log_debug("Component %s dynamic property name %s, empty value", name, item.getName()); |
| 228 | return false; |
| 229 | } |
| 230 | value = item.getValue().to_string(); |
| 231 | logger_->log_debug("Component %s dynamic property name %s value %s", name, item.getName(), value); |
| 232 | return true; |
| 233 | } else { |
| 234 | return false; |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | bool ConfigurableComponent::createDynamicProperty(const std::string &name, const std::string &value) { |
| 239 | if (!supportsDynamicProperties()) { |