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

Method setProperty

libminifi/src/core/ConfigurableComponent.cpp:68–93  ·  view source on GitHub ↗

* Sets the property using the provided name * @param property name * @param value property value. * @return result of setting property. */

Source from the content-addressed store, hash-verified

66 * @return result of setting property.
67 */
68bool ConfigurableComponent::setProperty(const std::string name, std::string value) {
69 std::lock_guard<std::mutex> lock(configuration_mutex_);
70 auto it = properties_.find(name);
71
72 if (it != properties_.end()) {
73 Property orig_property = it->second;
74 Property& new_property = it->second;
75 auto onExit = gsl::finally([&]{
76 onPropertyModified(orig_property, new_property);
77 logger_->log_debug("Component %s property name %s value %s", name, new_property.getName(), value);
78 });
79 new_property.setValue(value);
80 return true;
81 } else {
82 if (accept_all_properties_) {
83 Property new_property(name, STAR_PROPERTIES, value, false, "", { }, { });
84 new_property.setTransient();
85 new_property.setValue(value);
86 properties_.insert(std::pair<std::string, Property>(name, new_property));
87 return true;
88 } else {
89 logger_->log_debug("Component %s cannot be set to %s", name, value);
90 return false;
91 }
92 }
93}
94
95/**
96 * Sets the property using the provided name

Callers 2

updatePropertyValueMethod · 0.45
parseSinglePropertyMethod · 0.45

Calls 9

log_debugMethod · 0.80
setTransientMethod · 0.80
findMethod · 0.45
endMethod · 0.45
getNameMethod · 0.45
setValueMethod · 0.45
insertMethod · 0.45
to_stringMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected