bakaid commented on a change in pull request #635: MINIFICPP-819 - OPC Unified 
Architecture Support
URL: https://github.com/apache/nifi-minifi-cpp/pull/635#discussion_r329997718
 
 

 ##########
 File path: extensions/opc/src/opcbase.cpp
 ##########
 @@ -0,0 +1,113 @@
+/**
+ * BaseOPC class definition
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <memory>
+#include <string>
+
+#include "opc.h"
+#include "opcbase.h"
+#include "FlowFileRecord.h"
+#include "core/Processor.h"
+#include "core/ProcessSession.h"
+#include "core/Core.h"
+#include "core/Property.h"
+
+namespace org {
+namespace apache {
+namespace nifi {
+namespace minifi {
+namespace processors {
+
+  core::Property BaseOPCProcessor::OPCServerEndPoint(
+      core::PropertyBuilder::createProperty("OPC server endpoint")
+      ->withDescription("Specifies the address, port and relative path of an 
OPC endpoint")
+      ->isRequired(true)->build());
+
+  core::Property BaseOPCProcessor::Username(
+      core::PropertyBuilder::createProperty("Username")
+          ->withDescription("Username to log in with.")->build());
+
+  core::Property BaseOPCProcessor::Password(
+      core::PropertyBuilder::createProperty("Password")
+          ->withDescription("Password to log in with. Providing this requires 
cert and key to be provided as well, credentials are always sent 
encrypted.")->build());
+
+  core::Property BaseOPCProcessor::CertificatePath(
+      core::PropertyBuilder::createProperty("Certificate path")
+          ->withDescription("Path to the cert file")->build());
+
+  core::Property BaseOPCProcessor::KeyPath(
+      core::PropertyBuilder::createProperty("Key path")
+          ->withDescription("Path to the key file")->build());
+
+  void BaseOPCProcessor::onSchedule(const 
std::shared_ptr<core::ProcessContext> &context, const 
std::shared_ptr<core::ProcessSessionFactory> &factory) {
+    logger_->log_trace("BaseOPCProcessor::onSchedule");
+
+    certBuffer_.clear();
+    keyBuffer_.clear();
+    password_.clear();
+    username_.clear();
+
+    configOK_ = false;
+
+    context->getProperty(OPCServerEndPoint.getName(), endPointURL_);
+
+    if (context->getProperty(Username.getName(), username_) != 
context->getProperty(Password.getName(), password_)) {
+      logger_->log_error("Both or neither of username and password should be 
provided!");
+      return;
+    }
+
+    if (context->getProperty(CertificatePath.getName(), certpath_) !=
+        context->getProperty(Password.getName(), keypath_)) {
 
 Review comment:
   This should be `KeyPath`.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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