| 130 | } |
| 131 | |
| 132 | bool BaseOPCProcessor::reconnect() { |
| 133 | if (connection_ == nullptr) { |
| 134 | connection_ = opc::Client::createClient(logger_, applicationURI_, certBuffer_, keyBuffer_, trustBuffers_); |
| 135 | } |
| 136 | |
| 137 | if (connection_->isConnected()) { |
| 138 | return true; |
| 139 | } |
| 140 | |
| 141 | auto sc = connection_->connect(endPointURL_, username_, password_); |
| 142 | if (sc != UA_STATUSCODE_GOOD) { |
| 143 | logger_->log_error("Failed to connect: %s!", UA_StatusCode_name(sc)); |
| 144 | return false; |
| 145 | } |
| 146 | logger_->log_debug("Successfully connected."); |
| 147 | return true; |
| 148 | } |
| 149 | |
| 150 | } /* namespace processors */ |
| 151 | } /* namespace minifi */ |
nothing calls this directly
no test coverage detected