X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pmproducer%2Fsrc%2Fmain%2Fjava%2Forg%2Foran%2Fpmproducer%2Ffilter%2FFilteredData.java;fp=pmproducer%2Fsrc%2Fmain%2Fjava%2Forg%2Foran%2Fpmproducer%2Ffilter%2FFilteredData.java;h=babc9a0f4169b6e0cc3a73775fa95c29ccb0a966;hb=db5cb9a3759fe227ce8654bd0be1c85080e83e3f;hp=a2348ca6eb03c43081f03d3ab83ab5dff4902e88;hpb=d806dbef4f43bb9c631c818e96c1a39e440c5e6c;p=nonrtric%2Fplt%2Franpm.git diff --git a/pmproducer/src/main/java/org/oran/pmproducer/filter/FilteredData.java b/pmproducer/src/main/java/org/oran/pmproducer/filter/FilteredData.java index a2348ca..babc9a0 100644 --- a/pmproducer/src/main/java/org/oran/pmproducer/filter/FilteredData.java +++ b/pmproducer/src/main/java/org/oran/pmproducer/filter/FilteredData.java @@ -38,21 +38,25 @@ public class FilteredData { @Getter private final boolean isZipped; - private static final FilteredData emptyData = new FilteredData(null, null, null); + @Getter + private final String sourceName; + + private static final FilteredData emptyData = new FilteredData(null, null, null, null); public boolean isEmpty() { return (key == null || key.length == 0) && (value == null || value.length == 0); } - public FilteredData(String type, byte[] key, byte[] value) { - this(type, key, value, false); + public FilteredData(String sourceName, String typeId, byte[] key, byte[] value) { + this(sourceName, typeId, key, value, false); } - public FilteredData(String type, byte[] key, byte[] value, boolean isZipped) { + public FilteredData(String nodeName, String typeId, byte[] key, byte[] value, boolean isZipped) { this.key = key; this.value = value; this.isZipped = isZipped; - this.infoTypeId = type; + this.infoTypeId = typeId; + this.sourceName = nodeName; } public String getValueAString() { @@ -69,6 +73,10 @@ public class FilteredData { result.add(new RecordHeader(DataFromTopic.ZIPPED_PROPERTY, null)); } result.add(new RecordHeader(DataFromTopic.TYPE_ID_PROPERTY, infoTypeId.getBytes())); + if (this.sourceName != null && !this.sourceName.isEmpty()) { + result.add(new RecordHeader(DataFromTopic.SOURCE_NAME_PROPERTY, this.sourceName.getBytes())); + } + return result; }