Skip to content

Commit

Permalink
[#3532] Split up command router modules
Browse files Browse the repository at this point in the history
* Split client-device-connection-infinispan module into client-device-connection-base and client-device-connection-infinispan.
* Moved common classes from client-device-connection-infinispan module into client-device-connection-base module. 
* Split services/command-router module into services/command-router-base and services/command-router-infinispan.
* Updated push_hono_images.sh  script to consider new image names
  • Loading branch information
StFS authored May 17, 2024
1 parent 09af700 commit 74f3001
Show file tree
Hide file tree
Showing 69 changed files with 484 additions and 197 deletions.
7 changes: 6 additions & 1 deletion bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,12 @@ quarkus.vertx.max-event-loop-execute-time=${max.event-loop.execute-time:20000}
</dependency>
<dependency>
<groupId>org.eclipse.hono</groupId>
<artifactId>hono-service-command-router</artifactId>
<artifactId>hono-service-command-router-base</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.eclipse.hono</groupId>
<artifactId>client-device-connection-base</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
Expand Down
124 changes: 124 additions & 0 deletions client-device-connection-base/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.eclipse.hono</groupId>
<artifactId>hono-bom</artifactId>
<version>2.6.0-SNAPSHOT</version>
<relativePath>../bom</relativePath>
</parent>
<artifactId>client-device-connection-base</artifactId>

<name>Device Connection client</name>
<description>Base classes for client for accessing device connection information in a remote cache / data grid.</description>

<dependencies>
<dependency>
<groupId>org.eclipse.hono</groupId>
<artifactId>hono-legal</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.hono</groupId>
<artifactId>hono-core</artifactId>
</dependency>
<dependency>
<groupId>org.eclipse.hono</groupId>
<artifactId>hono-client-common</artifactId>
</dependency>
<dependency>
<groupId>io.opentracing</groupId>
<artifactId>opentracing-api</artifactId>
</dependency>
<dependency>
<groupId>io.smallrye.config</groupId>
<artifactId>smallrye-config-core</artifactId>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-core</artifactId>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-health-check</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>

<!-- testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.truth</groupId>
<artifactId>truth</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.vertx</groupId>
<artifactId>vertx-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.hono</groupId>
<artifactId>core-test-utils</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jboss.jandex</groupId>
<artifactId>jandex-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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");
}
}
37 changes: 37 additions & 0 deletions client-device-connection-base/src/test/resources/logback-test.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
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
-->

<!DOCTYPE configuration>

<configuration>

<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>

<root level="INFO">
<appender-ref ref="STDOUT" />
</root>

<logger name="org.eclipse.hono.deviceconnection.common" level="INFO"/>
<logger name="org.eclipse.hono.client" level="INFO"/>
<logger name="org.eclipse.hono.config" level="INFO"/>
<logger name="org.eclipse.hono.connection" level="INFO"/>
<logger name="org.eclipse.hono.util" level="INFO"/>

</configuration>
Loading

0 comments on commit 74f3001

Please sign in to comment.