Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add encryption handler for OPC UA - Minor fix for Kafka Connector #225

Merged
merged 4 commits into from
Jan 21, 2021

Conversation

hutcheb
Copy link
Contributor

@hutcheb hutcheb commented Jan 20, 2021

I've added the Encryption handler for the OPC UA server and re-wrote some of the logic. I have worked on a add just what we need to the logic, we can build from here.

If an error occurs, in some cases, while polling for the OPC UA server all the tags will stop. This has been fixed so that only the failed tag stops and shows a bad value.

Also a fix based on Rankesh's comment about adding jitter to the poll return value for the Kafka Source Connector. This distributes some of the load on the Kafka servers when a lot of connectors are all started at the same time.

Outstanding issue with PLC4X comms failure when adding tag that isn't valid.
Fixed opcua server issue when polling errors occur. Now polling doesn't 
stop for other tags.

Updated kafka conector based on Rankesh's comment about adding jitter to 
the poll return time.
@@ -1,11 +1,20 @@
/*
* Copyright (c) 2019 the Eclipse Milo Authors
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am no expert on this license topic. But is this ok in that way? That we have the small Milo notice in the "Notice" file and change the license?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately not ... EPL is category B ... we can use (in form of use libaries) but we can't include that code. ... not even just a bit. If it's just a bit, it would be better to re-write it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The EPL headers for the Plc4xNamespace and OPCUAServer files were added in as I wasn't sure how much of the code reflected the Milo example.
I am comfortable that there is no code that needs to be licensed under EPL remaining.

@@ -195,93 +169,110 @@ public static NodeId getNodeId(String plcValue) {
}

public DataValue getValue(AttributeFilterContext.GetAttributeContext ctx, String tag, String connectionString) {
PlcConnection connection = null;
DataValue resp = new DataValue(new Variant(null), StatusCode.BAD);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should have a static constant, Datavalue resp = DataValue.BAD_STATUS

import java.util.Calendar;
import java.util.Date;
import java.util.Locale;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename this for the context? Encryption seems a little too generic

Rename Encryption file to CertificateGenerator
Updated license and notice files.

Fix, if certificate store doesn't exist a new one wasn't created.
@hutcheb
Copy link
Contributor Author

hutcheb commented Jan 21, 2021

Otto, all good ideas, I have updated the code.

@hutcheb hutcheb merged commit 3101ec1 into develop Jan 21, 2021
Copy link
Contributor

@ottobackwards ottobackwards left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question about making the BAD_RESPONSE static.
But that is a nit.

@@ -65,6 +65,7 @@
private final Logger logger = LoggerFactory.getLogger(getClass());
private final Integer DEFAULT_TIMEOUT = 1000000;
private final Integer DEFAULT_RETRY_BACKOFF = 5000;
private final DataValue BAD_RESPONSE = new DataValue(new Variant(null), StatusCode.BAD);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be static?

@hutcheb hutcheb deleted the add_encryption_handler_opcua branch February 3, 2021 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants