From 9bf2612c7dea1ccca7f9dd0a36ef985a1e646282 Mon Sep 17 00:00:00 2001 From: Denislav Prinov Date: Thu, 29 Jun 2023 08:40:22 +0300 Subject: [PATCH] Extend the Rollout filtration fields with status and Distribution set Signed-off-by: Denislav Prinov --- .../hawkbit/repository/RolloutFields.java | 29 ++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/hawkbit-core/src/main/java/org/eclipse/hawkbit/repository/RolloutFields.java b/hawkbit-core/src/main/java/org/eclipse/hawkbit/repository/RolloutFields.java index 2c7f7b9712..dbec38c815 100644 --- a/hawkbit-core/src/main/java/org/eclipse/hawkbit/repository/RolloutFields.java +++ b/hawkbit-core/src/main/java/org/eclipse/hawkbit/repository/RolloutFields.java @@ -8,6 +8,10 @@ */ package org.eclipse.hawkbit.repository; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + /** * Describing the fields of the Rollout model which can be used in the REST API * e.g. for sorting etc. @@ -25,12 +29,35 @@ public enum RolloutFields implements FieldNameProvider { /** * The id field. */ - ID("id"); + ID("id"), + /** + * The status field. + */ + STATUS("status"), + /** + * The Distribution set field. + */ + DISTRIBUTIONSET("distributionSet", DistributionSetFields.ID.getFieldName(), + DistributionSetFields.NAME.getFieldName(), DistributionSetFields.VERSION.getFieldName(), + DistributionSetFields.TYPE.getFieldName()); private final String fieldName; + private final List subEntityAttributes; + private RolloutFields(final String fieldName) { this.fieldName = fieldName; + this.subEntityAttributes = Collections.emptyList(); + } + + private RolloutFields(final String fieldName, final String... subEntityAttributes) { + this.fieldName = fieldName; + this.subEntityAttributes = Arrays.asList(subEntityAttributes); + } + + @Override + public List getSubEntityAttributes() { + return Collections.unmodifiableList(subEntityAttributes); } @Override