Code format hawkbit-dmf (#1938)

Signed-off-by: Marinov Avgustin <Avgustin.Marinov@bosch.com>
This commit is contained in:
Avgustin Marinov
2024-11-05 11:26:09 +02:00
committed by GitHub
parent e18181bd7b
commit 7161b8803a
13 changed files with 69 additions and 64 deletions

View File

@@ -1,10 +1,17 @@
# hawkBit device management federation API - implementation # hawkBit device management federation API - implementation
This is the AMQP implementation for the device management federation API. The implementation uses the spring-amqp project. This is the AMQP implementation for the device management federation API. The implementation uses the spring-amqp
project.
# Integration Test # Integration Test
This modules contains some integration tests for the device management federation API implementation which uses a RabbitMQ. If there is no RabbitMQ running on the system, all tests will be marked as skipped. You can disable this rule and the tests will fail if there is no RabbitMQ running. n order to disable the rule at runtime, set an environment variable RABBITMQ_SERVER_REQUIRED=true. This modules contains some integration tests for the device management federation API implementation which uses a
The default RabbitMQ hostname is localhost. To set another hostname, set the property spring.rabbitmq.host to the new hostname. RabbitMQ. If there is no RabbitMQ running on the system, all tests will be marked as skipped. You can disable this rule
The default RabbitMQ username is guest. To set another username, set the property spring.rabbitmq.username to the new username. and the tests will fail if there is no RabbitMQ running. n order to disable the rule at runtime, set an environment
The default RabbitMQ password is guest. To set another password, set the property spring.rabbitmq.password to the new password. variable RABBITMQ_SERVER_REQUIRED=true.
The default RabbitMQ hostname is localhost. To set another hostname, set the property spring.rabbitmq.host to the new
hostname.
The default RabbitMQ username is guest. To set another username, set the property spring.rabbitmq.username to the new
username.
The default RabbitMQ password is guest. To set another password, set the property spring.rabbitmq.password to the new
password.

View File

@@ -1,8 +1,10 @@
# hawkBit device management federation API - model definition # hawkBit device management federation API - model definition
This API is used for communicating with the hawkBit Update Server through AMQP. This API is used for communicating with the hawkBit Update Server through AMQP.
It is used to integrate other device management system through a high throughput protocol optimized for service to service communication. It is used to integrate other device management system through a high throughput protocol optimized for service to
service communication.
# Version 1 # Version 1
The model follows [semantic versioning](http://semver.org) with MAJOR version, i.e. breaking changes will result in a new MAJOR version. The model follows [semantic versioning](http://semver.org) with MAJOR version, i.e. breaking changes will result in a
new MAJOR version.

View File

@@ -9,22 +9,22 @@
SPDX-License-Identifier: 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" <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 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> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.eclipse.hawkbit</groupId> <groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-dmf-parent</artifactId> <artifactId>hawkbit-dmf-parent</artifactId>
<version>${revision}</version> <version>${revision}</version>
</parent> </parent>
<artifactId>hawkbit-dmf-api</artifactId> <artifactId>hawkbit-dmf-api</artifactId>
<name>hawkBit :: DMF :: API</name> <name>hawkBit :: DMF :: API</name>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.fasterxml.jackson.core</groupId> <groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId> <artifactId>jackson-annotations</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@@ -11,7 +11,6 @@ package org.eclipse.hawkbit.dmf.amqp.api;
/** /**
* The amqp message types which can be handled. * The amqp message types which can be handled.
*
*/ */
public enum MessageType { public enum MessageType {

View File

@@ -26,7 +26,7 @@ public class DmfArtifactHash {
/** /**
* Constructor. * Constructor.
* *
* @param sha1 the sha1 hash * @param sha1 the sha1 hash
* @param md5 the md5 hash * @param md5 the md5 hash
*/ */

View File

@@ -9,6 +9,10 @@
*/ */
package org.eclipse.hawkbit.dmf.json.model; package org.eclipse.hawkbit.dmf.json.model;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude.Include;
@@ -16,19 +20,15 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/** /**
* JSON representation of batch download and update request. * JSON representation of batch download and update request.
*
*/ */
@JsonInclude(Include.NON_NULL) @JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class DmfBatchDownloadAndUpdateRequest { public class DmfBatchDownloadAndUpdateRequest {
@Getter @Setter @Getter
@Setter
@JsonProperty @JsonProperty
private Long timestamp; private Long timestamp;
@@ -70,8 +70,7 @@ public class DmfBatchDownloadAndUpdateRequest {
/** /**
* Add a Target. * Add a Target.
* *
* @param target * @param target the target
* the target
*/ */
public void addTarget(final DmfTarget target) { public void addTarget(final DmfTarget target) {
if (targets == null) { if (targets == null) {

View File

@@ -9,6 +9,10 @@
*/ */
package org.eclipse.hawkbit.dmf.json.model; package org.eclipse.hawkbit.dmf.json.model;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude.Include;
@@ -16,10 +20,6 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter; import lombok.Getter;
import lombok.Setter; import lombok.Setter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/** /**
* JSON representation of confirm request. * JSON representation of confirm request.
*/ */
@@ -27,7 +27,8 @@ import java.util.List;
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class DmfConfirmRequest extends DmfActionRequest { public class DmfConfirmRequest extends DmfActionRequest {
@Getter @Setter @Getter
@Setter
@JsonProperty @JsonProperty
private String targetSecurityToken; private String targetSecurityToken;
@@ -45,8 +46,7 @@ public class DmfConfirmRequest extends DmfActionRequest {
/** /**
* Add a Software module. * Add a Software module.
* *
* @param createSoftwareModule * @param createSoftwareModule the module
* the module
*/ */
public void addSoftwareModule(final DmfSoftwareModule createSoftwareModule) { public void addSoftwareModule(final DmfSoftwareModule createSoftwareModule) {
if (softwareModules == null) { if (softwareModules == null) {

View File

@@ -48,8 +48,7 @@ public class DmfDownloadAndUpdateRequest extends DmfActionRequest {
/** /**
* Add a Software module. * Add a Software module.
* *
* @param createSoftwareModule * @param createSoftwareModule the module
* the module
*/ */
public void addSoftwareModule(final DmfSoftwareModule createSoftwareModule) { public void addSoftwareModule(final DmfSoftwareModule createSoftwareModule) {
if (softwareModules == null) { if (softwareModules == null) {

View File

@@ -23,6 +23,7 @@ import lombok.Data;
@JsonInclude(Include.NON_NULL) @JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true) @JsonIgnoreProperties(ignoreUnknown = true)
public class DmfMetadata { public class DmfMetadata {
@JsonProperty @JsonProperty
private final String key; private final String key;

View File

@@ -12,10 +12,6 @@ package org.eclipse.hawkbit.dmf.json.model;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.eclipse.hawkbit.dmf.amqp.api.EventTopic;
import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
@@ -25,6 +21,9 @@ import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonSubTypes.Type; import com.fasterxml.jackson.annotation.JsonSubTypes.Type;
import com.fasterxml.jackson.annotation.JsonTypeInfo; import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonValue; import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.eclipse.hawkbit.dmf.amqp.api.EventTopic;
/** /**
* JSON representation of a multi-action request. * JSON representation of a multi-action request.

View File

@@ -12,7 +12,6 @@ package org.eclipse.hawkbit.dmf.json.model;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include; import com.fasterxml.jackson.annotation.JsonInclude.Include;

View File

@@ -12,7 +12,7 @@ package org.eclipse.hawkbit.dmf.json.model;
/** /**
* Enumerates the supported update modes. Each mode represents an attribute * Enumerates the supported update modes. Each mode represents an attribute
* update strategy. * update strategy.
* *
* @see DmfAttributeUpdate * @see DmfAttributeUpdate
*/ */
public enum DmfUpdateMode { public enum DmfUpdateMode {

View File

@@ -9,21 +9,21 @@
SPDX-License-Identifier: 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" <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 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> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<groupId>org.eclipse.hawkbit</groupId> <groupId>org.eclipse.hawkbit</groupId>
<artifactId>hawkbit-parent</artifactId> <artifactId>hawkbit-parent</artifactId>
<version>${revision}</version> <version>${revision}</version>
</parent> </parent>
<artifactId>hawkbit-dmf-parent</artifactId> <artifactId>hawkbit-dmf-parent</artifactId>
<name>hawkBit :: DMF</name> <name>hawkBit :: DMF</name>
<packaging>pom</packaging> <packaging>pom</packaging>
<modules> <modules>
<module>hawkbit-dmf-api</module> <module>hawkbit-dmf-api</module>
<module>hawkbit-dmf-amqp</module> <module>hawkbit-dmf-amqp</module>
<module>hawkbit-dmf-rabbitmq-test</module> <module>hawkbit-dmf-rabbitmq-test</module>
</modules> </modules>
</project> </project>