diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 0d78e9c..b1d4b09 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -26,3 +26,21 @@ groupId = "com.ibm.mq" artifactId = "com.ibm.mq.allclient" version = "9.3.4.0" path = "./lib/com.ibm.mq.allclient-9.3.4.0.jar" + +[[platform.java17.dependency]] +groupId = "com.fasterxml.jackson.core" +artifactId = "jackson-annotations" +version = "2.15.3" +path = "./lib/jackson-annotations-2.15.3.jar" + +[[platform.java17.dependency]] +groupId = "com.fasterxml.jackson.core" +artifactId = "jackson-core" +version = "2.15.3" +path = "./lib/jackson-core-2.15.3.jar" + +[[platform.java17.dependency]] +groupId = "com.fasterxml.jackson.core" +artifactId = "jackson-databind" +version = "2.15.3" +path = "./lib/jackson-databind-2.15.3.jar" diff --git a/ballerina/build.gradle b/ballerina/build.gradle index 3b1cce2..39fab32 100644 --- a/ballerina/build.gradle +++ b/ballerina/build.gradle @@ -75,16 +75,28 @@ dependencies { externalJars(group: 'com.ibm.mq', name: 'com.ibm.mq.allclient', version: "${ibmMQVersion}") { transitive = false } + /* Jackson dependencies */ + externalJars(group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: "${jacksonVersion}") { + transitive = false + } + externalJars(group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: "${jacksonVersion}") { + transitive = false + } + externalJars(group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: "${jacksonVersion}") { + transitive = false + } } task updateTomlFiles { doLast { def stdlibDependentIbmMQVersion = project.ibmMQVersion def stdlibDependentJsonVersion = project.jsonVersion + def stdlibDependentJacksonVersion = project.jacksonVersion; def newConfig = ballerinaTomlFilePlaceHolder.text.replace("@project.version@", project.version) newConfig = newConfig.replace("@toml.version@", tomlVersion) newConfig = newConfig.replace("@ibmmq.version@", stdlibDependentIbmMQVersion) newConfig = newConfig.replace("@json.version@", stdlibDependentJsonVersion) + newConfig = newConfig.replace("@jackson.version@", stdlibDependentJacksonVersion) ballerinaTomlFile.text = newConfig } } diff --git a/ballerina/tests/topic_publisher_subscriber_tests.bal b/ballerina/tests/topic_publisher_subscriber_tests.bal index 3fc84c4..6ad34de 100644 --- a/ballerina/tests/topic_publisher_subscriber_tests.bal +++ b/ballerina/tests/topic_publisher_subscriber_tests.bal @@ -13,6 +13,7 @@ // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. + import ballerina/test; @test:Config { diff --git a/ballerina/utils.bal b/ballerina/utils.bal index 1e1916b..b1858f4 100644 --- a/ballerina/utils.bal +++ b/ballerina/utils.bal @@ -15,7 +15,7 @@ // under the License. // This class is used by the native implementation to add the MQRFH2 fields to a table. -class NativeUtils { +isolated class NativeUtils { // This method is invoked by the native runtime to add the MQRFH2 fields to a table. function addMQRFH2FieldsToTable(MQRFH2Field[] fields) returns table key(folder, 'field) { diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index e071688..769c8d8 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -26,3 +26,21 @@ groupId = "com.ibm.mq" artifactId = "com.ibm.mq.allclient" version = "@ibmmq.version@" path = "./lib/com.ibm.mq.allclient-@ibmmq.version@.jar" + +[[platform.java17.dependency]] +groupId = "com.fasterxml.jackson.core" +artifactId = "jackson-annotations" +version = "@jackson.version@" +path = "./lib/jackson-annotations-@jackson.version@.jar" + +[[platform.java17.dependency]] +groupId = "com.fasterxml.jackson.core" +artifactId = "jackson-core" +version = "@jackson.version@" +path = "./lib/jackson-core-@jackson.version@.jar" + +[[platform.java17.dependency]] +groupId = "com.fasterxml.jackson.core" +artifactId = "jackson-databind" +version = "@jackson.version@" +path = "./lib/jackson-databind-@jackson.version@.jar" diff --git a/gradle.properties b/gradle.properties index 8a6cff9..91358ea 100644 --- a/gradle.properties +++ b/gradle.properties @@ -13,6 +13,7 @@ ballerinaGradlePluginVersion=2.0.1 # IBM MQ dependencies ibmMQVersion=9.3.4.0 jsonVersion=20231013 +jacksonVersion=2.15.3 #stdlib dependencies diff --git a/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/HeaderUtils.java b/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/HeaderUtils.java index d743f51..456810f 100644 --- a/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/HeaderUtils.java +++ b/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/HeaderUtils.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.ballerina.lib.ibm.ibmmq.headers; import com.ibm.mq.MQMessage; diff --git a/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/MQCHIHHeader.java b/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/MQCHIHHeader.java index 8930f9f..02abec7 100644 --- a/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/MQCHIHHeader.java +++ b/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/MQCHIHHeader.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.ballerina.lib.ibm.ibmmq.headers; import com.ibm.mq.MQMessage; diff --git a/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/MQRFH2Header.java b/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/MQRFH2Header.java index b57c6dd..b761cc6 100644 --- a/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/MQRFH2Header.java +++ b/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/MQRFH2Header.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.ballerina.lib.ibm.ibmmq.headers; import com.ibm.mq.MQMessage; diff --git a/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/MQRFHHeader.java b/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/MQRFHHeader.java index de7e9b8..5084548 100644 --- a/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/MQRFHHeader.java +++ b/native/src/main/java/io/ballerina/lib/ibm.ibmmq/headers/MQRFHHeader.java @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2023, WSO2 LLC. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 LLC. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package io.ballerina.lib.ibm.ibmmq.headers; import com.ibm.mq.MQMessage;