diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 5befa340..6faeb4b9 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.9" +path = "./lib/bayeux-api-4.0.9.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.9" +path = "./lib/cometd-java-client-4.0.9.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.9" +path = "./lib/cometd-java-common-4.0.9.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.55.v20240627" +path = "./lib/jetty-client-9.4.55.v20240627.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.55.v20240627" +path = "./lib/jetty-http-9.4.55.v20240627.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.55.v20240627" +path = "./lib/jetty-io-9.4.55.v20240627.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.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.18.v20190429" -path = "./lib/jetty-util-ajax-9.4.18.v20190429.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 = "20210307" -path = "./lib/json-20210307.jar" +version = "20240303" +path = "./lib/json-20240303.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.5" +path = "./lib/jackson-databind-2.13.5.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.5" +path = "./lib/jackson-annotations-2.13.5.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.5" +path = "./lib/jackson-core-2.13.5.jar" diff --git a/gradle.properties b/gradle.properties index 864e08fe..a92500c4 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.5 +jacksonAnnotationsVersion=2.13.5 +jacksonCoreVersion=2.13.5 +cometdJavaClientVersion=4.0.9 +jettyVersion=9.4.55.v20240627 +gsonVersion=2.10.1 +jsonVersion=20240303 +slf4jVersion=1.7.36 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")