You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by jf...@apache.org on 2020/08/09 08:39:01 UTC

[plc4x] 01/01: PLC4X-223 Fix exception on Pool usage for all drivers due to syntax change. Created PLC4X-224 as suggestion for an optimal solution.

This is an automated email from the ASF dual-hosted git repository.

jfeinauer pushed a commit to branch bugfix/PLC4X-223-fix-pool
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 57f0cca34fed0ff76311a8ff196a25c6483e4892
Author: Julian Feinauer <j....@pragmaticminds.de>
AuthorDate: Sun Aug 9 10:38:45 2020 +0200

    PLC4X-223 Fix exception on Pool usage for all drivers due to syntax change. Created PLC4X-224 as suggestion for an optimal solution.
---
 .../org/apache/plc4x/java/utils/connectionpool/PoolKeyFactory.java  | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/plc4j/tools/connection-pool/src/main/java/org/apache/plc4x/java/utils/connectionpool/PoolKeyFactory.java b/plc4j/tools/connection-pool/src/main/java/org/apache/plc4x/java/utils/connectionpool/PoolKeyFactory.java
index 1548f3c..4341312 100644
--- a/plc4j/tools/connection-pool/src/main/java/org/apache/plc4x/java/utils/connectionpool/PoolKeyFactory.java
+++ b/plc4j/tools/connection-pool/src/main/java/org/apache/plc4x/java/utils/connectionpool/PoolKeyFactory.java
@@ -41,6 +41,11 @@ public class PoolKeyFactory {
         }
         String protocol = connectionUri.getScheme().toLowerCase();
         switch (protocol) {
+            // Currently this is disabled due to 2 reasons
+            // First, see PLC4X-223 it needs to be migrated to new URI Syntax
+            // Second, we have to decide which parameters uniquely identify a connection and which
+            // not. See PLC4X-224
+            /*
             case "s7":
                 return new PoolKey(url, plcAuthentication) {
                     private final Pattern s7URIPattern = Pattern.compile("^(?<poolablePart>s7://((?<ip>[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3})|(?<hostname>[a-zA-Z0-9\\.\\-]+))(:(?<port>[0-9]{1,5}))?)(?<params>\\?.*)?");
@@ -92,6 +97,7 @@ public class PoolKeyFactory {
                         return Objects.requireNonNull(matcher.group("poolablePart"));
                     }
                 };
+             */
             default:
                 return new PoolKey(url, plcAuthentication) {
                     @Override