diff --git a/bom/pom.xml b/bom/pom.xml index 98575f78f5..99025a92b3 100644 --- a/bom/pom.xml +++ b/bom/pom.xml @@ -426,7 +426,12 @@ quarkus.vertx.max-event-loop-execute-time=${max.event-loop.execute-time:20000} org.eclipse.hono - hono-service-command-router + hono-service-command-router-base + ${project.version} + + + org.eclipse.hono + client-device-connection-base ${project.version} diff --git a/client-device-connection-base/pom.xml b/client-device-connection-base/pom.xml new file mode 100644 index 0000000000..5636a9d651 --- /dev/null +++ b/client-device-connection-base/pom.xml @@ -0,0 +1,124 @@ + + + + 4.0.0 + + org.eclipse.hono + hono-bom + 2.6.0-SNAPSHOT + ../bom + + client-device-connection-base + + Device Connection client + Base classes for client for accessing device connection information in a remote cache / data grid. + + + + org.eclipse.hono + hono-legal + + + org.slf4j + slf4j-api + + + org.eclipse.hono + hono-core + + + org.eclipse.hono + hono-client-common + + + io.opentracing + opentracing-api + + + io.smallrye.config + smallrye-config-core + + + io.vertx + vertx-core + + + io.vertx + vertx-health-check + + + com.google.guava + guava + + + + + org.junit.jupiter + junit-jupiter-engine + test + + + org.junit.jupiter + junit-jupiter-params + test + + + com.google.truth + truth + test + + + ch.qos.logback + logback-classic + test + + + org.mockito + mockito-core + test + + + io.vertx + vertx-junit5 + test + + + org.eclipse.hono + core-test-utils + test + + + + + + + org.apache.maven.plugins + maven-dependency-plugin + + + org.apache.maven.plugins + maven-checkstyle-plugin + + + org.jboss.jandex + jandex-maven-plugin + + + org.jacoco + jacoco-maven-plugin + + + + diff --git a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/AdapterInstanceStatusProvider.java b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/AdapterInstanceStatusProvider.java similarity index 93% rename from client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/AdapterInstanceStatusProvider.java rename to client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/AdapterInstanceStatusProvider.java index 2c98c8a2c0..1023cea82c 100644 --- a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/AdapterInstanceStatusProvider.java +++ b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/AdapterInstanceStatusProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation + * Copyright (c) 2021 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ -package org.eclipse.hono.deviceconnection.infinispan.client; +package org.eclipse.hono.deviceconnection.common; import java.util.Collection; import java.util.Set; diff --git a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/Cache.java b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/Cache.java similarity index 97% rename from client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/Cache.java rename to client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/Cache.java index eec68f8f7c..afb5d31e48 100644 --- a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/Cache.java +++ b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/Cache.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2020, 2021 Contributors to the Eclipse Foundation + * Copyright (c) 2020 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hono.deviceconnection.infinispan.client; +package org.eclipse.hono.deviceconnection.common; import java.util.Map; import java.util.Set; diff --git a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/CacheBasedDeviceConnectionInfo.java b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/CacheBasedDeviceConnectionInfo.java similarity index 99% rename from client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/CacheBasedDeviceConnectionInfo.java rename to client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/CacheBasedDeviceConnectionInfo.java index 21f3bd28a7..8c0bc7f9a9 100644 --- a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/CacheBasedDeviceConnectionInfo.java +++ b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/CacheBasedDeviceConnectionInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2020, 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2020 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hono.deviceconnection.infinispan.client; +package org.eclipse.hono.deviceconnection.common; import java.net.HttpURLConnection; import java.time.Duration; diff --git a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/CommonCacheConfig.java b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/CommonCacheConfig.java similarity index 94% rename from client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/CommonCacheConfig.java rename to client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/CommonCacheConfig.java index ec4109424c..26ba7481e4 100644 --- a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/CommonCacheConfig.java +++ b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/CommonCacheConfig.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation + * Copyright (c) 2020 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 *******************************************************************************/ -package org.eclipse.hono.deviceconnection.infinispan.client; +package org.eclipse.hono.deviceconnection.common; import com.google.common.base.MoreObjects; diff --git a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/CommonCacheOptions.java b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/CommonCacheOptions.java similarity index 95% rename from client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/CommonCacheOptions.java rename to client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/CommonCacheOptions.java index 8118a198f5..bbd69c036d 100644 --- a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/CommonCacheOptions.java +++ b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/CommonCacheOptions.java @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hono.deviceconnection.infinispan.client; +package org.eclipse.hono.deviceconnection.common; import org.eclipse.hono.util.CommandRouterConstants; diff --git a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/DeviceConnectionInfo.java b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/DeviceConnectionInfo.java similarity index 98% rename from client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/DeviceConnectionInfo.java rename to client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/DeviceConnectionInfo.java index 4b7e800298..f643844065 100644 --- a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/DeviceConnectionInfo.java +++ b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/DeviceConnectionInfo.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2020, 2022 Contributors to the Eclipse Foundation + * Copyright (c) 2020 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hono.deviceconnection.infinispan.client; +package org.eclipse.hono.deviceconnection.common; import java.time.Duration; import java.util.Map; diff --git a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/DeviceToAdapterMappingErrorListener.java b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/DeviceToAdapterMappingErrorListener.java similarity index 95% rename from client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/DeviceToAdapterMappingErrorListener.java rename to client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/DeviceToAdapterMappingErrorListener.java index bdb45e069b..0fa4d7fb95 100644 --- a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/DeviceToAdapterMappingErrorListener.java +++ b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/DeviceToAdapterMappingErrorListener.java @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hono.deviceconnection.infinispan.client; +package org.eclipse.hono.deviceconnection.common; import io.opentracing.Span; import io.vertx.core.Future; diff --git a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/UnknownStatusProvider.java b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/UnknownStatusProvider.java similarity index 94% rename from client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/UnknownStatusProvider.java rename to client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/UnknownStatusProvider.java index d52468ce44..861ecfda79 100644 --- a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/UnknownStatusProvider.java +++ b/client-device-connection-base/src/main/java/org/eclipse/hono/deviceconnection/common/UnknownStatusProvider.java @@ -12,7 +12,7 @@ */ -package org.eclipse.hono.deviceconnection.infinispan.client; +package org.eclipse.hono.deviceconnection.common; import java.util.Collection; import java.util.Set; diff --git a/client-device-connection-infinispan/src/test/java/org/eclipse/hono/deviceconnection/infinispan/client/CacheBasedDeviceConnectionInfoTest.java b/client-device-connection-base/src/test/java/org/eclipse/hono/deviceconnection/common/CacheBasedDeviceConnectionInfoTest.java similarity index 99% rename from client-device-connection-infinispan/src/test/java/org/eclipse/hono/deviceconnection/infinispan/client/CacheBasedDeviceConnectionInfoTest.java rename to client-device-connection-base/src/test/java/org/eclipse/hono/deviceconnection/common/CacheBasedDeviceConnectionInfoTest.java index 744858a2be..558b7abee5 100644 --- a/client-device-connection-infinispan/src/test/java/org/eclipse/hono/deviceconnection/infinispan/client/CacheBasedDeviceConnectionInfoTest.java +++ b/client-device-connection-base/src/test/java/org/eclipse/hono/deviceconnection/common/CacheBasedDeviceConnectionInfoTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2020, 2021 Contributors to the Eclipse Foundation + * Copyright (c) 2020 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -11,7 +11,7 @@ * SPDX-License-Identifier: EPL-2.0 */ -package org.eclipse.hono.deviceconnection.infinispan.client; +package org.eclipse.hono.deviceconnection.common; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/client-device-connection-base/src/test/java/org/eclipse/hono/deviceconnection/common/CommonCacheQuarkusPropertyBindingTest.java b/client-device-connection-base/src/test/java/org/eclipse/hono/deviceconnection/common/CommonCacheQuarkusPropertyBindingTest.java new file mode 100644 index 0000000000..4e1948ddd3 --- /dev/null +++ b/client-device-connection-base/src/test/java/org/eclipse/hono/deviceconnection/common/CommonCacheQuarkusPropertyBindingTest.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2024 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ + +package org.eclipse.hono.deviceconnection.common; + +import static com.google.common.truth.Truth.assertThat; + +import org.eclipse.hono.test.ConfigMappingSupport; +import org.junit.jupiter.api.Test; + +/** + * Tests verifying binding of configuration properties to {@link CommonCacheConfig}. + * + */ +public class CommonCacheQuarkusPropertyBindingTest { + + @Test + void testCommonCacheConfigurationPropertiesArePickedUp() { + final var commonCacheConfig = new CommonCacheConfig( + ConfigMappingSupport.getConfigMapping( + CommonCacheOptions.class, + this.getClass().getResource("/common-cache-options.yaml"))); + + assertThat(commonCacheConfig.getCacheName()).isEqualTo("the-cache"); + assertThat(commonCacheConfig.getCheckKey()).isEqualTo("the-key"); + assertThat(commonCacheConfig.getCheckValue()).isEqualTo("the-value"); + } +} diff --git a/client-device-connection-infinispan/src/test/resources/common-cache-options.yaml b/client-device-connection-base/src/test/resources/common-cache-options.yaml similarity index 100% rename from client-device-connection-infinispan/src/test/resources/common-cache-options.yaml rename to client-device-connection-base/src/test/resources/common-cache-options.yaml diff --git a/client-device-connection-base/src/test/resources/logback-test.xml b/client-device-connection-base/src/test/resources/logback-test.xml new file mode 100644 index 0000000000..f436327d3a --- /dev/null +++ b/client-device-connection-base/src/test/resources/logback-test.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + + + + + + + + diff --git a/client-device-connection-infinispan/pom.xml b/client-device-connection-infinispan/pom.xml index b24f28db0b..612358d8a3 100644 --- a/client-device-connection-infinispan/pom.xml +++ b/client-device-connection-infinispan/pom.xml @@ -1,6 +1,6 @@ @@ -170,4 +148,4 @@ - \ No newline at end of file + diff --git a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/BasicCache.java b/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/BasicCache.java index 9373aae86f..ad5f6f2acb 100644 --- a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/BasicCache.java +++ b/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/BasicCache.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2020, 2023 Contributors to the Eclipse Foundation + * Copyright (c) 2020 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -24,6 +24,7 @@ import java.util.function.Function; import org.eclipse.hono.client.ServerErrorException; +import org.eclipse.hono.deviceconnection.common.Cache; import org.eclipse.hono.util.Futures; import org.eclipse.hono.util.Lifecycle; import org.infinispan.commons.api.BasicCacheContainer; diff --git a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/HotrodCache.java b/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/HotrodCache.java index 4e3b3ea9b1..094ee8d2fd 100644 --- a/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/HotrodCache.java +++ b/client-device-connection-infinispan/src/main/java/org/eclipse/hono/deviceconnection/infinispan/client/HotrodCache.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2020, 2021 Contributors to the Eclipse Foundation + * Copyright (c) 2020 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -18,6 +18,7 @@ import java.util.Objects; import java.util.concurrent.atomic.AtomicBoolean; +import org.eclipse.hono.deviceconnection.common.CommonCacheConfig; import org.infinispan.client.hotrod.RemoteCache; import org.infinispan.client.hotrod.RemoteCacheContainer; import org.infinispan.client.hotrod.RemoteCacheManager; diff --git a/client-device-connection-infinispan/src/test/java/org/eclipse/hono/deviceconnection/infinispan/client/QuarkusPropertyBindingTest.java b/client-device-connection-infinispan/src/test/java/org/eclipse/hono/deviceconnection/infinispan/client/RemoteCacheQuarkusPropertyBindingTest.java similarity index 84% rename from client-device-connection-infinispan/src/test/java/org/eclipse/hono/deviceconnection/infinispan/client/QuarkusPropertyBindingTest.java rename to client-device-connection-infinispan/src/test/java/org/eclipse/hono/deviceconnection/infinispan/client/RemoteCacheQuarkusPropertyBindingTest.java index 53fe74cf6a..af5c3c865c 100644 --- a/client-device-connection-infinispan/src/test/java/org/eclipse/hono/deviceconnection/infinispan/client/QuarkusPropertyBindingTest.java +++ b/client-device-connection-infinispan/src/test/java/org/eclipse/hono/deviceconnection/infinispan/client/RemoteCacheQuarkusPropertyBindingTest.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation + * Copyright (c) 2021 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -25,24 +25,9 @@ import org.junit.jupiter.api.Test; /** - * Tests verifying binding of configuration properties to {@link CommonCacheConfig} and - * {@link InfinispanRemoteConfigurationProperties}. - * + * Tests verifying binding of configuration properties to {@link InfinispanRemoteConfigurationProperties}. */ -public class QuarkusPropertyBindingTest { - - @Test - void testCommonCacheConfigurationPropertiesArePickedUp() { - - final var commonCacheConfig = new CommonCacheConfig( - ConfigMappingSupport.getConfigMapping( - CommonCacheOptions.class, - this.getClass().getResource("/common-cache-options.yaml"))); - - assertThat(commonCacheConfig.getCacheName()).isEqualTo("the-cache"); - assertThat(commonCacheConfig.getCheckKey()).isEqualTo("the-key"); - assertThat(commonCacheConfig.getCheckValue()).isEqualTo("the-value"); - } +public class RemoteCacheQuarkusPropertyBindingTest { @SuppressWarnings("deprecation") @Test diff --git a/pom.xml b/pom.xml index dcd0481731..7784c51c4b 100644 --- a/pom.xml +++ b/pom.xml @@ -1,6 +1,6 @@ + + 4.0.0 + + org.eclipse.hono + hono-services-parent + 2.6.0-SNAPSHOT + ../parent + + hono-service-command-router-infinispan + Hono Infinispan Based Command Router + A Quarkus based implementation of Hono's Command Router API that is using Infinispan for storing data. + + + + org.eclipse.hono + hono-service-command-router-base + + + + org.eclipse.hono + client-device-connection-infinispan + + + + + + + + io.fabric8 + docker-maven-plugin + + + + + + Command Router + + + 5671 + 5672 + ${health.check.port} + + + + + + + + + + + + + + build-docker-image + + + + io.fabric8 + docker-maven-plugin + + + + + + + build-native-image + + + + io.fabric8 + docker-maven-plugin + + + + + + + diff --git a/services/command-router-infinispan/src/main/java/org/eclipse/hono/commandrouter/infinispan/app/Application.java b/services/command-router-infinispan/src/main/java/org/eclipse/hono/commandrouter/infinispan/app/Application.java new file mode 100644 index 0000000000..5ad3d58eee --- /dev/null +++ b/services/command-router-infinispan/src/main/java/org/eclipse/hono/commandrouter/infinispan/app/Application.java @@ -0,0 +1,34 @@ +/** + * Copyright (c) 2021 Contributors to the Eclipse Foundation + * + * See the NOTICE file(s) distributed with this work for additional + * information regarding copyright ownership. + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0 + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.hono.commandrouter.infinispan.app; + +import org.eclipse.hono.commandrouter.app.AbstractApplication; +import org.eclipse.hono.deviceconnection.common.DeviceConnectionInfo; + +import jakarta.enterprise.context.ApplicationScoped; +import jakarta.inject.Inject; + +/** + * The Quarkus based Command Router main application class (Infinispan variant). + */ +@ApplicationScoped +public class Application extends AbstractApplication { + + @Inject + DeviceConnectionInfo deviceConnectionInfo; + + @Override + protected DeviceConnectionInfo getDeviceConnectionInfo() { + return deviceConnectionInfo; + } +} diff --git a/services/command-router/src/main/java/org/eclipse/hono/commandrouter/app/DeviceConnectionInfoProducer.java b/services/command-router-infinispan/src/main/java/org/eclipse/hono/commandrouter/infinispan/app/InfinispanDeviceConnectionInfoProducer.java similarity index 90% rename from services/command-router/src/main/java/org/eclipse/hono/commandrouter/app/DeviceConnectionInfoProducer.java rename to services/command-router-infinispan/src/main/java/org/eclipse/hono/commandrouter/infinispan/app/InfinispanDeviceConnectionInfoProducer.java index 07b1482bbb..60bd185931 100644 --- a/services/command-router/src/main/java/org/eclipse/hono/commandrouter/app/DeviceConnectionInfoProducer.java +++ b/services/command-router-infinispan/src/main/java/org/eclipse/hono/commandrouter/infinispan/app/InfinispanDeviceConnectionInfoProducer.java @@ -1,5 +1,5 @@ /** - * Copyright (c) 2021, 2022 Contributors to the Eclipse Foundation + * Copyright (c) 2021 Contributors to the Eclipse Foundation * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -12,7 +12,7 @@ */ -package org.eclipse.hono.commandrouter.app; +package org.eclipse.hono.commandrouter.infinispan.app; import java.io.IOException; import java.nio.file.Files; @@ -23,11 +23,11 @@ import org.eclipse.hono.commandrouter.CommandRouterServiceOptions; import org.eclipse.hono.commandrouter.impl.KubernetesBasedAdapterInstanceStatusService; import org.eclipse.hono.commandrouter.impl.UnknownStatusProvidingService; +import org.eclipse.hono.deviceconnection.common.CacheBasedDeviceConnectionInfo; +import org.eclipse.hono.deviceconnection.common.CommonCacheConfig; +import org.eclipse.hono.deviceconnection.common.CommonCacheOptions; +import org.eclipse.hono.deviceconnection.common.DeviceConnectionInfo; import org.eclipse.hono.deviceconnection.infinispan.client.BasicCache; -import org.eclipse.hono.deviceconnection.infinispan.client.CacheBasedDeviceConnectionInfo; -import org.eclipse.hono.deviceconnection.infinispan.client.CommonCacheConfig; -import org.eclipse.hono.deviceconnection.infinispan.client.CommonCacheOptions; -import org.eclipse.hono.deviceconnection.infinispan.client.DeviceConnectionInfo; import org.eclipse.hono.deviceconnection.infinispan.client.EmbeddedCache; import org.eclipse.hono.deviceconnection.infinispan.client.HotrodCache; import org.eclipse.hono.deviceconnection.infinispan.client.InfinispanRemoteConfigurationOptions; @@ -55,9 +55,9 @@ * on whether a remote cache config with a non-empty server list is used or not. */ @ApplicationScoped -public class DeviceConnectionInfoProducer { +public class InfinispanDeviceConnectionInfoProducer { - private static final Logger LOG = LoggerFactory.getLogger(DeviceConnectionInfoProducer.class); + private static final Logger LOG = LoggerFactory.getLogger(InfinispanDeviceConnectionInfoProducer.class); @ConfigProperty(name = "hono.commandRouter.cache.embedded.configurationFile", defaultValue = "/etc/hono/cache-config.xml") String configFile; diff --git a/services/command-router/src/main/resources/META-INF/native-image/org.eclipse.hono/hono-service-command-router/native-image.properties b/services/command-router-infinispan/src/main/resources/META-INF/native-image/org.eclipse.hono/hono-service-command-router/native-image.properties similarity index 100% rename from services/command-router/src/main/resources/META-INF/native-image/org.eclipse.hono/hono-service-command-router/native-image.properties rename to services/command-router-infinispan/src/main/resources/META-INF/native-image/org.eclipse.hono/hono-service-command-router/native-image.properties diff --git a/services/command-router/src/main/resources/application-dev.properties b/services/command-router-infinispan/src/main/resources/application-dev.properties similarity index 100% rename from services/command-router/src/main/resources/application-dev.properties rename to services/command-router-infinispan/src/main/resources/application-dev.properties diff --git a/services/command-router/src/main/resources/application.properties b/services/command-router-infinispan/src/main/resources/application.properties similarity index 100% rename from services/command-router/src/main/resources/application.properties rename to services/command-router-infinispan/src/main/resources/application.properties diff --git a/services/command-router/src/main/resources/default_banner.txt b/services/command-router-infinispan/src/main/resources/default_banner.txt similarity index 92% rename from services/command-router/src/main/resources/default_banner.txt rename to services/command-router-infinispan/src/main/resources/default_banner.txt index ee1eac25ce..6ff38647e3 100644 --- a/services/command-router/src/main/resources/default_banner.txt +++ b/services/command-router-infinispan/src/main/resources/default_banner.txt @@ -8,7 +8,7 @@ | | |_| -Eclipse Hono Command Router +Eclipse Hono Infinispan Based Command Router Go to https://www.eclipse.org/hono for more information. diff --git a/services/pom.xml b/services/pom.xml index 416fc18f64..0c3658d287 100644 --- a/services/pom.xml +++ b/services/pom.xml @@ -1,6 +1,6 @@ clustered-cache - hono-service-command-router + hono-service-command-router-infinispan 300000000 ${default.java-options} @@ -264,7 +264,7 @@ org.eclipse.hono - hono-service-command-router + hono-service-command-router-base test @@ -629,7 +629,7 @@ hono-service-auth-native 60000000 false - hono-service-command-router-native + hono-service-command-router-infinispan-native 100000000 hono-service-device-registry-mongodb-native 150000000