From bd448127276959e1416e049a144be4a0679b3ef0 Mon Sep 17 00:00:00 2001 From: aashikam Date: Fri, 23 Aug 2024 20:08:28 +0530 Subject: [PATCH 1/7] Update versions --- gradle.properties | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gradle.properties b/gradle.properties index 864e08fe..c77f9dab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,12 +13,12 @@ ballerinaGradlePluginVersion=2.2.3 ballerinaLangVersion=2201.10.0 -jacocoToolVersion=0.8.7 -jacksonDatabindVersion=2.9.10.8 -jacksonAnnotationsVersion=2.9.10 -jacksonCoreVersion=2.9.10 -cometdJavaClientVersion=4.0.4 -jettyVersion=9.4.18.v20190429 -gsonVersion=2.8.9 -jsonVersion=20210307 -slf4jVersion=1.7.32 +jacocoToolVersion=0.8.8 +jacksonDatabindVersion=2.13.4 +jacksonAnnotationsVersion=2.13.4 +jacksonCoreVersion=2.13.4 +cometdJavaClientVersion=4.0.6 +jettyVersion=9.4.50.v20230802 +gsonVersion=2.10.1 +jsonVersion=20211205 +slf4jVersion=1.7.36 From b85540abbf0ede9ab30d9f6752bd987b20f57751 Mon Sep 17 00:00:00 2001 From: aashikam Date: Fri, 23 Aug 2024 20:17:38 +0530 Subject: [PATCH 2/7] [Automated] Update the toml files --- ballerina/Ballerina.toml | 48 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 5befa340..f6674698 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -31,71 +31,71 @@ path = "./lib/opencsv-5.9.jar" [[platform.java17.dependency]] groupId = "org.cometd.java" artifactId = "bayeux-api" -version = "4.0.4" -path = "./lib/bayeux-api-4.0.4.jar" +version = "4.0.6" +path = "./lib/bayeux-api-4.0.6.jar" [[platform.java17.dependency]] groupId = "org.cometd.java" artifactId = "cometd-java-client" -version = "4.0.4" -path = "./lib/cometd-java-client-4.0.4.jar" +version = "4.0.6" +path = "./lib/cometd-java-client-4.0.6.jar" [[platform.java17.dependency]] groupId = "org.cometd.java" artifactId = "cometd-java-common" -version = "4.0.4" -path = "./lib/cometd-java-common-4.0.4.jar" +version = "4.0.6" +path = "./lib/cometd-java-common-4.0.6.jar" [[platform.java17.dependency]] groupId = "org.eclipse.jetty" artifactId = "jetty-client" -version = "9.4.18.v20190429" -path = "./lib/jetty-client-9.4.18.v20190429.jar" +version = "9.4.48.v20220622" +path = "./lib/jetty-client-9.4.48.v20220622.jar" [[platform.java17.dependency]] groupId = "org.eclipse.jetty" artifactId = "jetty-http" -version = "9.4.18.v20190429" -path = "./lib/jetty-http-9.4.18.v20190429.jar" +version = "9.4.48.v20220622" +path = "./lib/jetty-http-9.4.48.v20220622.jar" [[platform.java17.dependency]] groupId = "org.eclipse.jetty" artifactId = "jetty-io" -version = "9.4.18.v20190429" -path = "./lib/jetty-io-9.4.18.v20190429.jar" +version = "9.4.48.v20220622" +path = "./lib/jetty-io-9.4.48.v20220622.jar" [[platform.java17.dependency]] groupId = "org.eclipse.jetty" artifactId = "jetty-util" -version = "9.4.18.v20190429" -path = "./lib/jetty-util-9.4.18.v20190429.jar" +version = "9.4.48.v20220622" +path = "./lib/jetty-util-9.4.48.v20220622.jar" [[platform.java17.dependency]] groupId = "org.eclipse.jetty" artifactId = "jetty-util-ajax" -version = "9.4.18.v20190429" -path = "./lib/jetty-util-ajax-9.4.18.v20190429.jar" +version = "9.4.48.v20220622" +path = "./lib/jetty-util-ajax-9.4.48.v20220622.jar" [[platform.java17.dependency]] groupId = "org.json" artifactId = "json" -version = "20210307" -path = "./lib/json-20210307.jar" +version = "20211205" +path = "./lib/json-20211205.jar" [[platform.java17.dependency]] groupId = "com.fasterxml.jackson.core" artifactId = "jackson-databind" -version = "2.9.10.8" -path = "./lib/jackson-databind-2.9.10.8.jar" +version = "2.13.4" +path = "./lib/jackson-databind-2.13.4.jar" [[platform.java17.dependency]] groupId = "com.fasterxml.jackson.core" artifactId = "jackson-annotations" -version = "2.9.10" -path = "./lib/jackson-annotations-2.9.10.jar" +version = "2.13.4" +path = "./lib/jackson-annotations-2.13.4.jar" [[platform.java17.dependency]] groupId = "com.fasterxml.jackson.core" artifactId = "jackson-core" -version = "2.9.10" -path = "./lib/jackson-core-2.9.10.jar" +version = "2.13.4" +path = "./lib/jackson-core-2.13.4.jar" From 7eee05abaa86836348e7f0c3a023ccdccda8b0d7 Mon Sep 17 00:00:00 2001 From: aashikam Date: Fri, 23 Aug 2024 20:19:55 +0530 Subject: [PATCH 3/7] Update versions --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index c77f9dab..8696fd6b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,7 +18,7 @@ jacksonDatabindVersion=2.13.4 jacksonAnnotationsVersion=2.13.4 jacksonCoreVersion=2.13.4 cometdJavaClientVersion=4.0.6 -jettyVersion=9.4.50.v20230802 +jettyVersion=9.4.48.v20220622 gsonVersion=2.10.1 jsonVersion=20211205 slf4jVersion=1.7.36 From 0263696736a24c1e69f5f082d26daf7cd4e8bffd Mon Sep 17 00:00:00 2001 From: aashikam Date: Fri, 23 Aug 2024 20:41:18 +0530 Subject: [PATCH 4/7] [Automated] Update the toml files --- ballerina/Ballerina.toml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index f6674698..f2a131d3 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -49,53 +49,53 @@ path = "./lib/cometd-java-common-4.0.6.jar" [[platform.java17.dependency]] groupId = "org.eclipse.jetty" artifactId = "jetty-client" -version = "9.4.48.v20220622" -path = "./lib/jetty-client-9.4.48.v20220622.jar" +version = "9.4.55.v20240627" +path = "./lib/jetty-client-9.4.55.v20240627.jar" [[platform.java17.dependency]] groupId = "org.eclipse.jetty" artifactId = "jetty-http" -version = "9.4.48.v20220622" -path = "./lib/jetty-http-9.4.48.v20220622.jar" +version = "9.4.55.v20240627" +path = "./lib/jetty-http-9.4.55.v20240627.jar" [[platform.java17.dependency]] groupId = "org.eclipse.jetty" artifactId = "jetty-io" -version = "9.4.48.v20220622" -path = "./lib/jetty-io-9.4.48.v20220622.jar" +version = "9.4.55.v20240627" +path = "./lib/jetty-io-9.4.55.v20240627.jar" [[platform.java17.dependency]] groupId = "org.eclipse.jetty" artifactId = "jetty-util" -version = "9.4.48.v20220622" -path = "./lib/jetty-util-9.4.48.v20220622.jar" +version = "9.4.55.v20240627" +path = "./lib/jetty-util-9.4.55.v20240627.jar" [[platform.java17.dependency]] groupId = "org.eclipse.jetty" artifactId = "jetty-util-ajax" -version = "9.4.48.v20220622" -path = "./lib/jetty-util-ajax-9.4.48.v20220622.jar" +version = "9.4.55.v20240627" +path = "./lib/jetty-util-ajax-9.4.55.v20240627.jar" [[platform.java17.dependency]] groupId = "org.json" artifactId = "json" -version = "20211205" -path = "./lib/json-20211205.jar" +version = "20240303" +path = "./lib/json-20240303.jar" [[platform.java17.dependency]] groupId = "com.fasterxml.jackson.core" artifactId = "jackson-databind" -version = "2.13.4" -path = "./lib/jackson-databind-2.13.4.jar" +version = "2.13.5" +path = "./lib/jackson-databind-2.13.5.jar" [[platform.java17.dependency]] groupId = "com.fasterxml.jackson.core" artifactId = "jackson-annotations" -version = "2.13.4" -path = "./lib/jackson-annotations-2.13.4.jar" +version = "2.13.5" +path = "./lib/jackson-annotations-2.13.5.jar" [[platform.java17.dependency]] groupId = "com.fasterxml.jackson.core" artifactId = "jackson-core" -version = "2.13.4" -path = "./lib/jackson-core-2.13.4.jar" +version = "2.13.5" +path = "./lib/jackson-core-2.13.5.jar" From 394a0f7aa8e56293a613479e7f1437d7c8b4c6e4 Mon Sep 17 00:00:00 2001 From: aashikam Date: Fri, 23 Aug 2024 20:43:46 +0530 Subject: [PATCH 5/7] Update versions --- gradle.properties | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gradle.properties b/gradle.properties index 8696fd6b..a92500c4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -14,11 +14,11 @@ ballerinaGradlePluginVersion=2.2.3 ballerinaLangVersion=2201.10.0 jacocoToolVersion=0.8.8 -jacksonDatabindVersion=2.13.4 -jacksonAnnotationsVersion=2.13.4 -jacksonCoreVersion=2.13.4 -cometdJavaClientVersion=4.0.6 -jettyVersion=9.4.48.v20220622 +jacksonDatabindVersion=2.13.5 +jacksonAnnotationsVersion=2.13.5 +jacksonCoreVersion=2.13.5 +cometdJavaClientVersion=4.0.9 +jettyVersion=9.4.55.v20240627 gsonVersion=2.10.1 -jsonVersion=20211205 +jsonVersion=20240303 slf4jVersion=1.7.36 From 66fc36caea9f9bd7acfbcecc105053cdc6930e1b Mon Sep 17 00:00:00 2001 From: aashikam Date: Fri, 23 Aug 2024 20:52:28 +0530 Subject: [PATCH 6/7] [Automated] Update the toml files --- ballerina/Ballerina.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index f2a131d3..6faeb4b9 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -31,20 +31,20 @@ path = "./lib/opencsv-5.9.jar" [[platform.java17.dependency]] groupId = "org.cometd.java" artifactId = "bayeux-api" -version = "4.0.6" -path = "./lib/bayeux-api-4.0.6.jar" +version = "4.0.9" +path = "./lib/bayeux-api-4.0.9.jar" [[platform.java17.dependency]] groupId = "org.cometd.java" artifactId = "cometd-java-client" -version = "4.0.6" -path = "./lib/cometd-java-client-4.0.6.jar" +version = "4.0.9" +path = "./lib/cometd-java-client-4.0.9.jar" [[platform.java17.dependency]] groupId = "org.cometd.java" artifactId = "cometd-java-common" -version = "4.0.6" -path = "./lib/cometd-java-common-4.0.6.jar" +version = "4.0.9" +path = "./lib/cometd-java-common-4.0.9.jar" [[platform.java17.dependency]] groupId = "org.eclipse.jetty" From d4976aa433465adf08a3cc64bd96711e5233898a Mon Sep 17 00:00:00 2001 From: aashikam Date: Sat, 24 Aug 2024 06:56:35 +0530 Subject: [PATCH 7/7] Set runtime at attach --- .../main/java/io/ballerinax/salesforce/ListenerUtil.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/native/src/main/java/io/ballerinax/salesforce/ListenerUtil.java b/native/src/main/java/io/ballerinax/salesforce/ListenerUtil.java index 6fe630ad..27186926 100644 --- a/native/src/main/java/io/ballerinax/salesforce/ListenerUtil.java +++ b/native/src/main/java/io/ballerinax/salesforce/ListenerUtil.java @@ -20,7 +20,6 @@ package io.ballerinax.salesforce; import io.ballerina.runtime.api.Environment; -import io.ballerina.runtime.api.Runtime; import io.ballerina.runtime.api.creators.ErrorCreator; import io.ballerina.runtime.api.utils.StringUtils; import io.ballerina.runtime.api.values.BError; @@ -45,7 +44,6 @@ public class ListenerUtil { private static final ArrayList services = new ArrayList<>(); private static final Map serviceDispatcherMap = new HashMap<>(); - private static Runtime runtime; private static EmpConnector connector; private static TopicSubscription subscription; @@ -56,7 +54,7 @@ public static void initListener(BObject listener, int replayFrom, boolean isSand listener.addNativeData(IS_SAND_BOX, isSandBox); } - public static Object attachService(BObject listener, BObject service, Object channelName) { + public static Object attachService(Environment environment, BObject listener, BObject service, Object channelName) { listener.addNativeData(CHANNEL_NAME, ((BString) channelName).getValue()); @SuppressWarnings("unchecked") @@ -69,14 +67,14 @@ public static Object attachService(BObject listener, BObject service, Object cha return null; } - DispatcherService dispatcherService = new DispatcherService(service, runtime); + DispatcherService dispatcherService = new DispatcherService(service, environment.getRuntime()); services.add(service); serviceDispatcherMap.put(service, dispatcherService); return null; } - public static Object startListener(Environment environment, BString username, BString password, BObject listener) { + public static Object startListener(BString username, BString password, BObject listener) { BearerTokenProvider tokenProvider = new BearerTokenProvider(() -> { try { return LoginHelper.login(username.getValue(), password.getValue(), listener); @@ -96,7 +94,6 @@ public static Object startListener(Environment environment, BString username, BS } catch (Exception e) { return sfdcError(e.getMessage()); } - runtime = environment.getRuntime(); @SuppressWarnings("unchecked") ArrayList services = (ArrayList) listener.getNativeData(CONSUMER_SERVICES); @SuppressWarnings("unchecked")