diff --git a/src/main/java/eu/ess/ics/ccce/common/conversion/ConversionUtil.java b/src/main/java/eu/ess/ics/ccce/common/conversion/ConversionUtil.java index 81df6bca71f2cc81781c790b0092032de54733f8..cfcf7fc6b19fa1523ba10d31a440829f52b943b4 100644 --- a/src/main/java/eu/ess/ics/ccce/common/conversion/ConversionUtil.java +++ b/src/main/java/eu/ess/ics/ccce/common/conversion/ConversionUtil.java @@ -80,6 +80,7 @@ public class ConversionUtil { private static final String CHANNEL_IOC_NAME_KEY = "iocName"; private static final String CHANNEL_HOST_NAME_KEY = "hostName"; private static final String CHANNEL_PV_STATUS_KEY = "pvStatus"; + private static final String CHANNEL_DESCRIPTION_KEY = "DESCRIPTION"; private static final String CHANNEL_IOC_VERSION_KEY = "IOCVERSION"; //not intended to be instantiated @@ -811,6 +812,9 @@ public class ConversionUtil { .map(Property::getValue).orElse(null)), channel.getProperties().stream() .filter(p -> StringUtils.equals(p.getName(), CHANNEL_IOC_VERSION_KEY)).findFirst() + .map(Property::getValue).orElse(null), + channel.getProperties().stream() + .filter(p -> StringUtils.equals(p.getName(), CHANNEL_DESCRIPTION_KEY)).findFirst() .map(Property::getValue).orElse(null) ); } @@ -835,6 +839,9 @@ public class ConversionUtil { channel.getProperties().stream() .filter(p -> StringUtils.equals(p.getName(), CHANNEL_IOC_VERSION_KEY)).findFirst() .map(Property::getValue).orElse(null), + channel.getProperties().stream() + .filter(p -> StringUtils.equals(p.getName(), CHANNEL_DESCRIPTION_KEY)).findFirst() + .map(Property::getValue).orElse(null), iocId, hostId, channel.getProperties().stream().filter(p -> !specialKeys.contains(p.getName())).collect( diff --git a/src/main/java/eu/ess/ics/ccce/rest/model/record/response/Record.java b/src/main/java/eu/ess/ics/ccce/rest/model/record/response/Record.java index 752d10061786e1c11c9550012ea0cb3bb49d5893..1f2752d96ebc71126d5dc1e555cecda197626af6 100644 --- a/src/main/java/eu/ess/ics/ccce/rest/model/record/response/Record.java +++ b/src/main/java/eu/ess/ics/ccce/rest/model/record/response/Record.java @@ -29,13 +29,15 @@ public class Record { private final String hostName; private final PVStatus pvStatus; private final String iocVersion; + private final String description; - public Record(String name, String iocName, String hostName, PVStatus pvStatus, String iocVersion) { + public Record(String name, String iocName, String hostName, PVStatus pvStatus, String iocVersion, String description) { this.name = name; this.iocName = iocName; this.hostName = hostName; this.pvStatus = pvStatus; this.iocVersion = iocVersion; + this.description = description; } public String getName() { @@ -57,4 +59,8 @@ public class Record { public String getIocVersion() { return iocVersion; } + + public String getDescription() { + return description; + } } diff --git a/src/main/java/eu/ess/ics/ccce/rest/model/record/response/RecordDetails.java b/src/main/java/eu/ess/ics/ccce/rest/model/record/response/RecordDetails.java index fdf95b190f1d17dfebf95bc743e8ddd23fe17db9..fbc708de82f6ef5a66ba77c413a408ae3c6c7cc5 100644 --- a/src/main/java/eu/ess/ics/ccce/rest/model/record/response/RecordDetails.java +++ b/src/main/java/eu/ess/ics/ccce/rest/model/record/response/RecordDetails.java @@ -30,8 +30,8 @@ public class RecordDetails extends Record { private final Long hostCSentryId; private final Map<String, String> properties; public RecordDetails(String name, String iocName, String hostName, PVStatus pvStatus, String iocVersion, - Long iocId, long hostCSentryId, Map<String, String> properties) { - super(name, iocName, hostName, pvStatus, iocVersion); + String description, Long iocId, Long hostCSentryId, Map<String, String> properties) { + super(name, iocName, hostName, pvStatus, iocVersion, description); this.iocId = iocId; this.hostCSentryId = hostCSentryId; this.properties = properties;