diff --git a/android/clustercontroller-android-standalone/app/build.gradle b/android/clustercontroller-android-standalone/app/build.gradle
index 461c18e26a..115d190568 100644
--- a/android/clustercontroller-android-standalone/app/build.gradle
+++ b/android/clustercontroller-android-standalone/app/build.gradle
@@ -37,7 +37,7 @@ android {
}
ext {
- joynr_version = '1.24.0'
+ joynr_version = '1.25.0'
}
dependencies {
diff --git a/android/dependency-lock/common/access-control-common/pom.xml b/android/dependency-lock/common/access-control-common/pom.xml
index bc4be20970..705ee0ed92 100644
--- a/android/dependency-lock/common/access-control-common/pom.xml
+++ b/android/dependency-lock/common/access-control-common/pom.xml
@@ -26,7 +26,7 @@
io.joynr.android
common
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/dependency-lock/common/discovery-common/pom.xml b/android/dependency-lock/common/discovery-common/pom.xml
index 7a55bc898b..f4339ccda0 100644
--- a/android/dependency-lock/common/discovery-common/pom.xml
+++ b/android/dependency-lock/common/discovery-common/pom.xml
@@ -26,7 +26,7 @@
io.joynr.android
common
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/dependency-lock/common/guice-integration/pom.xml b/android/dependency-lock/common/guice-integration/pom.xml
index 0846a944de..6472250034 100644
--- a/android/dependency-lock/common/guice-integration/pom.xml
+++ b/android/dependency-lock/common/guice-integration/pom.xml
@@ -28,7 +28,7 @@
io.joynr.android
common
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/dependency-lock/common/infrastructure-common/pom.xml b/android/dependency-lock/common/infrastructure-common/pom.xml
index 399fa5e25c..92a63ac694 100644
--- a/android/dependency-lock/common/infrastructure-common/pom.xml
+++ b/android/dependency-lock/common/infrastructure-common/pom.xml
@@ -26,7 +26,7 @@
io.joynr.android
common
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/dependency-lock/common/pom.xml b/android/dependency-lock/common/pom.xml
index 5d910bc655..a1d136346e 100644
--- a/android/dependency-lock/common/pom.xml
+++ b/android/dependency-lock/common/pom.xml
@@ -26,7 +26,7 @@
io.joynr.android
dependency-lock
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/dependency-lock/common/status-metrics/pom.xml b/android/dependency-lock/common/status-metrics/pom.xml
index c35d668bba..f84091a179 100644
--- a/android/dependency-lock/common/status-metrics/pom.xml
+++ b/android/dependency-lock/common/status-metrics/pom.xml
@@ -26,7 +26,7 @@
io.joynr.android
common
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/dependency-lock/core/clustercontroller/pom.xml b/android/dependency-lock/core/clustercontroller/pom.xml
index ff1fde65ae..c6a0bfa00c 100644
--- a/android/dependency-lock/core/clustercontroller/pom.xml
+++ b/android/dependency-lock/core/clustercontroller/pom.xml
@@ -26,7 +26,7 @@
io.joynr.android
core
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/dependency-lock/core/libjoynr-websocket-runtime/pom.xml b/android/dependency-lock/core/libjoynr-websocket-runtime/pom.xml
index df0e60053d..2bffe1781a 100644
--- a/android/dependency-lock/core/libjoynr-websocket-runtime/pom.xml
+++ b/android/dependency-lock/core/libjoynr-websocket-runtime/pom.xml
@@ -27,7 +27,7 @@
core
io.joynr.android
- 1.24.0
+ 1.25.0
diff --git a/android/dependency-lock/core/libjoynr/pom.xml b/android/dependency-lock/core/libjoynr/pom.xml
index b8da46ec37..b572d89068 100644
--- a/android/dependency-lock/core/libjoynr/pom.xml
+++ b/android/dependency-lock/core/libjoynr/pom.xml
@@ -26,7 +26,7 @@
io.joynr.android
core
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/dependency-lock/core/pom.xml b/android/dependency-lock/core/pom.xml
index d4346bc896..0787fc8fd3 100644
--- a/android/dependency-lock/core/pom.xml
+++ b/android/dependency-lock/core/pom.xml
@@ -26,7 +26,7 @@
io.joynr.android
dependency-lock
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/dependency-lock/javaapi/pom.xml b/android/dependency-lock/javaapi/pom.xml
index c5a0dc6687..5ede17d0fb 100644
--- a/android/dependency-lock/javaapi/pom.xml
+++ b/android/dependency-lock/javaapi/pom.xml
@@ -27,7 +27,7 @@
io.joynr.android
dependency-lock
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/dependency-lock/messaging/messaging-common/pom.xml b/android/dependency-lock/messaging/messaging-common/pom.xml
index b2c44355e1..1fcc6f08be 100644
--- a/android/dependency-lock/messaging/messaging-common/pom.xml
+++ b/android/dependency-lock/messaging/messaging-common/pom.xml
@@ -27,7 +27,7 @@
io.joynr.android
messaging
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/dependency-lock/messaging/mqtt/hivemq-mqtt-client/pom.xml b/android/dependency-lock/messaging/mqtt/hivemq-mqtt-client/pom.xml
index a0027f2ae0..096f7693f2 100644
--- a/android/dependency-lock/messaging/mqtt/hivemq-mqtt-client/pom.xml
+++ b/android/dependency-lock/messaging/mqtt/hivemq-mqtt-client/pom.xml
@@ -25,7 +25,7 @@
io.joynr.android.messaging
mqtt
- 1.24.0
+ 1.25.0
diff --git a/android/dependency-lock/messaging/mqtt/joynr-mqtt-client/pom.xml b/android/dependency-lock/messaging/mqtt/joynr-mqtt-client/pom.xml
index 8b4fc28f8e..eddb63528f 100644
--- a/android/dependency-lock/messaging/mqtt/joynr-mqtt-client/pom.xml
+++ b/android/dependency-lock/messaging/mqtt/joynr-mqtt-client/pom.xml
@@ -25,7 +25,7 @@
io.joynr.android.messaging
mqtt
- 1.24.0
+ 1.25.0
diff --git a/android/dependency-lock/messaging/mqtt/pom.xml b/android/dependency-lock/messaging/mqtt/pom.xml
index beebf39067..33968a0ae9 100644
--- a/android/dependency-lock/messaging/mqtt/pom.xml
+++ b/android/dependency-lock/messaging/mqtt/pom.xml
@@ -26,7 +26,7 @@
io.joynr.android
messaging
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/dependency-lock/messaging/pom.xml b/android/dependency-lock/messaging/pom.xml
index 22081cf117..584ca8b38a 100644
--- a/android/dependency-lock/messaging/pom.xml
+++ b/android/dependency-lock/messaging/pom.xml
@@ -26,7 +26,7 @@
io.joynr.android
dependency-lock
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/dependency-lock/messaging/websocket/joynr-websocket-client/pom.xml b/android/dependency-lock/messaging/websocket/joynr-websocket-client/pom.xml
index aedbe31cf4..6b074e67cc 100644
--- a/android/dependency-lock/messaging/websocket/joynr-websocket-client/pom.xml
+++ b/android/dependency-lock/messaging/websocket/joynr-websocket-client/pom.xml
@@ -25,7 +25,7 @@
io.joynr.android.messaging
websocket
- 1.24.0
+ 1.25.0
diff --git a/android/dependency-lock/messaging/websocket/joynr-websocket-common/pom.xml b/android/dependency-lock/messaging/websocket/joynr-websocket-common/pom.xml
index 39e3ce22ed..fead2f21ad 100644
--- a/android/dependency-lock/messaging/websocket/joynr-websocket-common/pom.xml
+++ b/android/dependency-lock/messaging/websocket/joynr-websocket-common/pom.xml
@@ -26,7 +26,7 @@
io.joynr.android.messaging
websocket
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/dependency-lock/messaging/websocket/joynr-websocket-server/pom.xml b/android/dependency-lock/messaging/websocket/joynr-websocket-server/pom.xml
index 0dcdb5692d..3f104df37e 100644
--- a/android/dependency-lock/messaging/websocket/joynr-websocket-server/pom.xml
+++ b/android/dependency-lock/messaging/websocket/joynr-websocket-server/pom.xml
@@ -25,7 +25,7 @@
io.joynr.android.messaging
websocket
- 1.24.0
+ 1.25.0
diff --git a/android/dependency-lock/messaging/websocket/pom.xml b/android/dependency-lock/messaging/websocket/pom.xml
index 89ec07eea8..b141529f4c 100644
--- a/android/dependency-lock/messaging/websocket/pom.xml
+++ b/android/dependency-lock/messaging/websocket/pom.xml
@@ -26,7 +26,7 @@
io.joynr.android
messaging
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/dependency-lock/pom.xml b/android/dependency-lock/pom.xml
index 51da03e896..0239938fe7 100644
--- a/android/dependency-lock/pom.xml
+++ b/android/dependency-lock/pom.xml
@@ -29,7 +29,7 @@
io.joynr
android
- 1.24.0
+ 1.25.0
../pom.xml
@@ -193,7 +193,7 @@
com.google.errorprone
error_prone_annotations
jar
- 2.11.0
+ 2.18.0
com.google.flatbuffers
@@ -211,7 +211,7 @@
com.google.guava
guava
jar
- 31.1-jre
+ 32.0.1-jre
com.google.guava
@@ -235,7 +235,7 @@
com.google.j2objc
j2objc-annotations
jar
- 1.3
+ 3.0.0
com.googlecode.concurrent-trees
@@ -265,43 +265,43 @@
io.netty
netty-buffer
jar
- 4.1.89.Final
+ 4.1.100.Final
io.netty
netty-codec
jar
- 4.1.89.Final
+ 4.1.100.Final
io.netty
netty-common
jar
- 4.1.89.Final
+ 4.1.100.Final
io.netty
netty-handler
jar
- 4.1.89.Final
+ 4.1.100.Final
io.netty
netty-resolver
jar
- 4.1.89.Final
+ 4.1.100.Final
io.netty
netty-transport
jar
- 4.1.89.Final
+ 4.1.100.Final
io.netty
netty-transport-native-unix-common
jar
- 4.1.89.Final
+ 4.1.100.Final
io.reactivex.rxjava2
@@ -309,24 +309,12 @@
jar
2.2.19
-
- jakarta.annotation
- jakarta.annotation-api
- jar
- 2.1.1
-
jakarta.platform
jakarta.jakartaee-api
jar
8.0.0
-
- jakarta.transaction
- jakarta.transaction-api
- jar
- 2.0.0
-
javax.inject
javax.inject
@@ -385,85 +373,67 @@
org.checkerframework
checker-qual
jar
- 3.12.0
+ 3.45.0
org.eclipse.jetty
jetty-alpn-client
jar
- 11.0.11
-
-
- org.eclipse.jetty
- jetty-annotations
- jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty
jetty-client
jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty
jetty-http
jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty
jetty-io
jar
- 11.0.11
-
-
- org.eclipse.jetty
- jetty-jndi
- jar
- 11.0.11
-
-
- org.eclipse.jetty
- jetty-plus
- jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty
jetty-security
jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty
jetty-server
jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty
jetty-servlet
jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty
jetty-util
jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty
jetty-webapp
jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty
jetty-xml
jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty.toolchain
@@ -475,49 +445,49 @@
org.eclipse.jetty.websocket
websocket-core-client
jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty.websocket
websocket-core-common
jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty.websocket
websocket-core-server
jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty.websocket
websocket-jetty-api
jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty.websocket
websocket-jetty-client
jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty.websocket
websocket-jetty-common
jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty.websocket
websocket-jetty-server
jar
- 11.0.11
+ 11.0.18
org.eclipse.jetty.websocket
websocket-servlet
jar
- 11.0.11
+ 11.0.18
org.hamcrest
@@ -561,24 +531,6 @@
jar
3.3
-
- org.ow2.asm
- asm
- jar
- 9.4
-
-
- org.ow2.asm
- asm-commons
- jar
- 9.4
-
-
- org.ow2.asm
- asm-tree
- jar
- 9.4
-
org.reactivestreams
reactive-streams
@@ -589,13 +541,13 @@
org.slf4j
slf4j-api
jar
- 1.7.36
+ 2.0.9
org.xerial
sqlite-jdbc
jar
- 3.41.0.0
+ 3.43.2.2
diff --git a/android/examples/android-hello-world-binder/android-hello-world-binder-consumer/build.gradle b/android/examples/android-hello-world-binder/android-hello-world-binder-consumer/build.gradle
index c878fbf764..9a0fd4d5b9 100644
--- a/android/examples/android-hello-world-binder/android-hello-world-binder-consumer/build.gradle
+++ b/android/examples/android-hello-world-binder/android-hello-world-binder-consumer/build.gradle
@@ -3,7 +3,7 @@
buildscript {
ext {
kotlin_version = '1.3.61'
- joynr_version = '1.24.0'
+ joynr_version = '1.25.0'
}
repositories {
google()
diff --git a/android/examples/android-hello-world-binder/android-hello-world-binder-consumer/pom.xml b/android/examples/android-hello-world-binder/android-hello-world-binder-consumer/pom.xml
index 186b9b029e..4163602b01 100644
--- a/android/examples/android-hello-world-binder/android-hello-world-binder-consumer/pom.xml
+++ b/android/examples/android-hello-world-binder/android-hello-world-binder-consumer/pom.xml
@@ -28,7 +28,7 @@
io.joynr.examples
android-hello-world-binder
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/examples/android-hello-world-binder/android-hello-world-binder-provider/build.gradle b/android/examples/android-hello-world-binder/android-hello-world-binder-provider/build.gradle
index 1fbf0669fd..e37d916a04 100644
--- a/android/examples/android-hello-world-binder/android-hello-world-binder-provider/build.gradle
+++ b/android/examples/android-hello-world-binder/android-hello-world-binder-provider/build.gradle
@@ -3,7 +3,7 @@
buildscript {
ext {
kotlin_version = '1.3.61'
- joynr_version = "1.24.0"
+ joynr_version = "1.25.0"
}
repositories {
google()
diff --git a/android/examples/android-hello-world-binder/android-hello-world-binder-provider/pom.xml b/android/examples/android-hello-world-binder/android-hello-world-binder-provider/pom.xml
index abe045cc99..5aebe40a50 100644
--- a/android/examples/android-hello-world-binder/android-hello-world-binder-provider/pom.xml
+++ b/android/examples/android-hello-world-binder/android-hello-world-binder-provider/pom.xml
@@ -28,7 +28,7 @@
io.joynr.examples
android-hello-world-binder
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/examples/android-hello-world-binder/pom.xml b/android/examples/android-hello-world-binder/pom.xml
index 3c13b75a98..2b0ede2734 100644
--- a/android/examples/android-hello-world-binder/pom.xml
+++ b/android/examples/android-hello-world-binder/pom.xml
@@ -28,7 +28,7 @@
io.joynr.android
examples
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/examples/android-hello-world/android-hello-world-consumer/build.gradle b/android/examples/android-hello-world/android-hello-world-consumer/build.gradle
index cac6427968..7be9d9da3e 100644
--- a/android/examples/android-hello-world/android-hello-world-consumer/build.gradle
+++ b/android/examples/android-hello-world/android-hello-world-consumer/build.gradle
@@ -3,7 +3,7 @@
buildscript {
ext {
- joynrVersion = "1.24.0"
+ joynrVersion = "1.25.0"
}
repositories {
google()
diff --git a/android/examples/android-hello-world/android-hello-world-consumer/pom.xml b/android/examples/android-hello-world/android-hello-world-consumer/pom.xml
index 43607fd436..80a2e51da1 100644
--- a/android/examples/android-hello-world/android-hello-world-consumer/pom.xml
+++ b/android/examples/android-hello-world/android-hello-world-consumer/pom.xml
@@ -28,7 +28,7 @@
io.joynr.examples
android-hello-world
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/examples/android-hello-world/android-hello-world-provider/build.gradle b/android/examples/android-hello-world/android-hello-world-provider/build.gradle
index 591d76d6a9..137ee95e6c 100644
--- a/android/examples/android-hello-world/android-hello-world-provider/build.gradle
+++ b/android/examples/android-hello-world/android-hello-world-provider/build.gradle
@@ -3,7 +3,7 @@
buildscript {
ext {
- joynrVersion = "1.24.0"
+ joynrVersion = "1.25.0"
}
repositories {
google()
diff --git a/android/examples/android-hello-world/android-hello-world-provider/pom.xml b/android/examples/android-hello-world/android-hello-world-provider/pom.xml
index cd0601ad8d..9fe5ba0ee0 100644
--- a/android/examples/android-hello-world/android-hello-world-provider/pom.xml
+++ b/android/examples/android-hello-world/android-hello-world-provider/pom.xml
@@ -28,7 +28,7 @@
io.joynr.examples
android-hello-world
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/examples/android-hello-world/pom.xml b/android/examples/android-hello-world/pom.xml
index 4c49edbcb9..059431faca 100644
--- a/android/examples/android-hello-world/pom.xml
+++ b/android/examples/android-hello-world/pom.xml
@@ -28,7 +28,7 @@
io.joynr.android
examples
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/examples/pom.xml b/android/examples/pom.xml
index 1a7e7a2fcc..953e3c8ebe 100644
--- a/android/examples/pom.xml
+++ b/android/examples/pom.xml
@@ -28,7 +28,7 @@
io.joynr
android
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/joynr-android-binder-runtime/build.gradle b/android/joynr-android-binder-runtime/build.gradle
index 2d6bc52daa..e9d1c4a04f 100644
--- a/android/joynr-android-binder-runtime/build.gradle
+++ b/android/joynr-android-binder-runtime/build.gradle
@@ -22,7 +22,7 @@ apply plugin: 'maven-publish'
apply plugin: 'maven'
group = 'io.joynr.android'
-version = '1.24.0'
+version = '1.25.0'
buildscript {
repositories {
diff --git a/android/joynr-android-binder-runtime/pom.xml b/android/joynr-android-binder-runtime/pom.xml
index c7914a93d9..575c25ff8a 100644
--- a/android/joynr-android-binder-runtime/pom.xml
+++ b/android/joynr-android-binder-runtime/pom.xml
@@ -26,7 +26,7 @@
io.joynr
android
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/libjoynr-android-integration-tests/pom.xml b/android/libjoynr-android-integration-tests/pom.xml
index 2d492dd0a8..04a721b4b6 100644
--- a/android/libjoynr-android-integration-tests/pom.xml
+++ b/android/libjoynr-android-integration-tests/pom.xml
@@ -26,7 +26,7 @@
io.joynr
android
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/libjoynr-android-integration-tests/test-radio-consumer/app/build.gradle b/android/libjoynr-android-integration-tests/test-radio-consumer/app/build.gradle
index b83b4c585c..3124c127ab 100644
--- a/android/libjoynr-android-integration-tests/test-radio-consumer/app/build.gradle
+++ b/android/libjoynr-android-integration-tests/test-radio-consumer/app/build.gradle
@@ -25,7 +25,7 @@ android {
}
ext {
- joynr_version = '1.24.0'
+ joynr_version = '1.25.0'
}
dependencies {
diff --git a/android/libjoynr-android-integration-tests/test-radio-consumer/build.gradle b/android/libjoynr-android-integration-tests/test-radio-consumer/build.gradle
index 0be9f6a1c6..e265d41810 100644
--- a/android/libjoynr-android-integration-tests/test-radio-consumer/build.gradle
+++ b/android/libjoynr-android-integration-tests/test-radio-consumer/build.gradle
@@ -10,7 +10,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
- classpath 'io.joynr.tools.generator:joynr-generator-gradle-plugin:1.24.0'
+ classpath 'io.joynr.tools.generator:joynr-generator-gradle-plugin:1.25.0'
}
}
diff --git a/android/libjoynr-android-integration-tests/test-radio-provider/app/build.gradle b/android/libjoynr-android-integration-tests/test-radio-provider/app/build.gradle
index c26105d45a..1d672ac062 100644
--- a/android/libjoynr-android-integration-tests/test-radio-provider/app/build.gradle
+++ b/android/libjoynr-android-integration-tests/test-radio-provider/app/build.gradle
@@ -26,7 +26,7 @@ android {
}
ext {
- joynr_version = '1.24.0'
+ joynr_version = '1.25.0'
}
dependencies {
diff --git a/android/libjoynr-android-integration-tests/test-radio-provider/build.gradle b/android/libjoynr-android-integration-tests/test-radio-provider/build.gradle
index 3bebea9dbc..f2fb8dce2b 100644
--- a/android/libjoynr-android-integration-tests/test-radio-provider/build.gradle
+++ b/android/libjoynr-android-integration-tests/test-radio-provider/build.gradle
@@ -10,7 +10,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
- classpath 'io.joynr.tools.generator:joynr-generator-gradle-plugin:1.24.0'
+ classpath 'io.joynr.tools.generator:joynr-generator-gradle-plugin:1.25.0'
}
}
diff --git a/android/libjoynr-android-websocket-runtime/README.md b/android/libjoynr-android-websocket-runtime/README.md
index a1918287c2..590100e127 100644
--- a/android/libjoynr-android-websocket-runtime/README.md
+++ b/android/libjoynr-android-websocket-runtime/README.md
@@ -23,7 +23,7 @@ and thus it's necessary to configure joynr libraries to use the provided **no_ao
Add this line to build.gradle file and verify if you have mavenLocal() under your maven
repositories list.
-`implementation 'io.joynr.android:libjoynr-android-websocket-runtime:1.24.0'`
+`implementation 'io.joynr.android:libjoynr-android-websocket-runtime:1.25.0'`
## Logging
diff --git a/android/libjoynr-android-websocket-runtime/build.gradle b/android/libjoynr-android-websocket-runtime/build.gradle
index 568f63f907..56070a0ce2 100644
--- a/android/libjoynr-android-websocket-runtime/build.gradle
+++ b/android/libjoynr-android-websocket-runtime/build.gradle
@@ -22,7 +22,7 @@ apply plugin: 'maven-publish'
apply plugin: 'maven'
group = 'io.joynr.android'
-version = '1.24.0'
+version = '1.25.0'
buildscript {
repositories {
diff --git a/android/libjoynr-android-websocket-runtime/pom.xml b/android/libjoynr-android-websocket-runtime/pom.xml
index 4dea85c0d5..e3e2eb9375 100644
--- a/android/libjoynr-android-websocket-runtime/pom.xml
+++ b/android/libjoynr-android-websocket-runtime/pom.xml
@@ -26,7 +26,7 @@
io.joynr
android
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/pom.xml b/android/pom.xml
index 78305edf68..cb42d263da 100644
--- a/android/pom.xml
+++ b/android/pom.xml
@@ -26,7 +26,7 @@
io.joynr
joynr
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/android/slf4j-android-bindings/build.gradle b/android/slf4j-android-bindings/build.gradle
index 02f03e3c18..0380e5cade 100644
--- a/android/slf4j-android-bindings/build.gradle
+++ b/android/slf4j-android-bindings/build.gradle
@@ -1,6 +1,6 @@
buildscript {
ext {
- joynrVersion = "1.24.0"
+ joynrVersion = "1.25.0"
}
repositories {
google()
@@ -54,7 +54,7 @@ dependencies {
}
group = 'io.joynr.android'
-version = '1.24.0'
+version = '1.25.0'
task androidSourcesJar(type: Jar) {
classifier = 'sources'
diff --git a/android/slf4j-android-bindings/pom.xml b/android/slf4j-android-bindings/pom.xml
index 66a0d0e163..5e3cc57169 100644
--- a/android/slf4j-android-bindings/pom.xml
+++ b/android/slf4j-android-bindings/pom.xml
@@ -27,7 +27,7 @@
io.joynr
android
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/basemodel/pom.xml b/basemodel/pom.xml
index 9f5d234d01..e4d6f2549d 100644
--- a/basemodel/pom.xml
+++ b/basemodel/pom.xml
@@ -25,7 +25,7 @@
io.joynr
dependency-lock
- 1.24.0
+ 1.25.0
../dependency-lock/pom.xml
diff --git a/cpp/CMake/AddGtestGmock.cmake b/cpp/CMake/AddGtestGmock.cmake
index 1c96cfd78f..c5dee6bd66 100644
--- a/cpp/CMake/AddGtestGmock.cmake
+++ b/cpp/CMake/AddGtestGmock.cmake
@@ -145,7 +145,8 @@ function(RegisterToCtest TARGET ${ARGN})
)
gtest_discover_tests(${TARGET}
- WORKING_DIRECTORY ${output_directory}
+ PROPERTIES TEST_DISCOVERY_TIMEOUT 600
+ WORKING_DIRECTORY ${output_directory}
)
endfunction(RegisterToCtest)
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 93154ac0e5..a91fb13756 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -4,7 +4,7 @@
cmake_minimum_required(VERSION 3.10)
-project(Joynr VERSION 1.24.0 LANGUAGES CXX)
+project(Joynr VERSION 1.25.0 LANGUAGES CXX)
message(STATUS "-----------------------------------------------------")
message(STATUS "- PROJECT: Joynr ${Joynr_VERSION}")
message(STATUS "-----------------------------------------------------")
diff --git a/cpp/JoynrConfig.cmake.in b/cpp/JoynrConfig.cmake.in
index 945d1a4ec6..4bd4813acc 100644
--- a/cpp/JoynrConfig.cmake.in
+++ b/cpp/JoynrConfig.cmake.in
@@ -3,7 +3,7 @@ set(JOYNR_SUPPORT_WEBSOCKET @JOYNR_SUPPORT_WEBSOCKET@)
set(JOYNR_SUPPORT_UDS @JOYNR_SUPPORT_UDS@)
include(CMakeFindDependencyMacro)
-include(FindPkgConfig)
+find_package(PkgConfig)
set(Boost_FOUND False)
find_dependency(Boost @JOYNR_BOOST_REQUIRED_VERSION@ REQUIRED
diff --git a/cpp/distribution/joynr.spec b/cpp/distribution/joynr.spec
index 57717595dd..4e2c127cf2 100644
--- a/cpp/distribution/joynr.spec
+++ b/cpp/distribution/joynr.spec
@@ -2,7 +2,7 @@
BuildRoot: /data/build/joynr/package/RPM/joynr
Summary: joynr base package including executables, libraries and default settings
Name: joynr
-Version: 1.24.0
+Version: 1.25.0
Release: 1
License: Apache License, Version 2.0
Group: unknown
diff --git a/cpp/libjoynr/basemodel/include/joynr/AbstractJoynrProvider.h b/cpp/libjoynr/basemodel/include/joynr/AbstractJoynrProvider.h
index e075a5d19e..1b883bd0d9 100644
--- a/cpp/libjoynr/basemodel/include/joynr/AbstractJoynrProvider.h
+++ b/cpp/libjoynr/basemodel/include/joynr/AbstractJoynrProvider.h
@@ -101,6 +101,15 @@ class JOYNR_EXPORT AbstractJoynrProvider : public virtual IJoynrProvider
const std::string& broadcastName,
std::shared_ptr broadcastListener) override;
+ /**
+ * @brief Unregister and delete a listener for multicast broadcasts
+ * @param broadcastName The name of the broadcast for which publications shall be done
+ * @param broadcastListener The listener object containing the callbacks for publications and
+ * failures
+ */
+ void unregisterBroadcastListener(
+ std::shared_ptr broadcastListener) override;
+
protected:
/**
* @brief Called by subclasses when the value of an attribute changes
diff --git a/cpp/libjoynr/basemodel/provider/AbstractJoynrProvider.cpp b/cpp/libjoynr/basemodel/provider/AbstractJoynrProvider.cpp
index b2a9a36c6c..047baae7bc 100644
--- a/cpp/libjoynr/basemodel/provider/AbstractJoynrProvider.cpp
+++ b/cpp/libjoynr/basemodel/provider/AbstractJoynrProvider.cpp
@@ -97,6 +97,17 @@ void AbstractJoynrProvider::unregisterBroadcastListener(
}
}
+void AbstractJoynrProvider::unregisterBroadcastListener(
+ std::shared_ptr broadcastListener)
+{
+ WriteLocker locker(_lockBroadcastListeners);
+ auto listenerIt =
+ std::find(_broadcastListeners.cbegin(), _broadcastListeners.cend(), broadcastListener);
+ if (listenerIt != _broadcastListeners.cend()) {
+ _broadcastListeners.erase(listenerIt);
+ }
+}
+
const CallContext& AbstractJoynrProvider::getCallContext() const
{
return CallContextStorage::get();
diff --git a/cpp/libjoynr/basemodel/subscription/SubscriptionManager.cpp b/cpp/libjoynr/basemodel/subscription/SubscriptionManager.cpp
index d28ce26a82..a908503299 100644
--- a/cpp/libjoynr/basemodel/subscription/SubscriptionManager.cpp
+++ b/cpp/libjoynr/basemodel/subscription/SubscriptionManager.cpp
@@ -191,6 +191,13 @@ void SubscriptionManager::registerSubscription(
_multicastSubscribersMutex);
std::string subscriptionId = subscriptionRequest.getSubscriptionId();
+ JOYNR_LOG_DEBUG(logger(),
+ "MulticastSubscription: subscriptionId: {}, "
+ "proxy participantId: {}, provider participantId: {}",
+ subscriptionId,
+ subscriberParticipantId,
+ providerParticipantId);
+
// remove pre-exisiting multicast subscription
if (_subscriptions.contains(subscriptionId)) {
std::shared_ptr subscription(_subscriptions.value(subscriptionId));
diff --git a/cpp/libjoynr/capabilities/include/joynr/CapabilitiesRegistrar.h b/cpp/libjoynr/capabilities/include/joynr/CapabilitiesRegistrar.h
index adf00fdcc4..ce2bbbb22d 100644
--- a/cpp/libjoynr/capabilities/include/joynr/CapabilitiesRegistrar.h
+++ b/cpp/libjoynr/capabilities/include/joynr/CapabilitiesRegistrar.h
@@ -93,8 +93,9 @@ class JOYNR_EXPORT CapabilitiesRegistrar
const std::string participantId = _participantIdStorage->getProviderParticipantId(
domain, interfaceName, T::MAJOR_VERSION);
std::shared_ptr caller = RequestCallerFactory::create(provider);
- provider->registerBroadcastListener(
- std::make_shared(participantId, _publicationManager));
+ auto multicastBroadcastListener =
+ std::make_shared(participantId, _publicationManager);
+ provider->registerBroadcastListener(multicastBroadcastListener);
const std::int64_t now = std::chrono::duration_cast(
std::chrono::system_clock::now().time_since_epoch())
@@ -119,14 +120,18 @@ class JOYNR_EXPORT CapabilitiesRegistrar
discoveryEntryExpiryDateMs,
defaultPublicKeyId);
bool isGloballyVisible = providerQos.getScope() == types::ProviderScope::GLOBAL;
-
+ auto onErrorWrapper = [provider, multicastBroadcastListener, onError = std::move(onError)](
+ const joynr::exceptions::JoynrRuntimeException& error) {
+ provider->unregisterBroadcastListener(multicastBroadcastListener);
+ onError(error);
+ };
for (auto&& gbid : gbids) {
if (gbid.empty()) {
- onError(joynr::exceptions::JoynrRuntimeException("gbid(s) must not be empty"));
+ onErrorWrapper(
+ joynr::exceptions::JoynrRuntimeException("gbid(s) must not be empty"));
return participantId;
}
}
-
// dispatcher is captured here to avoid compilation problem with gcc 7.x
auto onSuccessWrapper = [domain,
interfaceName,
@@ -140,7 +145,7 @@ class JOYNR_EXPORT CapabilitiesRegistrar
entry = std::move(entry),
awaitGlobalRegistration,
onSuccess = std::move(onSuccess),
- onError,
+ onErrorWrapper,
persist,
isInternalProvider,
addToAll,
@@ -153,25 +158,26 @@ class JOYNR_EXPORT CapabilitiesRegistrar
}
}
- auto onErrorWrapper = [participantId,
- messageRouter = std::move(messageRouter),
- onError = std::move(onError)](
- const joynr::exceptions::JoynrRuntimeException& error) {
- if (auto ptr = messageRouter.lock()) {
- ptr->removeNextHop(participantId);
- }
- onError(error);
- };
+ auto onErrorWrapperInternal =
+ [participantId,
+ messageRouter = std::move(messageRouter),
+ onErrorWrapper = std::move(onErrorWrapper)](
+ const joynr::exceptions::JoynrRuntimeException& error) {
+ if (auto ptr = messageRouter.lock()) {
+ ptr->removeNextHop(participantId);
+ }
+ onErrorWrapper(error);
+ };
- auto onApplicationErrorWrapper =
+ auto onApplicationErrorWrapperInternal =
[participantId,
messageRouter = std::move(messageRouter),
- onError = std::move(onError)](
+ onErrorWrapper = std::move(onErrorWrapper)](
const joynr::types::DiscoveryError::Enum& errorEnum) {
if (auto ptr = messageRouter.lock()) {
ptr->removeNextHop(participantId);
}
- onError(joynr::exceptions::JoynrRuntimeException(
+ onErrorWrapper(joynr::exceptions::JoynrRuntimeException(
"Registration failed with DiscoveryError " +
joynr::types::DiscoveryError::getLiteral(errorEnum)));
};
@@ -194,8 +200,8 @@ class JOYNR_EXPORT CapabilitiesRegistrar
interfaceName);
onSuccess();
},
- std::move(onApplicationErrorWrapper),
- std::move(onErrorWrapper),
+ std::move(onApplicationErrorWrapperInternal),
+ std::move(onErrorWrapperInternal),
messagingQos);
} else {
discoveryProxyPtr->addAsync(
@@ -212,8 +218,8 @@ class JOYNR_EXPORT CapabilitiesRegistrar
interfaceName);
onSuccess();
},
- std::move(onApplicationErrorWrapper),
- std::move(onErrorWrapper),
+ std::move(onApplicationErrorWrapperInternal),
+ std::move(onErrorWrapperInternal),
messagingQos);
}
} else {
@@ -231,8 +237,8 @@ class JOYNR_EXPORT CapabilitiesRegistrar
interfaceName);
onSuccess();
},
- std::move(onApplicationErrorWrapper),
- std::move(onErrorWrapper));
+ std::move(onApplicationErrorWrapperInternal),
+ std::move(onErrorWrapperInternal));
} else {
discoveryProxyPtr->addAsync(
entry,
@@ -248,14 +254,14 @@ class JOYNR_EXPORT CapabilitiesRegistrar
interfaceName);
onSuccess();
},
- std::move(onApplicationErrorWrapper),
- std::move(onErrorWrapper));
+ std::move(onApplicationErrorWrapperInternal),
+ std::move(onErrorWrapperInternal));
}
}
} else {
const joynr::exceptions::JoynrRuntimeException error(
"runtime and required discovery proxy have been already destroyed");
- onErrorWrapper(error);
+ onErrorWrapperInternal(error);
}
};
@@ -269,7 +275,7 @@ class JOYNR_EXPORT CapabilitiesRegistrar
expiryDateMs,
isSticky,
std::move(onSuccessWrapper),
- std::move(onError));
+ std::move(onErrorWrapper));
return participantId;
}
diff --git a/cpp/libjoynr/interface/include/joynr/IJoynrProvider.h b/cpp/libjoynr/interface/include/joynr/IJoynrProvider.h
index 76cd869b12..88f5625d67 100644
--- a/cpp/libjoynr/interface/include/joynr/IJoynrProvider.h
+++ b/cpp/libjoynr/interface/include/joynr/IJoynrProvider.h
@@ -86,6 +86,14 @@ class IJoynrProvider
virtual void unregisterBroadcastListener(
const std::string& broadcastName,
std::shared_ptr broadcastListener) = 0;
+ /**
+ * @brief Unregister and delete a listener for multicast broadcasts
+ * @param broadcastName The name of the broadcast for which publications shall be done
+ * @param broadcastListener The listener object containing the callbacks for publications and
+ * failures
+ */
+ virtual void unregisterBroadcastListener(
+ std::shared_ptr broadcastListener) = 0;
/**
* @brief Gets the interface name
diff --git a/cpp/libjoynr/interface/include/joynr/IMessageSender.h b/cpp/libjoynr/interface/include/joynr/IMessageSender.h
index c3af501482..10e506d9a9 100644
--- a/cpp/libjoynr/interface/include/joynr/IMessageSender.h
+++ b/cpp/libjoynr/interface/include/joynr/IMessageSender.h
@@ -117,13 +117,6 @@ class IMessageSender : public IPublicationSender
const BroadcastSubscriptionRequest& subscriptionRequest,
bool isLocalMessage) = 0;
- virtual void sendMulticastSubscriptionRequest(
- const std::string& senderParticipantId,
- const std::string& receiverParticipantId,
- const MessagingQos& qos,
- const MulticastSubscriptionRequest& subscriptionRequest,
- bool isLocalMessage) = 0;
-
virtual void sendSubscriptionStop(const std::string& senderParticipantId,
const std::string& receiverParticipantId,
const MessagingQos& qos,
diff --git a/cpp/libjoynr/joynr-messaging/AbstractMessageRouter.cpp b/cpp/libjoynr/joynr-messaging/AbstractMessageRouter.cpp
index a46f018f1f..30021bc3a3 100644
--- a/cpp/libjoynr/joynr-messaging/AbstractMessageRouter.cpp
+++ b/cpp/libjoynr/joynr-messaging/AbstractMessageRouter.cpp
@@ -119,9 +119,6 @@ void AbstractMessageRouter::shutdown()
_messageQueueCleanerTimer.cancel();
_routingTableCleanerTimer.cancel();
_messageScheduler->shutdown();
- if (_messagingStubFactory) {
- _messagingStubFactory->shutdown();
- }
}
void AbstractMessageRouter::addProvisionedNextHop(
diff --git a/cpp/libjoynr/joynr-messaging/MessageSender.cpp b/cpp/libjoynr/joynr-messaging/MessageSender.cpp
index 60378a9c53..7e56c59fcc 100644
--- a/cpp/libjoynr/joynr-messaging/MessageSender.cpp
+++ b/cpp/libjoynr/joynr-messaging/MessageSender.cpp
@@ -209,33 +209,6 @@ void MessageSender::sendBroadcastSubscriptionRequest(
}
}
-void MessageSender::sendMulticastSubscriptionRequest(
- const std::string& senderParticipantId,
- const std::string& receiverParticipantId,
- const MessagingQos& qos,
- const MulticastSubscriptionRequest& subscriptionRequest,
- bool isLocalMessage)
-{
- std::ignore = isLocalMessage;
-
- try {
- // MulticastSubscriptionRequest is no longer transmitted, instead
- // the SubscriptionReply formerly sent by provider is simulated and
- // routed back to invoke regular reply handling as before.
- JOYNR_LOG_DEBUG(logger(),
- "MulticastSubscription: subscriptionId: {}, "
- "proxy participantId: {}, provider participantId: {}",
- subscriptionRequest.getSubscriptionId(),
- senderParticipantId,
- receiverParticipantId);
- SubscriptionReply subscriptionReply;
- subscriptionReply.setSubscriptionId(subscriptionRequest.getSubscriptionId());
- sendSubscriptionReply(receiverParticipantId, senderParticipantId, qos, subscriptionReply);
- } catch (const std::invalid_argument& exception) {
- throw joynr::exceptions::MethodInvocationException(exception.what());
- }
-}
-
void MessageSender::sendSubscriptionReply(const std::string& senderParticipantId,
const std::string& receiverParticipantId,
const MessagingQos& qos,
diff --git a/cpp/libjoynr/joynr-messaging/MessagingSettings.cpp b/cpp/libjoynr/joynr-messaging/MessagingSettings.cpp
index f1f873d04f..c06e55e1bd 100644
--- a/cpp/libjoynr/joynr-messaging/MessagingSettings.cpp
+++ b/cpp/libjoynr/joynr-messaging/MessagingSettings.cpp
@@ -105,6 +105,12 @@ const std::string& MessagingSettings::SETTING_MQTT_KEEP_ALIVE_TIME_SECONDS()
return value;
}
+const std::string& MessagingSettings::SETTING_MQTT_RETAIN()
+{
+ static const std::string value("messaging/mqtt-retain");
+ return value;
+}
+
std::chrono::seconds MessagingSettings::DEFAULT_MQTT_KEEP_ALIVE_TIME_SECONDS()
{
static const std::chrono::seconds value(60);
@@ -370,6 +376,16 @@ void MessagingSettings::setMqttKeepAliveTimeSeconds(std::chrono::seconds mqttKee
_settings.set(SETTING_MQTT_KEEP_ALIVE_TIME_SECONDS(), mqttKeepAliveTimeSeconds.count());
}
+bool MessagingSettings::getMqttRetain() const
+{
+ return _settings.get(SETTING_MQTT_RETAIN());
+}
+
+void MessagingSettings::setMqttRetain(const bool& retainStatus)
+{
+ _settings.set(SETTING_MQTT_RETAIN(), retainStatus);
+}
+
std::chrono::seconds MessagingSettings::getMqttReconnectDelayTimeSeconds() const
{
return std::chrono::seconds(
diff --git a/cpp/libjoynr/joynr-messaging/include/joynr/MessageSender.h b/cpp/libjoynr/joynr-messaging/include/joynr/MessageSender.h
index bb9082aeeb..2f13483e81 100644
--- a/cpp/libjoynr/joynr-messaging/include/joynr/MessageSender.h
+++ b/cpp/libjoynr/joynr-messaging/include/joynr/MessageSender.h
@@ -124,12 +124,6 @@ class JOYNR_EXPORT MessageSender : public IMessageSender
const BroadcastSubscriptionRequest& subscriptionRequest,
bool isLocalMessage) override;
- void sendMulticastSubscriptionRequest(const std::string& senderParticipantId,
- const std::string& receiverParticipantId,
- const MessagingQos& qos,
- const MulticastSubscriptionRequest& subscriptionRequest,
- bool isLocalMessage) override;
-
void sendSubscriptionReply(const std::string& senderParticipantId,
const std::string& receiverParticipantId,
const MessagingQos& qos,
diff --git a/cpp/libjoynr/joynr-messaging/include/joynr/MessagingSettings.h b/cpp/libjoynr/joynr-messaging/include/joynr/MessagingSettings.h
index fe1d7805a6..c4a160dc11 100644
--- a/cpp/libjoynr/joynr-messaging/include/joynr/MessagingSettings.h
+++ b/cpp/libjoynr/joynr-messaging/include/joynr/MessagingSettings.h
@@ -50,6 +50,7 @@ class JOYNR_EXPORT MessagingSettings
static const std::string& SETTING_CAPABILITIES_DIRECTORY_CHANNELID();
static const std::string& SETTING_CAPABILITIES_DIRECTORY_PARTICIPANTID();
static const std::string& SETTING_MQTT_KEEP_ALIVE_TIME_SECONDS();
+ static const std::string& SETTING_MQTT_RETAIN();
static const std::string& SETTING_MQTT_RECONNECT_DELAY_TIME_SECONDS();
static const std::string& SETTING_MQTT_RECONNECT_MAX_DELAY();
static const std::string& SETTING_MQTT_EXPONENTIAL_BACKOFF_ENABLED();
@@ -121,6 +122,8 @@ class JOYNR_EXPORT MessagingSettings
std::chrono::seconds getMqttKeepAliveTimeSeconds() const;
void setMqttKeepAliveTimeSeconds(std::chrono::seconds mqttKeepAliveTimeSeconds);
+ bool getMqttRetain() const;
+ void setMqttRetain(const bool& retainStatus);
std::chrono::seconds getMqttReconnectDelayTimeSeconds() const;
void setMqttReconnectDelayTimeSeconds(std::chrono::seconds mqttReconnectDelayTimeSeconds);
std::chrono::seconds getMqttReconnectMaxDelayTimeSeconds() const;
diff --git a/cpp/libjoynr/pom.xml b/cpp/libjoynr/pom.xml
index 47161505fe..8e16105faf 100644
--- a/cpp/libjoynr/pom.xml
+++ b/cpp/libjoynr/pom.xml
@@ -26,7 +26,7 @@
io.joynr
cpp
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/cpp/libjoynr/util/include/joynr/Util.h b/cpp/libjoynr/util/include/joynr/Util.h
index f3cc502676..70036d112b 100644
--- a/cpp/libjoynr/util/include/joynr/Util.h
+++ b/cpp/libjoynr/util/include/joynr/Util.h
@@ -38,6 +38,8 @@
#include
#include
+#include "joynr/Logger.h"
+
namespace joynr
{
@@ -155,8 +157,8 @@ template class T, typename U>
struct IsDerivedFromTemplate {
private:
template
- static decltype(static_cast&>(std::declval()), std::true_type{})
- test(const T&);
+ static decltype(static_cast&>(std::declval()), std::true_type{}) test(
+ const T&);
static std::false_type test(...);
public:
@@ -231,6 +233,20 @@ std::enable_if_t::value, bool> compareValues(
return x == y;
}
+template
+void safeInvokeCallback(const Logger& logger, const Method& method, Args&&... args)
+{
+ try {
+ if (method) {
+ method(std::forward(args)...);
+ }
+ } catch (const std::exception& e) {
+ JOYNR_LOG_ERROR(logger, "Exception caught during execution of callback: ", e.what());
+ } catch (...) {
+ JOYNR_LOG_ERROR(logger, "Exception caught during execution of callback.");
+ }
+}
+
} // namespace util
} // namespace joynr
diff --git a/cpp/libjoynrclustercontroller/capabilities-directory/GlobalCapabilitiesDirectoryClient.cpp b/cpp/libjoynrclustercontroller/capabilities-directory/GlobalCapabilitiesDirectoryClient.cpp
index 868bc695fa..113432c2d5 100644
--- a/cpp/libjoynrclustercontroller/capabilities-directory/GlobalCapabilitiesDirectoryClient.cpp
+++ b/cpp/libjoynrclustercontroller/capabilities-directory/GlobalCapabilitiesDirectoryClient.cpp
@@ -75,7 +75,10 @@ void GlobalCapabilitiesDirectoryClient::add(
TaskSequencer::TaskWithExpiryDate addTask;
if (!awaitGlobalRegistration) {
- addTask._expiryDate = TimePoint::max();
+ addTask._expiryDate =
+ (TimePoint::now() > TimePoint::fromAbsoluteMs(entry.getExpiryDateMs()))
+ ? TimePoint::now()
+ : TimePoint::max();
addTask._timeout = []() {};
} else {
addTask._expiryDate =
diff --git a/cpp/libjoynrclustercontroller/capabilities-directory/LocalCapabilitiesDirectory.cpp b/cpp/libjoynrclustercontroller/capabilities-directory/LocalCapabilitiesDirectory.cpp
index cc94c34013..6625dea65b 100644
--- a/cpp/libjoynrclustercontroller/capabilities-directory/LocalCapabilitiesDirectory.cpp
+++ b/cpp/libjoynrclustercontroller/capabilities-directory/LocalCapabilitiesDirectory.cpp
@@ -38,7 +38,6 @@
#include "joynr/CallContext.h"
#include "joynr/CallContextStorage.h"
-#include "joynr/CapabilitiesStorage.h"
#include "joynr/ClusterControllerSettings.h"
#include "joynr/DiscoveryQos.h"
#include "joynr/ILocalCapabilitiesCallback.h"
@@ -159,12 +158,11 @@ void LocalCapabilitiesDirectory::sendAndRescheduleFreshnessUpdate(
{
std::unique_lock expiryDateUpdateLock(
_localCapabilitiesDirectoryStore->getCacheLock());
- participantIds =
- _localCapabilitiesDirectoryStore
- ->getLocallyRegisteredCapabilities(expiryDateUpdateLock)
- ->touchAndReturnGlobalParticipantIds(newLastSeenDateMs, newExpiryDateMs);
- _localCapabilitiesDirectoryStore->getGlobalLookupCache(expiryDateUpdateLock)
- ->touchSelected(participantIds, newLastSeenDateMs, newExpiryDateMs);
+ participantIds = _localCapabilitiesDirectoryStore
+ ->touchAndReturnGlobalParticipantIdsFromLocalCapabilities(
+ expiryDateUpdateLock, newLastSeenDateMs, newExpiryDateMs);
+ _localCapabilitiesDirectoryStore->touchSelectedGlobalParticipant(
+ expiryDateUpdateLock, participantIds, newLastSeenDateMs, newExpiryDateMs);
}
if (participantIds.empty()) {
@@ -449,7 +447,6 @@ void LocalCapabilitiesDirectory::triggerGlobalProviderReregistration(
std::unique_lock providerReregistrationLock(
_localCapabilitiesDirectoryStore->getCacheLock());
JOYNR_LOG_DEBUG(logger(), "triggerGlobalProviderReregistration");
- std::vector entries;
const std::int64_t now = std::chrono::duration_cast(
std::chrono::system_clock::now().time_since_epoch())
.count();
@@ -458,16 +455,9 @@ void LocalCapabilitiesDirectory::triggerGlobalProviderReregistration(
// copy existing global entries, update lastSeenDateMs and
// increase expiryDateMs unless it already references a time
// which is beyond newExpiryDate/updatedExpiryDate
- for (auto capability : *(_localCapabilitiesDirectoryStore->getLocallyRegisteredCapabilities(
- providerReregistrationLock))) {
- if (capability.getExpiryDateMs() < newExpiryDateMs) {
- capability.setExpiryDateMs(newExpiryDateMs);
- }
- if (capability.getLastSeenDateMs() < now) {
- capability.setLastSeenDateMs(now);
- }
- entries.push_back(capability);
- }
+ std::vector entries =
+ _localCapabilitiesDirectoryStore->insertLocallyRegisteredCapabilitesToEntryList(
+ providerReregistrationLock, now, newExpiryDateMs);
for (const auto& capability : entries) {
if (capability.getQos().getScope() == types::ProviderScope::GLOBAL) {
const std::string& participantId = capability.getParticipantId();
@@ -475,13 +465,11 @@ void LocalCapabilitiesDirectory::triggerGlobalProviderReregistration(
participantId, providerReregistrationLock);
if (!foundGbids.empty()) {
// update local store
- _localCapabilitiesDirectoryStore
- ->getLocallyRegisteredCapabilities(providerReregistrationLock)
- ->insert(capability, foundGbids);
+ _localCapabilitiesDirectoryStore->insertIntoLocallyRegisteredCapabilities(
+ providerReregistrationLock, capability, foundGbids);
// update global cache
- _localCapabilitiesDirectoryStore
- ->getGlobalLookupCache(providerReregistrationLock)
- ->insert(capability);
+ _localCapabilitiesDirectoryStore->insertIntoGlobalCachedCapabilities(
+ providerReregistrationLock, capability);
// send entries to JDS again
auto onApplicationError = [participantId, foundGbids](
const types::DiscoveryError::Enum& error) {
@@ -519,9 +507,8 @@ void LocalCapabilitiesDirectory::triggerGlobalProviderReregistration(
}
} else {
// update local cache
- _localCapabilitiesDirectoryStore
- ->getLocallyRegisteredCapabilities(providerReregistrationLock)
- ->insert(capability);
+ _localCapabilitiesDirectoryStore->insertIntoLocallyRegisteredCapabilities(
+ providerReregistrationLock, capability);
}
}
}
@@ -780,16 +767,8 @@ std::vector LocalCapabilitiesDirectory::
LCDUtil::convert(false, currentEntry);
validGlobalEntries.push_back(std::move(convertedEntry));
- std::vector gbids;
- if (auto mqttAddress =
- dynamic_cast(address.get())) {
- gbids.push_back(mqttAddress->getBrokerUri());
- } else {
- // use default GBID for all other address types
- gbids.push_back(_knownGbids[0]);
- }
- _localCapabilitiesDirectoryStore->insertInGlobalLookupCache(
- std::move(currentEntry), std::move(gbids));
+ _localCapabilitiesDirectoryStore->insertRemoteEntriesIntoGlobalCache(
+ currentEntry, address, _knownGbids);
} catch (const joynr::exceptions::JoynrException& e) {
JOYNR_LOG_WARN(logger(),
@@ -1129,23 +1108,19 @@ void LocalCapabilitiesDirectory::remove(
participantId, removeLock);
boost::optional optionalEntry =
- _localCapabilitiesDirectoryStore->getLocallyRegisteredCapabilities(removeLock)
- ->lookupByParticipantId(participantId);
-
+ _localCapabilitiesDirectoryStore->lookupLocalEntry(participantId);
if (optionalEntry && !LCDUtil::isGlobal(optionalEntry.get())) {
- _localCapabilitiesDirectoryStore->getLocallyRegisteredCapabilities(removeLock)
- ->removeByParticipantId(participantId);
- _localCapabilitiesDirectoryStore->eraseParticipantIdToAwaitGlobalRegistrationMapping(
+ _localCapabilitiesDirectoryStore->removeLocallyRegisteredParticipant(
participantId, removeLock);
JOYNR_LOG_INFO(
logger(),
"Removed locally registered participantId {}: #localCapabilities {}, "
"#registeredGlobalCapabilities: {}, #globalLookupCache: {}",
participantId,
- _localCapabilitiesDirectoryStore->getLocallyRegisteredCapabilities(removeLock)
- ->size(),
+ _localCapabilitiesDirectoryStore->getLocallyRegisteredCapabilitiesCount(
+ removeLock),
_localCapabilitiesDirectoryStore->countGlobalCapabilities(),
- _localCapabilitiesDirectoryStore->getGlobalLookupCache(removeLock)->size());
+ _localCapabilitiesDirectoryStore->getGlobalCachedCapabilitiesCount(removeLock));
} else {
auto onGlobalRemoveSuccess = [participantId,
awaitGlobalRegistration,
@@ -1157,13 +1132,7 @@ void LocalCapabilitiesDirectory::remove(
if (lCDStoreSharedPtr && awaitGlobalRegistration) {
std::unique_lock cacheLock(
lCDStoreSharedPtr->getCacheLock());
- lCDStoreSharedPtr->eraseParticipantIdToGbidMapping(participantId, cacheLock);
- lCDStoreSharedPtr->getGlobalLookupCache(cacheLock)->removeByParticipantId(
- participantId);
- lCDStoreSharedPtr->getLocallyRegisteredCapabilities(cacheLock)
- ->removeByParticipantId(participantId);
- lCDStoreSharedPtr->eraseParticipantIdToAwaitGlobalRegistrationMapping(
- participantId, cacheLock);
+ lCDStoreSharedPtr->removeParticipant(participantId, cacheLock);
JOYNR_LOG_INFO(
logger(),
"Removed globally registered participantId: {} from GBIDs: >{}< "
@@ -1171,9 +1140,9 @@ void LocalCapabilitiesDirectory::remove(
"#registeredGlobalCapabilities: {}, #globalLookupCache: {}",
participantId,
gbidString,
- lCDStoreSharedPtr->getLocallyRegisteredCapabilities(cacheLock)->size(),
+ lCDStoreSharedPtr->getLocallyRegisteredCapabilitiesCount(cacheLock),
lCDStoreSharedPtr->countGlobalCapabilities(),
- lCDStoreSharedPtr->getGlobalLookupCache(cacheLock)->size());
+ lCDStoreSharedPtr->getGlobalCachedCapabilitiesCount(cacheLock));
return;
}
JOYNR_LOG_INFO(logger(),
@@ -1202,23 +1171,15 @@ void LocalCapabilitiesDirectory::remove(
participantId,
gbidString,
types::DiscoveryError::getLiteral(error));
- lCDStoreSharedPtr->eraseParticipantIdToGbidMapping(
- participantId, cacheLock);
- lCDStoreSharedPtr->getGlobalLookupCache(cacheLock)->removeByParticipantId(
- participantId);
- lCDStoreSharedPtr->getLocallyRegisteredCapabilities(cacheLock)
- ->removeByParticipantId(participantId);
- lCDStoreSharedPtr->eraseParticipantIdToAwaitGlobalRegistrationMapping(
- participantId, cacheLock);
+ lCDStoreSharedPtr->removeParticipant(participantId, cacheLock);
JOYNR_LOG_INFO(
logger(),
"After removal of participantId {}: #localCapabilities {}, "
"#registeredGlobalCapabilities: {}, #globalLookupCache: {}",
participantId,
- lCDStoreSharedPtr->getLocallyRegisteredCapabilities(cacheLock)
- ->size(),
+ lCDStoreSharedPtr->getLocallyRegisteredCapabilitiesCount(cacheLock),
lCDStoreSharedPtr->countGlobalCapabilities(),
- lCDStoreSharedPtr->getGlobalLookupCache(cacheLock)->size());
+ lCDStoreSharedPtr->getGlobalCachedCapabilitiesCount(cacheLock));
return;
}
JOYNR_LOG_WARN(logger(),
@@ -1260,15 +1221,7 @@ void LocalCapabilitiesDirectory::remove(
// delete the entry, then schedule removal at JDS
if (!awaitGlobalRegistration) {
const std::string gbidString = boost::algorithm::join(gbidsToRemove, ", ");
- _localCapabilitiesDirectoryStore->eraseParticipantIdToGbidMapping(
- participantId, removeLock);
- _localCapabilitiesDirectoryStore->getGlobalLookupCache(removeLock)
- ->removeByParticipantId(participantId);
- _localCapabilitiesDirectoryStore->getLocallyRegisteredCapabilities(removeLock)
- ->removeByParticipantId(participantId);
- _localCapabilitiesDirectoryStore
- ->eraseParticipantIdToAwaitGlobalRegistrationMapping(
- participantId, removeLock);
+ _localCapabilitiesDirectoryStore->removeParticipant(participantId, removeLock);
JOYNR_LOG_INFO(
logger(),
"Removed local entries for participantId: {}. GBIDs: >{}< "
@@ -1276,11 +1229,11 @@ void LocalCapabilitiesDirectory::remove(
"#registeredGlobalCapabilities: {}, #globalLookupCache: {}",
participantId,
gbidString,
- _localCapabilitiesDirectoryStore
- ->getLocallyRegisteredCapabilities(removeLock)
- ->size(),
+ _localCapabilitiesDirectoryStore->getLocallyRegisteredCapabilitiesCount(
+ removeLock),
_localCapabilitiesDirectoryStore->countGlobalCapabilities(),
- _localCapabilitiesDirectoryStore->getGlobalLookupCache(removeLock)->size());
+ _localCapabilitiesDirectoryStore->getGlobalCachedCapabilitiesCount(
+ removeLock));
}
_globalCapabilitiesDirectoryClient->remove(participantId,
std::move(gbidsToRemove),
@@ -1337,13 +1290,11 @@ void LocalCapabilitiesDirectory::checkExpiredDiscoveryEntries(
_localCapabilitiesDirectoryStore->getCacheLock());
auto removedLocalCapabilities =
- _localCapabilitiesDirectoryStore
- ->getLocallyRegisteredCapabilities(discoveryEntryExpiryCheckLock)
- ->removeExpired();
+ _localCapabilitiesDirectoryStore->removeExpiredLocallyRegisteredCapabilities(
+ discoveryEntryExpiryCheckLock);
auto removedGlobalCapabilities =
- _localCapabilitiesDirectoryStore
- ->getGlobalLookupCache(discoveryEntryExpiryCheckLock)
- ->removeExpired();
+ _localCapabilitiesDirectoryStore->removeExpiredCapabilitiesFromGlobalCache(
+ discoveryEntryExpiryCheckLock);
if (!removedLocalCapabilities.empty() || !removedGlobalCapabilities.empty()) {
if (auto messageRouterSharedPtr = _messageRouter.lock()) {
@@ -1352,13 +1303,11 @@ void LocalCapabilitiesDirectory::checkExpiredDiscoveryEntries(
"Following discovery entries expired: local: {}, "
"#localCapabilities: {}, global: {}, #globalLookupCache: {}",
LCDUtil::joinToString(removedLocalCapabilities),
- _localCapabilitiesDirectoryStore
- ->getLocallyRegisteredCapabilities(discoveryEntryExpiryCheckLock)
- ->size(),
+ _localCapabilitiesDirectoryStore->getLocallyRegisteredCapabilitiesCount(
+ discoveryEntryExpiryCheckLock),
LCDUtil::joinToString(removedGlobalCapabilities),
- _localCapabilitiesDirectoryStore
- ->getGlobalLookupCache(discoveryEntryExpiryCheckLock)
- ->size());
+ _localCapabilitiesDirectoryStore->getGlobalCachedCapabilitiesCount(
+ discoveryEntryExpiryCheckLock));
for (const auto& capability :
boost::join(removedLocalCapabilities, removedGlobalCapabilities)) {
diff --git a/cpp/libjoynrclustercontroller/capabilities-directory/LocalCapabilitiesDirectoryStore.cpp b/cpp/libjoynrclustercontroller/capabilities-directory/LocalCapabilitiesDirectoryStore.cpp
index c530fcae4f..879d86019a 100644
--- a/cpp/libjoynrclustercontroller/capabilities-directory/LocalCapabilitiesDirectoryStore.cpp
+++ b/cpp/libjoynrclustercontroller/capabilities-directory/LocalCapabilitiesDirectoryStore.cpp
@@ -29,6 +29,7 @@
#include "joynr/LCDUtil.h"
#include "joynr/LocalCapabilitiesDirectoryStore.h"
#include "joynr/Util.h"
+#include "joynr/system/RoutingTypes/MqttAddress.h"
#include "joynr/types/DiscoveryQos.h"
namespace joynr
@@ -96,8 +97,12 @@ bool LocalCapabilitiesDirectoryStore::getLocalAndCachedCapabilities(
std::chrono::milliseconds(discoveryQos.getCacheMaxAge()));
}
- return callReceiverIfPossible(
- scope, localCapabilities, globallyCachedEntries, std::move(callback));
+ if (areMissingDomains(interfaceAddresses, localCapabilities, globallyCachedEntries)) {
+ return false;
+ } else {
+ return collectCapabilities(
+ scope, localCapabilities, globallyCachedEntries, std::move(callback));
+ }
}
bool LocalCapabilitiesDirectoryStore::getLocalAndCachedCapabilities(
@@ -124,8 +129,12 @@ bool LocalCapabilitiesDirectoryStore::getLocalAndCachedCapabilities(
auto localCapabilities = LCDUtil::optionalToVector(std::move(localCapability));
auto globallyCachedEntries = LCDUtil::optionalToVector(std::move(globalCachedCapability));
- return callReceiverIfPossible(
- scope, localCapabilities, globallyCachedEntries, std::move(callback));
+ if (areMissingDomains(scope, participantId, localCapabilities, globallyCachedEntries)) {
+ return false;
+ } else {
+ return collectCapabilities(
+ scope, localCapabilities, globallyCachedEntries, std::move(callback));
+ }
}
bool LocalCapabilitiesDirectoryStore::getAwaitGlobalRegistration(
@@ -142,38 +151,130 @@ bool LocalCapabilitiesDirectoryStore::getAwaitGlobalRegistration(
return false;
}
-bool LocalCapabilitiesDirectoryStore::callReceiverIfPossible(
- joynr::types::DiscoveryScope::Enum& scope,
+std::vector LocalCapabilitiesDirectoryStore::
+ touchAndReturnGlobalParticipantIdsFromLocalCapabilities(
+ const std::unique_lock& cacheLock,
+ const std::int64_t& newLastSeenDateMs,
+ const std::int64_t& newExpiryDateMs)
+{
+ return getLocallyRegisteredCapabilities(cacheLock)->touchAndReturnGlobalParticipantIds(
+ newLastSeenDateMs, newExpiryDateMs);
+}
+
+void LocalCapabilitiesDirectoryStore::touchSelectedGlobalParticipant(
+ const std::unique_lock& cacheLock,
+ const std::vector& participantIds,
+ const std::int64_t& newLastSeenDateMs,
+ const std::int64_t& newExpiryDateMs)
+{
+ getGlobalLookupCache(cacheLock)->touchSelected(
+ participantIds, newLastSeenDateMs, newExpiryDateMs);
+}
+
+void LocalCapabilitiesDirectoryStore::insertIntoLocallyRegisteredCapabilities(
+ const std::unique_lock& cacheLock,
+ const joynr::types::DiscoveryEntry& capability,
+ std::vector gbids)
+{
+ auto locallyRegisteredCapabilities{getLocallyRegisteredCapabilities(cacheLock)};
+ if (!gbids.empty()) {
+ locallyRegisteredCapabilities->insert(capability, gbids);
+ } else {
+ locallyRegisteredCapabilities->insert(capability);
+ }
+}
+
+void LocalCapabilitiesDirectoryStore::insertIntoGlobalCachedCapabilities(
+ const std::unique_lock& cacheLock,
+ const joynr::types::DiscoveryEntry& capability)
+{
+ getGlobalLookupCache(cacheLock)->insert(capability);
+}
+
+std::vector LocalCapabilitiesDirectoryStore::
+ removeExpiredCapabilitiesFromGlobalCache(
+ const std::unique_lock& cacheLock)
+{
+ return getGlobalLookupCache(cacheLock)->removeExpired();
+}
+
+std::vector LocalCapabilitiesDirectoryStore::
+ removeExpiredLocallyRegisteredCapabilities(
+ const std::unique_lock& cacheLock)
+{
+ return getLocallyRegisteredCapabilities(cacheLock)->removeExpired();
+}
+
+std::size_t LocalCapabilitiesDirectoryStore::getLocallyRegisteredCapabilitiesCount(
+ const std::unique_lock& cacheLock)
+{
+ return getLocallyRegisteredCapabilities(cacheLock)->size();
+}
+
+std::size_t LocalCapabilitiesDirectoryStore::getGlobalCachedCapabilitiesCount(
+ const std::unique_lock& cacheLock)
+{
+ return getGlobalLookupCache(cacheLock)->size();
+}
+
+std::vector LocalCapabilitiesDirectoryStore::
+ insertLocallyRegisteredCapabilitesToEntryList(
+ const std::unique_lock& cacheLock,
+ const std::int64_t& currentTime,
+ const std::int64_t& newExpiryDateMs)
+{
+ std::vector entries{};
+ for (auto capability : *(getLocallyRegisteredCapabilities(cacheLock))) {
+ if (capability.getExpiryDateMs() < newExpiryDateMs) {
+ capability.setExpiryDateMs(newExpiryDateMs);
+ }
+ if (capability.getLastSeenDateMs() < currentTime) {
+ capability.setLastSeenDateMs(currentTime);
+ }
+ entries.push_back(capability);
+ }
+ return entries;
+}
+bool LocalCapabilitiesDirectoryStore::getLocalCapabilities(
+ const std::vector& localCapabilities,
+ std::shared_ptr callback)
+{
+ // we call capabilitiesReceived for empty results, too
+ const auto& localCapsWithMetaInfo = LCDUtil::convert(true, localCapabilities);
+ callback->capabilitiesReceived(localCapsWithMetaInfo);
+ return true;
+}
+
+bool LocalCapabilitiesDirectoryStore::getLocalThenGlobalCapabilities(
const std::vector& localCapabilities,
const std::vector& globallyCachedCapabilities,
std::shared_ptr callback)
{
- // return only local capabilities
- if (scope == joynr::types::DiscoveryScope::LOCAL_ONLY) {
- // we call capabilitiesReceived for empty results, too
+ bool areCapabilitiesAvailable{false};
+
+ if (!localCapabilities.empty()) {
const auto& localCapsWithMetaInfo = LCDUtil::convert(true, localCapabilities);
callback->capabilitiesReceived(localCapsWithMetaInfo);
- return true;
+ areCapabilitiesAvailable = true;
}
-
- // return local then global capabilities
- if (scope == joynr::types::DiscoveryScope::LOCAL_THEN_GLOBAL) {
- if (!localCapabilities.empty()) {
- const auto& localCapsWithMetaInfo = LCDUtil::convert(true, localCapabilities);
- callback->capabilitiesReceived(localCapsWithMetaInfo);
- return true;
- }
- if (!globallyCachedCapabilities.empty()) {
- const auto& globalCachedCapsWithMetaInfo =
- LCDUtil::convert(false, globallyCachedCapabilities);
- callback->capabilitiesReceived(globalCachedCapsWithMetaInfo);
- return true;
- }
+ if (!globallyCachedCapabilities.empty()) {
+ const auto& globalCachedCapsWithMetaInfo =
+ LCDUtil::convert(false, globallyCachedCapabilities);
+ callback->capabilitiesReceived(globalCachedCapsWithMetaInfo);
+ areCapabilitiesAvailable = true;
}
- // return local and global capabilities
- if (scope == joynr::types::DiscoveryScope::LOCAL_AND_GLOBAL &&
- !globallyCachedCapabilities.empty()) {
+ return areCapabilitiesAvailable;
+}
+
+bool LocalCapabilitiesDirectoryStore::getLocalAndGlobalCapabilities(
+ const std::vector& localCapabilities,
+ const std::vector& globallyCachedCapabilities,
+ std::shared_ptr callback)
+{
+ bool areCapabilitiesAvailable{false};
+
+ if (!globallyCachedCapabilities.empty()) {
auto localCapsWithMetaInfo = LCDUtil::convert(true, localCapabilities);
auto globalCachedCapsWithMetaInfo = LCDUtil::convert(false, globallyCachedCapabilities);
@@ -182,11 +283,20 @@ bool LocalCapabilitiesDirectoryStore::callReceiverIfPossible(
const auto& localAndGlobalCapsWithMetaInfo = LCDUtil::filterDuplicates(
std::move(localCapsWithMetaInfo), std::move(globalCachedCapsWithMetaInfo));
callback->capabilitiesReceived(localAndGlobalCapsWithMetaInfo);
- return true;
+ areCapabilitiesAvailable = true;
}
- // return globally registered entries and the global cached entries
- if (scope == joynr::types::DiscoveryScope::GLOBAL_ONLY && !globallyCachedCapabilities.empty()) {
+ return areCapabilitiesAvailable;
+}
+
+bool LocalCapabilitiesDirectoryStore::getGlobalCapabilities(
+ const std::vector& localCapabilities,
+ const std::vector& globallyCachedCapabilities,
+ std::shared_ptr callback)
+{
+ bool areCapabilitiesAvailable{false};
+
+ if (!globallyCachedCapabilities.empty()) {
// lookup remote entries in GCD if there are no cached entries
std::vector globallyRegisteredEntries;
for (const auto& capability : localCapabilities) {
@@ -202,9 +312,10 @@ bool LocalCapabilitiesDirectoryStore::callReceiverIfPossible(
LCDUtil::filterDuplicates(std::move(globallyRegisteredCapsWithMetaInfo),
std::move(globalCachedCapsWithMetaInfo));
callback->capabilitiesReceived(allGlobalCaps);
- return true;
+ areCapabilitiesAvailable = true;
}
- return false;
+
+ return areCapabilitiesAvailable;
}
void LocalCapabilitiesDirectoryStore::mapGbidsToGlobalProviderParticipantId(
@@ -224,12 +335,23 @@ void LocalCapabilitiesDirectoryStore::mapGbidsToGlobalProviderParticipantId(
_globalParticipantIdsToGbidsMap[participantId] = allGbids;
}
+boost::optional LocalCapabilitiesDirectoryStore::lookupGlobalEntry(
+ const std::string& participantId)
+{
+ return _globalLookupCache->lookupByParticipantId(participantId);
+}
+
+boost::optional LocalCapabilitiesDirectoryStore::lookupLocalEntry(
+ const std::string& participantId)
+{
+ return _locallyRegisteredCapabilities->lookupByParticipantId(participantId);
+}
+
std::vector LocalCapabilitiesDirectoryStore::getLocalCapabilities(
const std::string& participantId)
{
std::lock_guard localCachedRetrievalLock(_cacheLock);
- return LCDUtil::optionalToVector(
- _locallyRegisteredCapabilities->lookupByParticipantId(participantId));
+ return LCDUtil::optionalToVector(lookupLocalEntry(participantId));
}
std::vector LocalCapabilitiesDirectoryStore::getLocalCapabilities(
@@ -297,6 +419,39 @@ void LocalCapabilitiesDirectoryStore::insertInGlobalLookupCache(
_globalLookupCache->size());
}
+void LocalCapabilitiesDirectoryStore::insertRemoteEntriesIntoGlobalCache(
+ const types::DiscoveryEntry& entry,
+ const std::shared_ptr& address,
+ const std::vector& knownGbids)
+{
+ std::vector gbids;
+ if (auto mqttAddress = dynamic_cast(address.get())) {
+ gbids.push_back(mqttAddress->getBrokerUri());
+ } else {
+ // use default GBID for all other address types
+ gbids.push_back(knownGbids[0]);
+ }
+ insertInGlobalLookupCache(std::move(entry), std::move(gbids));
+}
+
+void LocalCapabilitiesDirectoryStore::removeLocallyRegisteredParticipant(
+ const std::string& participantId,
+ const std::unique_lock& cacheLock)
+{
+ getLocallyRegisteredCapabilities(cacheLock)->removeByParticipantId(participantId);
+ eraseParticipantIdToAwaitGlobalRegistrationMapping(participantId, cacheLock);
+}
+
+void LocalCapabilitiesDirectoryStore::removeParticipant(
+ const std::string& participantId,
+ const std::unique_lock& cacheLock)
+{
+ eraseParticipantIdToGbidMapping(participantId, cacheLock);
+ getGlobalLookupCache(cacheLock)->removeByParticipantId(participantId);
+ getLocallyRegisteredCapabilities(cacheLock)->removeByParticipantId(participantId);
+ eraseParticipantIdToAwaitGlobalRegistrationMapping(participantId, cacheLock);
+}
+
boost::optional LocalCapabilitiesDirectoryStore::searchGlobalCache(
const std::string& participantId,
const std::vector& gbids,
@@ -307,7 +462,7 @@ boost::optional LocalCapabilitiesDirectoryStore::searchGl
if (maxCacheAge.count() >= 0) {
entry = _globalLookupCache->lookupCacheByParticipantId(participantId, maxCacheAge);
} else {
- entry = _globalLookupCache->lookupByParticipantId(participantId);
+ entry = lookupGlobalEntry(participantId);
}
if (entry) {
@@ -343,14 +498,128 @@ std::vector LocalCapabilitiesDirectoryStore::searchGlobal
return result;
}
+bool LocalCapabilitiesDirectoryStore::areMissingDomains(
+ const std::vector& interfaceAddresses,
+ const std::vector& localCapabilities,
+ const std::vector& globallyCachedEntries)
+{
+ bool areMissingDomains{false};
+ std::vector domainList{};
+ if (!localCapabilities.empty() || !globallyCachedEntries.empty()) {
+ for (const auto& interfaceAddress : interfaceAddresses) {
+ domainList.push_back(interfaceAddress.getDomain());
+ }
+ for (const auto& localEntry : localCapabilities) {
+ auto domainMatchIterator{
+ std::find(domainList.cbegin(), domainList.cend(), localEntry.getDomain())};
+ if (domainMatchIterator != domainList.end()) {
+ domainList.erase(domainMatchIterator);
+ }
+ }
+ for (const auto& globalEntry : globallyCachedEntries) {
+ auto domainMatchIterator{
+ std::find(domainList.cbegin(), domainList.cend(), globalEntry.getDomain())};
+ if (domainMatchIterator != domainList.end()) {
+ domainList.erase(domainMatchIterator);
+ }
+ }
+ }
+ if (!domainList.empty()) {
+ areMissingDomains = true;
+ }
+ return areMissingDomains;
+}
+
+bool LocalCapabilitiesDirectoryStore::areMissingDomains(
+ const joynr::types::DiscoveryScope::Enum& scope,
+ const std::string& participantId,
+ const std::vector& localCapabilities,
+ const std::vector& globallyCachedEntries)
+{
+ bool areMissingEntries{false};
+ auto localCapabilitesEntries{localCapabilities};
+ auto globalCapabilitiesEntries{globallyCachedEntries};
+ auto localEntry{lookupLocalEntry(participantId)};
+ auto globalEntry{lookupGlobalEntry(participantId)};
+
+ if (localEntry && scope == joynr::types::DiscoveryScope::GLOBAL_ONLY) {
+ globalEntry = localEntry;
+ localEntry = boost::none;
+ }
+
+ if (localEntry) {
+ for (auto localEntryIterator = localCapabilitesEntries.cbegin();
+ localEntryIterator != localCapabilitesEntries.cend();
+ localEntryIterator++) {
+ if (!localCapabilitesEntries.empty()) {
+ if (localEntryIterator->getDomain() == localEntry->getDomain()) {
+ localCapabilitesEntries.erase(localEntryIterator);
+ break;
+ }
+ }
+ }
+ }
+
+ if (globalEntry) {
+ for (auto globalEntryInterator = globalCapabilitiesEntries.cbegin();
+ globalEntryInterator != globalCapabilitiesEntries.cend();
+ globalEntryInterator++) {
+ if (globalEntryInterator->getDomain() == globalEntry->getDomain()) {
+ globalCapabilitiesEntries.erase(globalEntryInterator);
+ break;
+ }
+ }
+ }
+
+ if (!localCapabilitesEntries.empty() || (!globalCapabilitiesEntries.empty())) {
+ areMissingEntries = true;
+ }
+ return areMissingEntries;
+}
+
+bool LocalCapabilitiesDirectoryStore::collectCapabilities(
+ joynr::types::DiscoveryScope::Enum& scope,
+ const std::vector& localCapabilities,
+ const std::vector& globallyCachedEntries,
+ std::shared_ptr callback)
+{
+ bool areCapabilitiesAvailable{false};
+ switch (scope) {
+ case joynr::types::DiscoveryScope::LOCAL_ONLY: {
+ areCapabilitiesAvailable = getLocalCapabilities(localCapabilities, std::move(callback));
+ break;
+ }
+ case joynr::types::DiscoveryScope::LOCAL_THEN_GLOBAL: {
+ areCapabilitiesAvailable = getLocalThenGlobalCapabilities(
+ localCapabilities, globallyCachedEntries, std::move(callback));
+ break;
+ }
+ case joynr::types::DiscoveryScope::LOCAL_AND_GLOBAL: {
+ areCapabilitiesAvailable = getLocalAndGlobalCapabilities(
+ localCapabilities, globallyCachedEntries, std::move(callback));
+ break;
+ }
+ case joynr::types::DiscoveryScope::GLOBAL_ONLY: {
+ areCapabilitiesAvailable = getGlobalCapabilities(
+ localCapabilities, globallyCachedEntries, std::move(callback));
+ break;
+ }
+ default: {
+ std::string errorMsg = "Unknown or illegal DiscoveryScope value: ";
+ errorMsg += scope;
+ throw exceptions::DiscoveryException(errorMsg);
+ }
+ }
+ return areCapabilitiesAvailable;
+}
+
boost::optional LocalCapabilitiesDirectoryStore::searchLocal(
const std::string& participantId,
const types::DiscoveryScope::Enum& scope)
{
// search locally registered entry in local store
std::lock_guard localSearchLock(_cacheLock);
- boost::optional entry =
- _locallyRegisteredCapabilities->lookupByParticipantId(participantId);
+ boost::optional entry = lookupLocalEntry(participantId);
if (entry && (_includeLocalScopes.find(scope) == _includeLocalScopes.end() &&
entry->getQos().getScope() == types::ProviderScope::LOCAL)) {
// ignore the found entry
diff --git a/cpp/libjoynrclustercontroller/include/joynr/LocalCapabilitiesDirectoryStore.h b/cpp/libjoynrclustercontroller/include/joynr/LocalCapabilitiesDirectoryStore.h
index 145c3f66fc..c512ad1688 100644
--- a/cpp/libjoynrclustercontroller/include/joynr/LocalCapabilitiesDirectoryStore.h
+++ b/cpp/libjoynrclustercontroller/include/joynr/LocalCapabilitiesDirectoryStore.h
@@ -28,6 +28,8 @@
#include "joynr/InterfaceAddress.h"
#include "joynr/Logger.h"
+#include "joynr/system/RoutingTypes/Address.h"
+#include "joynr/types/DiscoveryEntryWithMetaInfo.h"
#include "joynr/types/DiscoveryScope.h"
namespace joynr
@@ -68,8 +70,6 @@ class LocalCapabilitiesDirectoryStore
std::vector getCachedGlobalDiscoveryEntries() const;
- std::size_t countGlobalCapabilities() const;
-
virtual bool getLocalAndCachedCapabilities(
const std::vector& interfaceAddress,
const joynr::types::DiscoveryQos& discoveryQos,
@@ -86,12 +86,21 @@ class LocalCapabilitiesDirectoryStore
*/
void clear();
- virtual void insertInLocalCapabilitiesStorage(
+ void insertRemoteEntriesIntoGlobalCache(
const types::DiscoveryEntry& entry,
- bool awaitGlobalRegistration,
- const std::vector& gbids = std::vector());
- virtual void insertInGlobalLookupCache(const types::DiscoveryEntry& entry,
- const std::vector& gbids);
+ const std::shared_ptr& address,
+ const std::vector& knownGbids);
+
+ boost::optional lookupGlobalEntry(const std::string& participantId);
+
+ boost::optional lookupLocalEntry(const std::string& participantId);
+
+ void removeLocallyRegisteredParticipant(
+ const std::string& participantId,
+ const std::unique_lock& cacheLock);
+
+ void removeParticipant(const std::string& participantId,
+ const std::unique_lock& cacheLock);
virtual std::vector getGbidsForParticipantId(
const std::string& participantId,
@@ -101,22 +110,61 @@ class LocalCapabilitiesDirectoryStore
const types::DiscoveryScope::Enum& scope = types::DiscoveryScope::LOCAL_THEN_GLOBAL);
std::recursive_mutex& getCacheLock();
- virtual void eraseParticipantIdToGbidMapping(
+
+ virtual bool getAwaitGlobalRegistration(
const std::string& participantId,
const std::unique_lock& cacheLock);
- virtual void eraseParticipantIdToAwaitGlobalRegistrationMapping(
- const std::string& participantId,
+
+ std::vector touchAndReturnGlobalParticipantIdsFromLocalCapabilities(
+ const std::unique_lock& cacheLock,
+ const std::int64_t& newLastSeenDateMs,
+ const std::int64_t& newExpiryDateMs);
+
+ void touchSelectedGlobalParticipant(const std::unique_lock& cacheLock,
+ const std::vector& participantIds,
+ const std::int64_t& newLastSeenDateMs,
+ const std::int64_t& newExpiryDateMs);
+
+ void insertIntoLocallyRegisteredCapabilities(
+ const std::unique_lock& cacheLock,
+ const joynr::types::DiscoveryEntry& capability,
+ std::vector gbids = {});
+
+ void insertIntoGlobalCachedCapabilities(const std::unique_lock& cacheLock,
+ const joynr::types::DiscoveryEntry& capability);
+
+ std::vector removeExpiredCapabilitiesFromGlobalCache(
const std::unique_lock& cacheLock);
- virtual std::shared_ptr getGlobalLookupCache(
+
+ std::vector removeExpiredLocallyRegisteredCapabilities(
const std::unique_lock& cacheLock);
- virtual std::shared_ptr getLocallyRegisteredCapabilities(
+
+ std::size_t getLocallyRegisteredCapabilitiesCount(
const std::unique_lock& cacheLock);
- virtual bool getAwaitGlobalRegistration(
+ std::size_t getGlobalCachedCapabilitiesCount(
+ const std::unique_lock& cacheLock);
+
+ std::vector insertLocallyRegisteredCapabilitesToEntryList(
+ const std::unique_lock& cacheLock,
+ const std::int64_t& currentTime,
+ const std::int64_t& newExpiryDateMs);
+
+ virtual void insertInLocalCapabilitiesStorage(
+ const types::DiscoveryEntry& entry,
+ bool awaitGlobalRegistration,
+ const std::vector& gbids = std::vector());
+ virtual void insertInGlobalLookupCache(const types::DiscoveryEntry& entry,
+ const std::vector& gbids);
+ std::size_t countGlobalCapabilities() const;
+ virtual void eraseParticipantIdToGbidMapping(
const std::string& participantId,
const std::unique_lock& cacheLock);
private:
+ virtual void eraseParticipantIdToAwaitGlobalRegistrationMapping(
+ const std::string& participantId,
+ const std::unique_lock& cacheLock);
boost::optional searchLocal(const std::string& participantId,
const types::DiscoveryScope::Enum& scope);
@@ -128,15 +176,46 @@ class LocalCapabilitiesDirectoryStore
const std::vector& interfaceAddress,
const std::vector& gbids,
std::chrono::milliseconds maxCacheAge);
- bool callReceiverIfPossible(
- joynr::types::DiscoveryScope::Enum& scope,
- const std::vector& localCapabilities,
- const std::vector& globallyCachedCapabilities,
+
+ bool areMissingDomains(const std::vector& interfaceAddresses,
+ const std::vector& localCapabilities,
+ const std::vector& globallyCachedEntries);
+
+ bool areMissingDomains(const joynr::types::DiscoveryScope::Enum& scope,
+ const std::string& participantId,
+ const std::vector& localCapabilities,
+ const std::vector& globallyCachedEntries);
+
+ bool collectCapabilities(joynr::types::DiscoveryScope::Enum& scope,
+ const std::vector& localCapabilities,
+ const std::vector& globallyCachedEntries,
+ std::shared_ptr callback);
+
+ bool getLocalCapabilities(const std::vector& localCapabilities,
+ std::shared_ptr callback);
+
+ bool getLocalThenGlobalCapabilities(
+ const std::vector& localCapabilities,
+ const std::vector& globallyCachedCapabilities,
+ std::shared_ptr callback);
+
+ bool getLocalAndGlobalCapabilities(
+ const std::vector& localCapabilities,
+ const std::vector& globallyCachedCapabilities,
std::shared_ptr callback);
+ bool getGlobalCapabilities(const std::vector& localCapabilities,
+ const std::vector& globallyCachedCapabilities,
+ std::shared_ptr callback);
+
void mapGbidsToGlobalProviderParticipantId(const std::string& participantId,
std::vector& allGbids);
+ virtual std::shared_ptr getGlobalLookupCache(
+ const std::unique_lock& cacheLock);
+ virtual std::shared_ptr getLocallyRegisteredCapabilities(
+ const std::unique_lock& cacheLock);
+
const std::unordered_set _includeLocalScopes{
types::DiscoveryScope::LOCAL_ONLY, types::DiscoveryScope::LOCAL_AND_GLOBAL,
types::DiscoveryScope::LOCAL_THEN_GLOBAL};
diff --git a/cpp/libjoynrclustercontroller/mqtt/MosquittoConnection.cpp b/cpp/libjoynrclustercontroller/mqtt/MosquittoConnection.cpp
index 2e505d5c5d..1bddfcd47f 100644
--- a/cpp/libjoynrclustercontroller/mqtt/MosquittoConnection.cpp
+++ b/cpp/libjoynrclustercontroller/mqtt/MosquittoConnection.cpp
@@ -47,7 +47,8 @@ MosquittoConnection::MosquittoConnection(const ClusterControllerSettings& ccSett
std::chrono::seconds mqttReconnectMaxDelayTimeSeconds,
bool isMqttExponentialBackoffEnabled,
const std::string& clientId,
- const std::string& gbid)
+ const std::string& gbid,
+ bool isMqttRetain)
: _brokerUrl(brokerUrl),
_mqttKeepAliveTimeSeconds(mqttKeepAliveTimeSeconds),
_mqttReconnectDelayTimeSeconds(mqttReconnectDelayTimeSeconds),
@@ -55,6 +56,7 @@ MosquittoConnection::MosquittoConnection(const ClusterControllerSettings& ccSett
_isMqttExponentialBackoffEnabled(isMqttExponentialBackoffEnabled),
_host(brokerUrl.getBrokerBaseUrl().getHost()),
_port(brokerUrl.getBrokerBaseUrl().getPort()),
+ _mqttRetain(isMqttRetain),
_channelId(),
_subscribeChannelMid(),
_topic(),
diff --git a/cpp/libjoynrclustercontroller/mqtt/MosquittoConnection.h b/cpp/libjoynrclustercontroller/mqtt/MosquittoConnection.h
index ad49ce2880..2abea1bcf2 100644
--- a/cpp/libjoynrclustercontroller/mqtt/MosquittoConnection.h
+++ b/cpp/libjoynrclustercontroller/mqtt/MosquittoConnection.h
@@ -65,7 +65,8 @@ class MosquittoConnection
std::chrono::seconds mqttReconnectMaxDelayTimeSeconds,
bool isMqttExponentialBackoffEnabled,
const std::string& clientId,
- const std::string& gbid);
+ const std::string& gbid,
+ bool isMqttRetain);
virtual ~MosquittoConnection();
@@ -162,7 +163,7 @@ class MosquittoConnection
const std::uint16_t _port;
const std::uint16_t _mqttQos = 1;
- const bool _mqttRetain = false;
+ const bool _mqttRetain;
std::string _channelId;
int _subscribeChannelMid;
diff --git a/cpp/libjoynrclustercontroller/resources/default-messaging.settings b/cpp/libjoynrclustercontroller/resources/default-messaging.settings
index 080ffb4eff..7aefa9d084 100644
--- a/cpp/libjoynrclustercontroller/resources/default-messaging.settings
+++ b/cpp/libjoynrclustercontroller/resources/default-messaging.settings
@@ -29,6 +29,8 @@ mqtt-keep-alive-time-seconds=60
mqtt-reconnect-delay-time-seconds=1
# Maximum time in milliseconds to wait for network activity before timing out.
mqtt-connection-timeout-ms=1000
+# If true, mqtt broker will return the last published message upon subscription.
+mqtt-retain=false
send-msg-retry-interval=500
persistence-file=joynr.settings
diff --git a/cpp/pom.xml b/cpp/pom.xml
index 39761ecd0c..08afa227f0 100644
--- a/cpp/pom.xml
+++ b/cpp/pom.xml
@@ -25,7 +25,7 @@
io.joynr
dependency-lock
- 1.24.0
+ 1.25.0
../dependency-lock/pom.xml
diff --git a/cpp/runtimes/cluster-controller-runtime/JoynrClusterControllerRuntime.cpp b/cpp/runtimes/cluster-controller-runtime/JoynrClusterControllerRuntime.cpp
index 60f41323f9..bb00e5daed 100644
--- a/cpp/runtimes/cluster-controller-runtime/JoynrClusterControllerRuntime.cpp
+++ b/cpp/runtimes/cluster-controller-runtime/JoynrClusterControllerRuntime.cpp
@@ -55,7 +55,6 @@
#include "joynr/MessageSender.h"
#include "joynr/MessagingQos.h"
#include "joynr/MessagingSettings.h"
-#include "joynr/MessagingStubFactory.h"
#include "joynr/MqttMessagingSkeleton.h"
#include "joynr/MqttMulticastAddressCalculator.h"
#include "joynr/MqttReceiver.h"
@@ -130,6 +129,7 @@ JoynrClusterControllerRuntime::JoynrClusterControllerRuntime(
_messageSender(),
_localCapabilitiesDirectory(nullptr),
_libJoynrMessagingSkeleton(nullptr),
+ _messagingStubFactory(nullptr),
_mqttMessagingSkeletonFactory(std::move(mqttMessagingSkeletonFactory)),
_settings(std::move(settings)),
_libjoynrSettings(*(this->_settings)),
@@ -270,8 +270,8 @@ void JoynrClusterControllerRuntime::init()
std::unique_ptr securityManager =
std::make_unique();
- auto messagingStubFactory = std::make_shared();
- messagingStubFactory->registerStubFactory(std::make_shared());
+ _messagingStubFactory = std::make_shared();
+ _messagingStubFactory->registerStubFactory(std::make_shared());
MessagingPropertiesPersistence persist(
_messagingSettings.getMessagingPropertiesPersistenceFilename());
@@ -297,6 +297,7 @@ void JoynrClusterControllerRuntime::init()
_messagingSettings.getMqttExponentialBackoffEnabled();
std::chrono::seconds mqttKeepAliveTimeSeconds(0);
BrokerUrl brokerUrl = defaultBrokerUrl;
+ const bool isRetained{_messagingSettings.getMqttRetain()};
// default brokerIndex = 0
for (std::uint8_t brokerIndex = 0; brokerIndex < _mqttConnectionDataVector.size();
@@ -321,7 +322,8 @@ void JoynrClusterControllerRuntime::init()
mqttReconnectMaxDelayTimeSeconds,
isMqttExponentialBackoffEnabled,
mqttClientId,
- _availableGbids[brokerIndex]);
+ _availableGbids[brokerIndex],
+ isRetained);
const auto& connectionData = _mqttConnectionDataVector[brokerIndex];
@@ -381,7 +383,7 @@ void JoynrClusterControllerRuntime::init()
_ccMessageRouter = std::make_shared(
_messagingSettings,
_clusterControllerSettings,
- messagingStubFactory,
+ _messagingStubFactory,
_multicastMessagingSkeletonDirectory,
std::move(securityManager),
_singleThreadedIOService->getIOService(),
@@ -419,34 +421,38 @@ void JoynrClusterControllerRuntime::init()
// setup CC WebSocket interface
_wsMessagingStubFactory = std::make_shared();
_wsMessagingStubFactory->registerOnMessagingStubClosedCallback(
- [messagingStubFactory,
+ [messagingStubFactoryWeakPtr = joynr::util::as_weak_ptr(_messagingStubFactory),
ccMessageRouterWeakPtr = joynr::util::as_weak_ptr(_ccMessageRouter)](
const std::shared_ptr&
destinationAddress) {
if (auto ccMessageRouterSharedPtr = ccMessageRouterWeakPtr.lock()) {
ccMessageRouterSharedPtr->removeRoutingEntries(destinationAddress);
}
- messagingStubFactory->remove(destinationAddress);
+ if (auto messagingStubFactorySharedPtr = messagingStubFactoryWeakPtr.lock()) {
+ messagingStubFactorySharedPtr->remove(destinationAddress);
+ }
});
- messagingStubFactory->registerStubFactory(_wsMessagingStubFactory);
+ _messagingStubFactory->registerStubFactory(_wsMessagingStubFactory);
}
if (_clusterControllerSettings.isUdsEnabled()) {
// setup CC Uds interface
_udsMessagingStubFactory = std::make_unique();
_udsMessagingStubFactory->registerOnMessagingStubClosedCallback(
- [messagingStubFactory,
+ [messagingStubFactoryWeakPtr = joynr::util::as_weak_ptr(_messagingStubFactory),
ccMessageRouterWeakPtr = joynr::util::as_weak_ptr(_ccMessageRouter)](
const std::shared_ptr&
destinationAddress) {
if (auto ccMessageRouterSharedPtr = ccMessageRouterWeakPtr.lock()) {
ccMessageRouterSharedPtr->removeRoutingEntries(destinationAddress);
}
- messagingStubFactory->remove(destinationAddress);
+ if (auto messagingStubFactorySharedPtr = messagingStubFactoryWeakPtr.lock()) {
+ messagingStubFactorySharedPtr->remove(destinationAddress);
+ }
});
- messagingStubFactory->registerStubFactory(_udsMessagingStubFactory);
+ _messagingStubFactory->registerStubFactory(_udsMessagingStubFactory);
}
/* LibJoynr */
@@ -515,7 +521,7 @@ void JoynrClusterControllerRuntime::init()
connectionData->setMqttMessageSender(std::move(mqttMessageSender));
}
- messagingStubFactory->registerStubFactory(std::make_shared(
+ _messagingStubFactory->registerStubFactory(std::make_shared(
connectionData->getMqttMessageSender(), _availableGbids[brokerIndex]));
}
}
@@ -916,6 +922,11 @@ void JoynrClusterControllerRuntime::shutdown()
_joynrDispatcher.reset();
}
+ if (_messagingStubFactory) {
+ _messagingStubFactory->shutdown();
+ _messagingStubFactory.reset();
+ }
+
_removeStaleTimer.cancel();
}
diff --git a/cpp/runtimes/cluster-controller-runtime/include/joynr/JoynrClusterControllerRuntime.h b/cpp/runtimes/cluster-controller-runtime/include/joynr/JoynrClusterControllerRuntime.h
index fce7f33a3e..f5cf4e61cf 100644
--- a/cpp/runtimes/cluster-controller-runtime/include/joynr/JoynrClusterControllerRuntime.h
+++ b/cpp/runtimes/cluster-controller-runtime/include/joynr/JoynrClusterControllerRuntime.h
@@ -37,6 +37,7 @@
#include "joynr/JoynrRuntime.h"
#include "joynr/LibjoynrSettings.h"
#include "joynr/Logger.h"
+#include "joynr/MessagingStubFactory.h"
#include "joynr/ParticipantIdStorage.h"
#include "joynr/PrivateCopyAssign.h"
#include "joynr/Semaphore.h"
@@ -155,6 +156,7 @@ class JOYNRCLUSTERCONTROLLERRUNTIME_EXPORT JoynrClusterControllerRuntime
std::shared_ptr _localCapabilitiesDirectory;
std::shared_ptr _libJoynrMessagingSkeleton;
+ std::shared_ptr _messagingStubFactory;
MqttMessagingSkeletonFactory _mqttMessagingSkeletonFactory;
diff --git a/cpp/runtimes/libjoynr-runtime/LibJoynrRuntime.cpp b/cpp/runtimes/libjoynr-runtime/LibJoynrRuntime.cpp
index c15f816110..fdcd20ea12 100644
--- a/cpp/runtimes/libjoynr-runtime/LibJoynrRuntime.cpp
+++ b/cpp/runtimes/libjoynr-runtime/LibJoynrRuntime.cpp
@@ -43,7 +43,6 @@
#include "joynr/MessageSender.h"
#include "joynr/MessagingQos.h"
#include "joynr/MessagingSettings.h"
-#include "joynr/MessagingStubFactory.h"
#include "joynr/ParticipantIdStorage.h"
#include "joynr/ProxyFactory.h"
#include "joynr/PublicationManager.h"
@@ -79,6 +78,7 @@ LibJoynrRuntime::LibJoynrRuntime(
: JoynrRuntimeImpl(*settings, std::move(onFatalRuntimeError), std::move(keyChain)),
_subscriptionManager(nullptr),
_messageSender(nullptr),
+ _messagingStubFactory(nullptr),
_joynrDispatcher(nullptr),
_settings(std::move(settings)),
_libjoynrSettings(new LibjoynrSettings(*this->_settings)),
@@ -137,6 +137,10 @@ void LibJoynrRuntime::shutdown()
if (_libJoynrMessageRouter) {
_libJoynrMessageRouter->shutdown();
}
+ if (_messagingStubFactory) {
+ _messagingStubFactory->shutdown();
+ _messagingStubFactory.reset();
+ }
}
void LibJoynrRuntime::init(
@@ -148,14 +152,13 @@ void LibJoynrRuntime::init(
std::function onError)
{
// create messaging stub factory
- auto messagingStubFactory = std::make_shared();
+ _messagingStubFactory = std::make_shared();
middlewareMessagingStubFactory->registerOnMessagingStubClosedCallback(
- [messagingStubFactory](std::shared_ptr
- destinationAddress) {
- messagingStubFactory->remove(std::move(destinationAddress));
+ [this](std::shared_ptr destinationAddress) {
+ _messagingStubFactory->remove(std::move(destinationAddress));
});
- messagingStubFactory->registerStubFactory(middlewareMessagingStubFactory);
- messagingStubFactory->registerStubFactory(std::make_shared());
+ _messagingStubFactory->registerStubFactory(middlewareMessagingStubFactory);
+ _messagingStubFactory->registerStubFactory(std::make_shared());
std::string routingProviderParticipantId =
_systemServicesSettings.getCcRoutingProviderParticipantId();
@@ -163,7 +166,7 @@ void LibJoynrRuntime::init(
_libJoynrMessageRouter = std::make_shared(
_messagingSettings,
libjoynrMessagingAddress,
- std::move(messagingStubFactory),
+ _messagingStubFactory,
_singleThreadedIOService->getIOService(),
std::move(addressCalculator),
std::vector>{},
diff --git a/cpp/runtimes/libjoynr-runtime/LibJoynrRuntime.h b/cpp/runtimes/libjoynr-runtime/LibJoynrRuntime.h
index b1a4e0e59f..bcca8d362f 100644
--- a/cpp/runtimes/libjoynr-runtime/LibJoynrRuntime.h
+++ b/cpp/runtimes/libjoynr-runtime/LibJoynrRuntime.h
@@ -26,6 +26,7 @@
#include "joynr/JoynrRuntimeImpl.h"
#include "joynr/Logger.h"
+#include "joynr/MessagingStubFactory.h"
#include "joynr/PrivateCopyAssign.h"
namespace joynr
@@ -70,6 +71,7 @@ class LibJoynrRuntime : public JoynrRuntimeImpl
std::shared_ptr _subscriptionManager;
std::shared_ptr _messageSender;
+ std::shared_ptr _messagingStubFactory;
std::shared_ptr _joynrDispatcher;
std::shared_ptr _ccRoutingProxy;
diff --git a/cpp/tests/integration-tests/JoynrClusterControllerRuntimeTest.cpp b/cpp/tests/integration-tests/JoynrClusterControllerRuntimeTest.cpp
index 0800e061d8..dab59af3be 100644
--- a/cpp/tests/integration-tests/JoynrClusterControllerRuntimeTest.cpp
+++ b/cpp/tests/integration-tests/JoynrClusterControllerRuntimeTest.cpp
@@ -122,7 +122,8 @@ class JoynrClusterControllerRuntimeTest : public ::testing::Test
std::chrono::seconds(1),
false,
"testClientId",
- gbid)),
+ gbid,
+ false)),
semaphore(std::make_shared(0)),
globalMqttTopic("mqtt_JoynrClusterControllerRuntimeTest.topic"),
globalMqttBrokerUrl("mqtt_JoynrClusterControllerRuntimeTest.brokerUrl"),
diff --git a/cpp/tests/mock/MockLocalCapabilitiesDirectoryStore.h b/cpp/tests/mock/MockLocalCapabilitiesDirectoryStore.h
index beab0f943b..fa8169cb2c 100644
--- a/cpp/tests/mock/MockLocalCapabilitiesDirectoryStore.h
+++ b/cpp/tests/mock/MockLocalCapabilitiesDirectoryStore.h
@@ -73,18 +73,14 @@ class MockLocalCapabilitiesDirectoryStore : public joynr::LocalCapabilitiesDirec
std::shared_ptr getGlobalLookupCache(
const std::unique_lock& cacheLock) override
{
- if (_globalLookupCache) {
- return _globalLookupCache;
- }
- return joynr::LocalCapabilitiesDirectoryStore::getGlobalLookupCache(cacheLock);
+ std::ignore = cacheLock;
+ return _globalLookupCache;
}
std::shared_ptr getLocallyRegisteredCapabilities(
const std::unique_lock& cacheLock) override
{
- if (_locallyRegisteredCapabilities) {
- return _locallyRegisteredCapabilities;
- }
- return joynr::LocalCapabilitiesDirectoryStore::getLocallyRegisteredCapabilities(cacheLock);
+ std::ignore = cacheLock;
+ return _locallyRegisteredCapabilities;
}
private:
diff --git a/cpp/tests/mock/MockMosquittoConnection.h b/cpp/tests/mock/MockMosquittoConnection.h
index bf4151128a..a2c9f4738a 100644
--- a/cpp/tests/mock/MockMosquittoConnection.h
+++ b/cpp/tests/mock/MockMosquittoConnection.h
@@ -35,7 +35,8 @@ class MockMosquittoConnection : public joynr::MosquittoConnection
std::chrono::seconds mqttReconnectMaxDelayTimeSeconds,
bool isMqttExponentialBackoffEnabled,
const std::string& clientId,
- const std::string& gbid)
+ const std::string& gbid,
+ const bool isMqttRetain)
: MosquittoConnection(ccSettings,
brokerUrl,
mqttKeepAliveTimeSeconds,
@@ -43,7 +44,8 @@ class MockMosquittoConnection : public joynr::MosquittoConnection
mqttReconnectMaxDelayTimeSeconds,
isMqttExponentialBackoffEnabled,
clientId,
- gbid)
+ gbid,
+ isMqttRetain)
{
}
diff --git a/cpp/tests/mock/MockProvider.h b/cpp/tests/mock/MockProvider.h
index 5d6b26d153..76879887c6 100644
--- a/cpp/tests/mock/MockProvider.h
+++ b/cpp/tests/mock/MockProvider.h
@@ -36,6 +36,10 @@ class MockProvider : public joynr::AbstractJoynrProvider
static const std::int32_t MINOR_VERSION;
MOCK_CONST_METHOD0(getProviderQos, joynr::types::ProviderQos());
MOCK_CONST_METHOD0(getParticipantId, std::string());
+ MOCK_METHOD1(registerBroadcastListener,
+ void(std::shared_ptr));
+ MOCK_METHOD1(unregisterBroadcastListener,
+ void(std::shared_ptr));
~MockProvider() override = default;
const std::string& getInterfaceName() const override;
static const std::string& INTERFACE_NAME();
diff --git a/cpp/tests/pom.xml b/cpp/tests/pom.xml
index f000c13a68..e74984730b 100644
--- a/cpp/tests/pom.xml
+++ b/cpp/tests/pom.xml
@@ -26,7 +26,7 @@
io.joynr
cpp
- 1.24.0
+ 1.25.0
../pom.xml
diff --git a/cpp/tests/unit-tests/AbstractSyncAsyncTest.cpp b/cpp/tests/unit-tests/AbstractSyncAsyncTest.cpp
index bb1e6519e2..9cf48c448e 100644
--- a/cpp/tests/unit-tests/AbstractSyncAsyncTest.cpp
+++ b/cpp/tests/unit-tests/AbstractSyncAsyncTest.cpp
@@ -903,15 +903,15 @@ class AbstractSyncAsyncTest : public ::testing::Test
void testSubscribeToAttribute()
{
- // EXPECT_CALL(*mockMessageSender,
- // sendSubscriptionRequest(_,_,_,_)).Times(1);
+ EXPECT_CALL(*mockMessageSender,
+ sendSubscriptionRequest(_,_,_,_,_)).Times(1);
std::shared_ptr>
subscriptionListener(new MockGpsSubscriptionListener());
- // TODO uncomment once the connector has the correct signature!
- // std::shared_ptr gpsFixture = createFixture(false);
- // SubscriptionQos subscriptionQos(100, 200, true, 80, 80);
- // gpsFixture->subscribeToLocation(subscriptionListener, subscriptionQos);
+ auto testFixture{createItestSubscriptionFixture()};
+ std::shared_ptr subscriptionQos{std::make_shared()};
+ const std::string subscriptionId{"subscriptionId"};
+ testFixture->subscribeToLocation(subscriptionListener, subscriptionQos, subscriptionId);
}
void doNotSendSubscriptionStopForMulticastSubscription()
diff --git a/cpp/tests/unit-tests/ArbitratorTest.cpp b/cpp/tests/unit-tests/ArbitratorTest.cpp
index be705e2656..ba9443b145 100644
--- a/cpp/tests/unit-tests/ArbitratorTest.cpp
+++ b/cpp/tests/unit-tests/ArbitratorTest.cpp
@@ -175,7 +175,7 @@ TEST_F(ArbitratorTest, arbitrationTimeout_callsOnErrorIfNoRetryIsPossible)
_mockDiscovery,
discoveryQos,
_emptyGbidsVector,
- move(_lastSeenArbitrationStrategyFunction));
+ std::move(_lastSeenArbitrationStrategyFunction));
auto onSuccess = [](const ArbitrationResult&) { FAIL(); };
@@ -340,7 +340,7 @@ TEST_F(ArbitratorTest, arbitrationStrategy_highestPriority_selectsCorrectProvide
_mockDiscovery,
discoveryQos,
_emptyGbidsVector,
- move(_qosArbitrationStrategyFunction));
+ std::move(_qosArbitrationStrategyFunction));
// Check that the correct participant was selected
auto onSuccess = [this, &participantIds](const ArbitrationResult& arbitrationResult) {
@@ -414,7 +414,7 @@ TEST_F(ArbitratorTest, arbitrationStrategy_highestPriority_checksVersion)
_mockDiscovery,
discoveryQos,
_emptyGbidsVector,
- move(_qosArbitrationStrategyFunction));
+ std::move(_qosArbitrationStrategyFunction));
// Check that one of the expected participant was selected
auto onSuccess = [this, &expectedParticipantIds](const ArbitrationResult& arbitrationResult) {
@@ -491,7 +491,7 @@ TEST_F(ArbitratorTest, arbitrationStrategy_highestPriority_checksOnChange)
_mockDiscovery,
discoveryQos,
_emptyGbidsVector,
- move(_qosArbitrationStrategyFunction));
+ std::move(_qosArbitrationStrategyFunction));
// Check that the correct participant was selected
auto onSuccess = [this, &expectedParticipantId](const ArbitrationResult& arbitrationResult) {
@@ -580,7 +580,7 @@ TEST_F(ArbitratorTest, arbitrationStrategy_keyword_selectsCorrectProvider)
_mockDiscovery,
discoveryQos,
_emptyGbidsVector,
- move(_keywordArbitrationStrategyFunction));
+ std::move(_keywordArbitrationStrategyFunction));
// Check that the correct participant was selected
auto onSuccess = [this, &expectedParticipantId](const ArbitrationResult& arbitrationResult) {
@@ -659,7 +659,7 @@ TEST_F(ArbitratorTest, arbitrationStrategy_keyword_checksVersion)
_mockDiscovery,
discoveryQos,
_emptyGbidsVector,
- move(_keywordArbitrationStrategyFunction));
+ std::move(_keywordArbitrationStrategyFunction));
// Check that the correct participant was selected
auto onSuccess = [this, &expectedParticipantIds](const ArbitrationResult& arbitrationResult) {
@@ -711,7 +711,7 @@ TEST_F(ArbitratorTest, allowFourRetries_expectFiveDiscoveryAttempts)
_mockDiscovery,
discoveryQos,
_emptyGbidsVector,
- move(_lastSeenArbitrationStrategyFunction));
+ std::move(_lastSeenArbitrationStrategyFunction));
auto onSuccess = [](const ArbitrationResult& arbitrationResult) {
types::DiscoveryEntryWithMetaInfo result = arbitrationResult.getDiscoveryEntries().front();
@@ -830,7 +830,7 @@ TEST_F(ArbitratorTest, getHighestPriorityReturnsNoCompatibleProviderFoundExcepti
_mockDiscovery,
discoveryQos,
_emptyGbidsVector,
- move(_qosArbitrationStrategyFunction));
+ std::move(_qosArbitrationStrategyFunction));
std::unordered_set expectedVersions;
expectedVersions.insert(providerVersions2.begin(), providerVersions2.end());
@@ -929,7 +929,7 @@ TEST_F(ArbitratorTest, getKeywordProviderReturnsNoCompatibleProviderFoundExcepti
_mockDiscovery,
discoveryQos,
_emptyGbidsVector,
- move(_keywordArbitrationStrategyFunction));
+ std::move(_keywordArbitrationStrategyFunction));
std::unordered_set expectedVersions;
expectedVersions.insert(providerVersions2.begin(), providerVersions2.end());
@@ -1010,7 +1010,7 @@ TEST_F(ArbitratorTest, getFixedParticipantProviderReturnsNoCompatibleProviderFou
_mockDiscovery,
discoveryQos,
_emptyGbidsVector,
- move(_fixedParticipantArbitrationStrategyFunction));
+ std::move(_fixedParticipantArbitrationStrategyFunction));
std::unordered_set expectedVersions;
expectedVersions.insert(providerVersion2);
@@ -1105,7 +1105,7 @@ TEST_F(ArbitratorTest, getDefaultReturnsNoCompatibleProviderFoundException)
_mockDiscovery,
discoveryQos,
_emptyGbidsVector,
- move(_lastSeenArbitrationStrategyFunction));
+ std::move(_lastSeenArbitrationStrategyFunction));
std::unordered_set expectedVersions;
expectedVersions.insert(providerVersions2.begin(), providerVersions2.end());
@@ -1316,7 +1316,7 @@ TEST_F(ArbitratorTest, filterByVersionAndArbitrationStrategy_disabled_versionAnd
_mockDiscovery,
discoveryQos,
_emptyGbidsVector,
- move(_lastSeenArbitrationStrategyFunction));
+ std::move(_lastSeenArbitrationStrategyFunction));
// Check that the correct participant was selected
auto onSuccess = [this, &discoveryEntries, &discoveryEntry1, &discoveryEntry2](
@@ -2025,7 +2025,7 @@ TEST_P(ArbitratorTestWithParams, discoveryException_emptyResult)
_mockDiscovery,
discoveryQos,
_emptyGbidsVector,
- move(_qosArbitrationStrategyFunction));
+ std::move(_qosArbitrationStrategyFunction));
arbitrator->startArbitration(onSuccess, onError);
EXPECT_TRUE(_semaphore->waitFor(
@@ -2081,7 +2081,7 @@ void ArbitratorTest::testArbitrationStopsOnShutdown(bool testRetry)
_mockDiscovery,
discoveryQos,
_emptyGbidsVector,
- move(_lastSeenArbitrationStrategyFunction));
+ std::move(_lastSeenArbitrationStrategyFunction));
auto onSuccess = [](const ArbitrationResult& arbitrationResult) {
types::DiscoveryEntryWithMetaInfo result = arbitrationResult.getDiscoveryEntries().front();
diff --git a/cpp/tests/unit-tests/CapabilitiesRegistrarTest.cpp b/cpp/tests/unit-tests/CapabilitiesRegistrarTest.cpp
index 50dfc0f44c..b0a2b00419 100644
--- a/cpp/tests/unit-tests/CapabilitiesRegistrarTest.cpp
+++ b/cpp/tests/unit-tests/CapabilitiesRegistrarTest.cpp
@@ -42,6 +42,7 @@
#include "tests/mock/MockProvider.h"
using ::testing::_;
+using ::testing::A;
using ::testing::DoAll;
using ::testing::Eq;
using ::testing::InSequence;
@@ -151,6 +152,8 @@ TEST_F(CapabilitiesRegistrarTest, add)
InvokeArgument<3>(),
Return(mockFuture)));
+ EXPECT_CALL(*_mockProvider, registerBroadcastListener(_)).Times(1);
+
Future future;
auto onSuccess = [&future]() { future.onSuccess(); };
auto onError = [&future](const exceptions::JoynrRuntimeException& exception) {
@@ -165,6 +168,116 @@ TEST_F(CapabilitiesRegistrarTest, add)
EXPECT_EQ(capturedGbids.size(), 0);
}
+TEST_F(CapabilitiesRegistrarTest, removeBroadcastListenerIfDiscoveryAddFails)
+{
+
+ types::ProviderQos testQos;
+ testQos.setPriority(100);
+ EXPECT_CALL(*_mockParticipantIdStorage,
+ getProviderParticipantId(
+ _domain, MockProvider::INTERFACE_NAME(), MockProvider::MAJOR_VERSION))
+ .Times(1)
+ .WillOnce(Return(_expectedParticipantId));
+ std::shared_ptr multicastBroadcastListener[2];
+ EXPECT_CALL(*_mockProvider, registerBroadcastListener(_))
+ .Times(1)
+ .WillOnce(::testing::SaveArg<0>(&multicastBroadcastListener[0]));
+
+ auto mockFuture = std::make_shared>();
+ mockFuture->onSuccess();
+
+ EXPECT_CALL(*_mockDiscovery,
+ addAsyncMock(AllOf(Property(&joynr::types::DiscoveryEntry::getDomain, Eq(_domain)),
+ Property(&joynr::types::DiscoveryEntry::getInterfaceName,
+ Eq(MockProvider::INTERFACE_NAME())),
+ Property(&joynr::types::DiscoveryEntry::getParticipantId,
+ Eq(_expectedParticipantId)),
+ Property(&joynr::types::DiscoveryEntry::getQos, Eq(testQos)),
+ Property(&joynr::types::DiscoveryEntry::getProviderVersion,
+ Eq(_expectedProviderVersion))),
+ _,
+ _,
+ _,
+ _,
+ _,
+ _))
+ .WillOnce(
+ DoAll(InvokeArgument<5>(joynr::exceptions::JoynrRuntimeException("TestError")),
+ Return(mockFuture)));
+
+ EXPECT_CALL(*_mockProvider,
+ unregisterBroadcastListener(A>()))
+ .Times(1)
+ .WillOnce(::testing::SaveArg<0>(&multicastBroadcastListener[1]));
+
+ Future future;
+ auto onSuccess = [&future]() { future.onSuccess(); };
+ auto onError = [&future](const exceptions::JoynrRuntimeException& exception) {
+ future.onError(std::make_shared(exception));
+ };
+
+ _capabilitiesRegistrar->addAsync(_domain, _mockProvider, testQos, onSuccess, onError);
+ EXPECT_THROW(
+ {
+ try {
+ future.get();
+ } catch (exceptions::JoynrRuntimeException& e) {
+ EXPECT_STREQ("TestError", e.what());
+ EXPECT_NE(nullptr, multicastBroadcastListener[1].get());
+ EXPECT_EQ(multicastBroadcastListener[1], multicastBroadcastListener[0]);
+ throw;
+ }
+ },
+ exceptions::JoynrRuntimeException);
+}
+
+TEST_F(CapabilitiesRegistrarTest, removeBroadcastListenerIfAddNextHopAddFails)
+{
+
+ types::ProviderQos testQos;
+ testQos.setPriority(100);
+ EXPECT_CALL(*_mockParticipantIdStorage,
+ getProviderParticipantId(
+ _domain, MockProvider::INTERFACE_NAME(), MockProvider::MAJOR_VERSION))
+ .Times(1)
+ .WillOnce(Return(_expectedParticipantId));
+ std::shared_ptr multicastBroadcastListener[2];
+ EXPECT_CALL(*_mockProvider, registerBroadcastListener(_))
+ .Times(1)
+ .WillOnce(::testing::SaveArg<0>(&multicastBroadcastListener[0]));
+
+ auto mockFuture = std::make_shared>();
+ mockFuture->onSuccess();
+
+ EXPECT_CALL(*_mockMessageRouter, addNextHop(_, _, _, _, _, _, _))
+ .WillOnce(InvokeArgument<6>(joynr::exceptions::ProviderRuntimeException("TestError")));
+
+ EXPECT_CALL(*_mockProvider,
+ unregisterBroadcastListener(A>()))
+ .Times(1)
+ .WillOnce(::testing::SaveArg<0>(&multicastBroadcastListener[1]));
+
+ Future future;
+ auto onSuccess = [&future]() { future.onSuccess(); };
+ auto onError = [&future](const exceptions::JoynrRuntimeException& exception) {
+ future.onError(std::make_shared(exception));
+ };
+
+ _capabilitiesRegistrar->addAsync(_domain, _mockProvider, testQos, onSuccess, onError);
+ EXPECT_THROW(
+ {
+ try {
+ future.get();
+ } catch (exceptions::JoynrRuntimeException& e) {
+ EXPECT_STREQ("TestError", e.what());
+ EXPECT_NE(nullptr, multicastBroadcastListener[1].get());
+ EXPECT_EQ(multicastBroadcastListener[1], multicastBroadcastListener[0]);
+ throw;
+ }
+ },
+ exceptions::JoynrRuntimeException);
+}
+
TEST_F(CapabilitiesRegistrarTest, checkVisibilityOfGlobalAndLocalProviders)
{
diff --git a/cpp/tests/unit-tests/CcMessageRouterTest.cpp b/cpp/tests/unit-tests/CcMessageRouterTest.cpp
index baf5fe442f..8e3a8cfd7c 100644
--- a/cpp/tests/unit-tests/CcMessageRouterTest.cpp
+++ b/cpp/tests/unit-tests/CcMessageRouterTest.cpp
@@ -1009,7 +1009,6 @@ TEST_F(CcMessageRouterTest, routingTableGetsCleaned)
std::chrono::system_clock::now().time_since_epoch())
.count() +
4000;
- EXPECT_CALL(*_messagingStubFactory, shutdown()).Times(1);
_messageRouter->shutdown();
_messageRouter = createMessageRouter();
_messageRouter->addNextHop(
@@ -1252,7 +1251,6 @@ TEST_F(CcMessageRouterTest, checkSubscriptionStopToNonExistingRecipientIsQueued)
TEST_F(CcMessageRouterTest, checkReplyToNonExistingProxyIsDiscardedWhenEnabled)
{
- EXPECT_CALL(*_messagingStubFactory, shutdown()).Times(1);
_messageRouter->shutdown();
_messagingSettings.setDiscardUnroutableRepliesAndPublications(true);
_messageRouter = createMessageRouter();
@@ -1262,7 +1260,6 @@ TEST_F(CcMessageRouterTest, checkReplyToNonExistingProxyIsDiscardedWhenEnabled)
TEST_F(CcMessageRouterTest, checkSubscriptionReplyToNonExistingRecipientIsDiscardedWhenEnabled)
{
- EXPECT_CALL(*_messagingStubFactory, shutdown()).Times(1);
_messageRouter->shutdown();
_messagingSettings.setDiscardUnroutableRepliesAndPublications(true);
_messageRouter = createMessageRouter();
@@ -1272,7 +1269,6 @@ TEST_F(CcMessageRouterTest, checkSubscriptionReplyToNonExistingRecipientIsDiscar
TEST_F(CcMessageRouterTest, checkPublicationToNonExistingRecipientIsDiscardedWhenEnabled)
{
- EXPECT_CALL(*_messagingStubFactory, shutdown()).Times(1);
_messageRouter->shutdown();
_messagingSettings.setDiscardUnroutableRepliesAndPublications(true);
_messageRouter = createMessageRouter();
@@ -1374,7 +1370,6 @@ TEST_F(CcMessageRouterTest, addressValidation_globalAddressMustNotReferToOurClus
auto ownAddress =
std::make_shared("brokerUri", "ownTopic");
setOwnAddress(ownAddress);
- EXPECT_CALL(*_messagingStubFactory, shutdown()).Times(1);
_messageRouter->shutdown();
_messageRouter = createMessageRouter();
@@ -1398,7 +1393,6 @@ TEST_F(CcMessageRouterTest, addressValidation_otherAddressesOfOwnAddressTypeAreA
auto ownAddress =
std::make_shared("brokerUri", "ownTopic");
setOwnAddress(ownAddress);
- EXPECT_CALL(*_messagingStubFactory, shutdown()).Times(1);
_messageRouter->shutdown();
_messageRouter = createMessageRouter();
@@ -1432,7 +1426,6 @@ TEST_F(CcMessageRouterTest, addressValidation_otherAddressesTypesAreAddedToRouti
auto ownAddress =
std::make_shared("brokerUri", "ownTopic");
setOwnAddress(ownAddress);
- EXPECT_CALL(*_messagingStubFactory, shutdown()).Times(1);
_messageRouter->shutdown();
_messageRouter = createMessageRouter();
addressIsNotAddedToRoutingTable(ownAddress);
@@ -1939,7 +1932,6 @@ TEST_F(CcMessageRouterTest, routingTableRemoveEntriesWorksForWebsocket)
const std::string providerParticipantId2("providerParticipantId2");
const std::string providerParticipantId3("providerParticipantId3");
- EXPECT_CALL(*_messagingStubFactory, shutdown()).Times(1);
_messageRouter->shutdown();
_messageRouter = createMessageRouter();
@@ -1984,7 +1976,6 @@ TEST_F(CcMessageRouterTest, routingTableRemoveEntriesWorksForUds)
const std::string providerParticipantId2("providerParticipantId2");
const std::string providerParticipantId3("providerParticipantId3");
- EXPECT_CALL(*_messagingStubFactory, shutdown()).Times(1);
_messageRouter->shutdown();
_messageRouter = createMessageRouter();
diff --git a/cpp/tests/unit-tests/LibJoynrMessageRouterTest.cpp b/cpp/tests/unit-tests/LibJoynrMessageRouterTest.cpp
index c45cc400b5..ff10a74bbf 100644
--- a/cpp/tests/unit-tests/LibJoynrMessageRouterTest.cpp
+++ b/cpp/tests/unit-tests/LibJoynrMessageRouterTest.cpp
@@ -986,7 +986,7 @@ TEST_F(LibJoynrMessageRouterTest, invalidIncomingAddress)
EXPECT_CALL(*stubFactory, create(_)).Times(0);
EXPECT_CALL(*stubFactory, remove(_)).Times(0);
EXPECT_CALL(*stubFactory, contains(_)).Times(0);
- EXPECT_CALL(*stubFactory, shutdown()).Times(1);
+ EXPECT_CALL(*stubFactory, shutdown()).Times(0);
boost::asio::io_service ioService;
std::unique_ptr noMultiCast(nullptr);
std::vector> transportStatuses;
@@ -1026,7 +1026,7 @@ TEST_F(LibJoynrMessageRouterTest, udsIncomingAddress)
EXPECT_CALL(*stubFactory, create(_)).Times(0);
EXPECT_CALL(*stubFactory, remove(_)).Times(0);
EXPECT_CALL(*stubFactory, contains(_)).Times(0);
- EXPECT_CALL(*stubFactory, shutdown()).Times(1);
+ EXPECT_CALL(*stubFactory, shutdown()).Times(0);
boost::asio::io_service ioService;
std::unique_ptr noMultiCast(nullptr);
std::vector> transportStatuses;
diff --git a/cpp/tests/unit-tests/MessageRouterTest.h b/cpp/tests/unit-tests/MessageRouterTest.h
index 5f3ea88308..61d0f79aff 100644
--- a/cpp/tests/unit-tests/MessageRouterTest.h
+++ b/cpp/tests/unit-tests/MessageRouterTest.h
@@ -97,7 +97,6 @@ class MessageRouterTest : public ::testing::Test
if (_messageRouterWithMockedMessageQueue) {
_messageRouterWithMockedMessageQueue->shutdown();
}
- EXPECT_CALL(*_messagingStubFactory, shutdown()).Times(1);
_messageRouter->shutdown();
_singleThreadedIOService->stop();
std::remove(_settingsFileName.c_str());
diff --git a/cpp/tests/unit-tests/MessageSenderTest.cpp b/cpp/tests/unit-tests/MessageSenderTest.cpp
index dea02421e2..40c73b94f1 100644
--- a/cpp/tests/unit-tests/MessageSenderTest.cpp
+++ b/cpp/tests/unit-tests/MessageSenderTest.cpp
@@ -265,42 +265,3 @@ TEST_F(MessageSenderTest, sendPublication_normal)
messageSender.sendSubscriptionPublication(
senderID, receiverID, qosSettings, std::move(publication));
}
-
-TEST_F(MessageSenderTest, sendMulticastSubscriptionRequest)
-{
- const std::string senderParticipantId("senderParticipantId");
- const std::string receiverParticipantId("receiverParticipantId");
- const std::string subscriptionId("subscriptionId");
- MessagingQos messagingQos(1, MessagingQosEffort::Enum::BEST_EFFORT);
- auto subscriptionQos = std::make_shared();
-
- MulticastSubscriptionRequest subscriptionRequest;
- subscriptionRequest.setSubscribeToName("subscribeToName");
- subscriptionRequest.setSubscriptionId(subscriptionId);
- subscriptionRequest.setQos(subscriptionQos);
- subscriptionRequest.setMulticastId("multicastId");
-
- MutableMessage mutableMessage =
- messageFactory.createMulticastSubscriptionRequest(senderParticipantId,
- receiverParticipantId,
- messagingQos,
- subscriptionRequest,
- isLocalMessage);
-
- SubscriptionReply subscriptionReply;
- subscriptionReply.setSubscriptionId("subscriptionId");
-
- MutableMessage mutableReplyMessage = messageFactory.createSubscriptionReply(
- receiverParticipantId, senderParticipantId, messagingQos, subscriptionReply);
-
- expectRoutedMessage(
- Message::VALUE_MESSAGE_TYPE_SUBSCRIPTION_REPLY(), mutableReplyMessage.getPayload());
-
- MessageSender messageSender(mockMessageRouter, nullptr);
-
- messageSender.sendMulticastSubscriptionRequest(senderParticipantId,
- receiverParticipantId,
- messagingQos,
- subscriptionRequest,
- isLocalMessage);
-}
diff --git a/cpp/tests/unit-tests/MosquittoConnectionTest.cpp b/cpp/tests/unit-tests/MosquittoConnectionTest.cpp
index 466976ff2e..85655fd2a4 100644
--- a/cpp/tests/unit-tests/MosquittoConnectionTest.cpp
+++ b/cpp/tests/unit-tests/MosquittoConnectionTest.cpp
@@ -53,7 +53,8 @@ class MosquittoConnectionTest : public ::testing::Test
_mqttReconnectMaxDelayTimeSeconds(
_messagingSettings.getMqttReconnectMaxDelayTimeSeconds()),
_isMqttExponentialBackoffEnabled(
- _messagingSettings.getMqttExponentialBackoffEnabled())
+ _messagingSettings.getMqttExponentialBackoffEnabled()),
+ _isMqttRetain(_messagingSettings.getMqttRetain())
{
}
@@ -92,7 +93,8 @@ class MosquittoConnectionTest : public ::testing::Test
_mqttReconnectMaxDelayTimeSeconds,
_isMqttExponentialBackoffEnabled,
clientId,
- gbid);
+ gbid,
+ _isMqttRetain);
// register connection to channelId
mosquittoConnection->registerChannelId(channelId);
@@ -113,6 +115,7 @@ class MosquittoConnectionTest : public ::testing::Test
std::chrono::seconds _mqttKeepAliveTimeSeconds;
const std::chrono::seconds _mqttReconnectDelayTimeSeconds, _mqttReconnectMaxDelayTimeSeconds;
const bool _isMqttExponentialBackoffEnabled;
+ const bool _isMqttRetain;
private:
DISALLOW_COPY_AND_ASSIGN(MosquittoConnectionTest);
diff --git a/cpp/tests/unit-tests/SemaphoreTest.cpp b/cpp/tests/unit-tests/SemaphoreTest.cpp
index 8f564ca2c3..94538a3d4b 100644
--- a/cpp/tests/unit-tests/SemaphoreTest.cpp
+++ b/cpp/tests/unit-tests/SemaphoreTest.cpp
@@ -142,6 +142,6 @@ TEST(SemaphoreTest, timedWait_unlockAfterSomeTime)
const std::uint64_t diff =
(expectedUnlock > duration) ? expectedUnlock - duration : duration - expectedUnlock;
- EXPECT_GT(10, diff);
+ EXPECT_GT(20, diff);
EXPECT_TRUE(result);
}
diff --git a/cpp/tests/unit-tests/lcd/GlobalCapabilitiesDirectoryClientTest.cpp b/cpp/tests/unit-tests/lcd/GlobalCapabilitiesDirectoryClientTest.cpp
index 27f7b9b05a..8eb4831ac8 100644
--- a/cpp/tests/unit-tests/lcd/GlobalCapabilitiesDirectoryClientTest.cpp
+++ b/cpp/tests/unit-tests/lcd/GlobalCapabilitiesDirectoryClientTest.cpp
@@ -135,6 +135,7 @@ class GlobalCapabilitiesDirectoryClientTest : public TestWithParam
void testAdd(bool awaitGlobalRegistration);
void testAddTaskExpiryDateHasCorrectValue(bool awaitGlobalRegistration,
const joynr::TimePoint& expiryDate);
+ joynr::TimePoint getAddTaskExpiryDateForProviderExpirationTest(std::int64_t capExpiryDateMs);
const std::string capDomain;
const std::string capInterface;
@@ -175,18 +176,17 @@ TEST_F(GlobalCapabilitiesDirectoryClientTest,
{
std::unique_ptr> mockTaskSequencer =
std::make_unique>(std::chrono::milliseconds(60000));
- auto mockTaskSequencerRef = mockTaskSequencer.get();
-
- std::shared_ptr gcdClient =
- std::make_shared(
- clusterControllerSettings, std::move(mockTaskSequencer));
auto semaphore = std::make_shared();
MockTaskSequencer::MockTaskWithExpiryDate capturedTask;
- EXPECT_CALL(*mockTaskSequencerRef, add(_))
+ EXPECT_CALL(*mockTaskSequencer, add(_))
.Times(1)
.WillOnce(DoAll(SaveArg<0>(&capturedTask), ReleaseSemaphore(semaphore)));
+ std::shared_ptr gcdClient =
+ std::make_shared(
+ clusterControllerSettings, std::move(mockTaskSequencer));
+
bool onRuntimeErrorCalled = false;
bool exceptionMessageFound = false;
auto onRuntimeError = [&onRuntimeErrorCalled, &exceptionMessageFound](
@@ -212,16 +212,16 @@ void GlobalCapabilitiesDirectoryClientTest::testAddTaskExpiryDateHasCorrectValue
{
std::unique_ptr> mockTaskSequencer =
std::make_unique>(std::chrono::milliseconds(60000));
- auto mockTaskSequencerRef = mockTaskSequencer.get();
- std::shared_ptr gcdClient =
- std::make_shared(
- clusterControllerSettings, std::move(mockTaskSequencer));
auto semaphore = std::make_shared();
MockTaskSequencer::MockTaskWithExpiryDate capturedTask;
+ globalDiscoveryEntry.setExpiryDateMs(expectedTaskExpiryDate.toMilliseconds());
- EXPECT_CALL(*mockTaskSequencerRef, add(_))
+ EXPECT_CALL(*mockTaskSequencer, add(_))
.Times(1)
.WillOnce(DoAll(SaveArg<0>(&capturedTask), ReleaseSemaphore(semaphore)));
+ std::shared_ptr gcdClient =
+ std::make_shared(
+ clusterControllerSettings, std::move(mockTaskSequencer));
gcdClient->add(globalDiscoveryEntry,
awaitGlobalRegistration,
gbids,
@@ -257,24 +257,65 @@ TEST_F(GlobalCapabilitiesDirectoryClientTest,
testAddTaskExpiryDateHasCorrectValue(awaitGlobalRegistration, taskExpiryDate);
}
+joynr::TimePoint GlobalCapabilitiesDirectoryClientTest::getAddTaskExpiryDateForProviderExpirationTest(
+ std::int64_t expiryDateMs)
+{
+ bool awaitGlobalRegistration = false;
+ std::unique_ptr> mockTaskSequencer =
+ std::make_unique>(std::chrono::milliseconds(60000));
+ auto semaphore = std::make_shared();
+ MockTaskSequencer::MockTaskWithExpiryDate capturedTask;
+ globalDiscoveryEntry.setExpiryDateMs(expiryDateMs);
+
+ EXPECT_CALL(*mockTaskSequencer, add(_))
+ .Times(1)
+ .WillOnce(DoAll(SaveArg<0>(&capturedTask), ReleaseSemaphore(semaphore)));
+ std::shared_ptr gcdClient =
+ std::make_shared(
+ clusterControllerSettings, std::move(mockTaskSequencer));
+ gcdClient->add(globalDiscoveryEntry,
+ awaitGlobalRegistration,
+ gbids,
+ onSuccess,
+ onError,
+ onRuntimeError);
+ EXPECT_TRUE(semaphore->waitFor(std::chrono::seconds(10))) << "TaskSequencer.add() not called.";
+ return capturedTask._expiryDate;
+}
+
+TEST_F(GlobalCapabilitiesDirectoryClientTest,
+ testAddTaskExpiryDateHasCorrectValueWithoutAwaitGlobalRegistrationProviderExpired)
+{
+ auto actualTaskExpiryDate = getAddTaskExpiryDateForProviderExpirationTest(capExpiryDateMs);
+ ASSERT_NE(TimePoint::max().toMilliseconds(), actualTaskExpiryDate.toMilliseconds());
+}
+
+
+TEST_F(GlobalCapabilitiesDirectoryClientTest,
+ testAddTaskExpiryDateHasCorrectValueWithoutAwaitGlobalRegistrationProviderNotExpired)
+{
+ auto actualTaskExpiryDate = getAddTaskExpiryDateForProviderExpirationTest(
+ TimePoint::fromRelativeMs(capExpiryDateMs).toMilliseconds());
+ ASSERT_EQ(TimePoint::max().toMilliseconds(), actualTaskExpiryDate.toMilliseconds());
+}
+
TEST_F(GlobalCapabilitiesDirectoryClientTest,
testReAddTask_onSuccessForAllEntries_proxyCalledAndResultFutureResolved)
{
std::unique_ptr> mockTaskSequencer =
std::make_unique>(std::chrono::milliseconds(60000));
- auto mockTaskSequencerRef = mockTaskSequencer.get();
+ auto semaphore = std::make_shared