2 * ========================LICENSE_START=================================
5 * Copyright (C) 2023 Nordix Foundation
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ========================LICENSE_END===================================
21 package org.oran.pmproducer.filter;
23 import com.google.gson.annotations.Expose;
25 import java.util.ArrayList;
26 import java.util.Collection;
28 import lombok.Builder;
32 @Builder(toBuilder = true)
33 public class PmReport {
38 public static class CommonEventHeader {
40 private String domain;
43 private String eventId;
46 private String eventName;
50 private String sourceName;
53 private String reportingEntityName;
56 private long startEpochMicrosec;
59 private long lastEpochMicrosec;
62 private String timeZoneOffset;
64 /* Not reported elements */
68 String vesEventListenerVersion;
71 public static class MeasInfoId {
73 private String sMeasInfoId = "";
76 public static class MeasTypes {
77 public String getMeasType(int pValue) {
78 if (pValue > sMeasTypesList.size()) {
79 return "MeasTypeIndexOutOfBounds:" + pValue;
81 return sMeasTypesList.get(pValue - 1);
85 protected ArrayList<String> sMeasTypesList = new ArrayList<>();
89 @Builder(toBuilder = true)
90 public static class MeasResult {
96 private String sValue;
99 @Builder(toBuilder = true)
100 public static class MeasValuesList {
103 private String measObjInstId;
106 private String suspectFlag;
110 private Collection<MeasResult> measResults;
112 public boolean isEmpty() {
113 return this.measResults.isEmpty();
116 static MeasValuesList emptyList = MeasValuesList.builder().measResults(new ArrayList<>()).build();
118 public static MeasValuesList empty() {
124 @Builder(toBuilder = true)
125 public static class MeasInfoList {
127 private MeasInfoId measInfoId;
130 private MeasTypes measTypes;
133 private Collection<MeasValuesList> measValuesList;
137 @Builder(toBuilder = true)
139 public static class MeasDataCollection {
141 private int granularityPeriod;
144 private String measuredEntityUserName;
147 private String measuredEntityDn;
150 private String measuredEntitySoftwareVersion;
153 private Collection<MeasInfoList> measInfoList;
156 @Builder(toBuilder = true)
158 public static class Perf3gppFields {
160 private String perf3gppFieldsVersion;
163 private MeasDataCollection measDataCollection;
167 @Builder(toBuilder = true)
168 public static class Event {
170 private CommonEventHeader commonEventHeader;
173 private Perf3gppFields perf3gppFields;