Software module metadata available to targets (in DMF and DDI) (#608)
* Software module metadata can be configure as target visible. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Added metadata to DDI. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Managed by UI. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Complete DMF integration and started UI. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Add DMF tests and completed UI. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Add RSQL test. Fix sonar issues. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Add JavaDocs. foreachtenant robustness. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Review feedback included. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Updated DMF docs. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * targetVisible optional in builder. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix typos. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix checkbox ID. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * DB optimization. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Fix component ID of sm metadat details tab. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -13,22 +13,33 @@ import java.util.List;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Deployment chunks.
|
||||
*/
|
||||
public class DdiChunk {
|
||||
|
||||
@JsonProperty("part")
|
||||
@NotNull
|
||||
private String part;
|
||||
|
||||
@JsonProperty("version")
|
||||
@NotNull
|
||||
private String version;
|
||||
|
||||
@JsonProperty("name")
|
||||
@NotNull
|
||||
private String name;
|
||||
|
||||
@JsonProperty("artifacts")
|
||||
private List<DdiArtifact> artifacts;
|
||||
|
||||
@JsonProperty("metadata")
|
||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||
private List<DdiMetadata> metadata;
|
||||
|
||||
public DdiChunk() {
|
||||
// needed for json create
|
||||
}
|
||||
@@ -44,13 +55,16 @@ public class DdiChunk {
|
||||
* of the artifact
|
||||
* @param artifacts
|
||||
* download information
|
||||
* @param metadata
|
||||
* optional as additional information for the target/device
|
||||
*/
|
||||
public DdiChunk(final String part, final String version, final String name, final List<DdiArtifact> artifacts) {
|
||||
super();
|
||||
public DdiChunk(final String part, final String version, final String name, final List<DdiArtifact> artifacts,
|
||||
final List<DdiMetadata> metadata) {
|
||||
this.part = part;
|
||||
this.version = version;
|
||||
this.name = name;
|
||||
this.artifacts = artifacts;
|
||||
this.metadata = metadata;
|
||||
}
|
||||
|
||||
public String getPart() {
|
||||
@@ -73,4 +87,8 @@ public class DdiChunk {
|
||||
return Collections.unmodifiableList(artifacts);
|
||||
}
|
||||
|
||||
public List<DdiMetadata> getMetadata() {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -11,6 +11,9 @@ package org.eclipse.hawkbit.ddi.json.model;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
/**
|
||||
@@ -22,6 +25,8 @@ public class DdiDeployment {
|
||||
|
||||
private HandlingType update;
|
||||
|
||||
@JsonProperty("chunks")
|
||||
@NotNull
|
||||
private List<DdiChunk> chunks;
|
||||
|
||||
/**
|
||||
@@ -59,7 +64,7 @@ public class DdiDeployment {
|
||||
if (chunks == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
return Collections.unmodifiableList(chunks);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.ddi.json.model;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Additional metadata to be provided for the target/device.
|
||||
*
|
||||
*/
|
||||
public class DdiMetadata {
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
private final String key;
|
||||
|
||||
@JsonProperty
|
||||
@NotNull
|
||||
private final String value;
|
||||
|
||||
public DdiMetadata(final String key, final String value) {
|
||||
this.key = key;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user