MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / getDynamicProperty

Method getDynamicProperty

libminifi/src/core/ConfigurableComponent.cpp:215–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215bool 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
238bool ConfigurableComponent::createDynamicProperty(const std::string &name, const std::string &value) {
239 if (!supportsDynamicProperties()) {

Callers 2

get_propertyFunction · 0.45

Calls 8

getRequiredMethod · 0.80
log_errorMethod · 0.80
log_debugMethod · 0.80
findMethod · 0.45
endMethod · 0.45
getValueMethod · 0.45
getNameMethod · 0.45
to_stringMethod · 0.45

Tested by

no test coverage detected