arpadboda commented on a change in pull request #489: MINIFICPP-740: Add 
ability to run NiFi processors from Java and Python
URL: https://github.com/apache/nifi-minifi-cpp/pull/489#discussion_r260292252
 
 

 ##########
 File path: libminifi/include/agent/build_description.h
 ##########
 @@ -59,15 +65,63 @@ struct Components {
   std::vector<ClassDescription> other_components_;
 };
 
-class BuildDescription {
+struct BundleDetails {
+  std::string artifact;
+  std::string group;
+  std::string version;
+};
+
+class ExternalBuildDescription {
+ private:
+
+  static std::vector<struct BundleDetails> &getExternal() {
+    static std::vector<struct BundleDetails> external_groups;
+    return external_groups;
+  }
+
+  static std::map<std::string, struct Components> &getExternalMappings() {
+    static std::map<std::string, struct Components> external_mappings;
+    return external_mappings;
+  }
+
  public:
 
+  static bool addExternalComponent(struct BundleDetails details, const 
ClassDescription &description) {
+    bool found = false;
+    for (const auto &d : getExternal()) {
+      if (d.artifact == details.artifact) {
+        found = true;
+        break;
+      }
+    }
+    if (!found) {
+      getExternal().push_back(details);
+    }
+    if (description.is_controller_service_) {
+      
getExternalMappings()[details.artifact].controller_services_.push_back(description);
+    } else {
+      
getExternalMappings()[details.artifact].processors_.push_back(description);
+    }
+    return true;
 
 Review comment:
   The function always returns true, does it make sense to have bool return 
type?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to