Merge "Stepping to springboot 3"
[nonrtric.git] / pmlog / src / main / java / org / oran / pmlog / configuration / ConsumerJobInfo.java
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  * %%
5  * Copyright (C) 2023 Nordix Foundation
6  * %%
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
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
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===================================
19  */
20
21 package org.oran.pmlog.configuration;
22
23 import com.google.gson.annotations.Expose;
24 import com.google.gson.annotations.SerializedName;
25
26 import java.util.ArrayList;
27 import java.util.Collection;
28 import java.util.HashSet;
29 import java.util.Set;
30
31 import lombok.Builder;
32 import lombok.Getter;
33 import lombok.Setter;
34
35 public class ConsumerJobInfo {
36
37     @Getter
38     public static class PmFilterData {
39
40         public static class MeasTypeSpec {
41             @Setter
42             @Getter
43             @Expose
44             String measuredObjClass;
45
46             @Getter
47             @Expose
48             final Set<String> measTypes = new HashSet<>();
49         }
50
51         @Expose
52         final Set<String> sourceNames = new HashSet<>();
53
54         @Expose
55         final Set<String> measObjInstIds = new HashSet<>();
56
57         @Expose
58         final Collection<MeasTypeSpec> measTypeSpecs = new ArrayList<>();
59
60         @Expose
61         final Set<String> measuredEntityDns = new HashSet<>();
62     }
63
64     @Builder
65     public static class KafkaDeliveryInfo {
66         @Getter
67         @Expose
68         private String topic;
69
70         @Getter
71         @Expose
72         private String bootStrapServers;
73     }
74
75     @Builder
76     public static class PmJobParameters {
77
78         public static final String PM_FILTER_TYPE = "pmdata";
79
80         @Getter
81         @Builder.Default
82         @Expose
83         private String filterType = PM_FILTER_TYPE;
84
85         @Getter
86         @Expose
87         private PmFilterData filter;
88
89         @Getter
90         @Expose
91         private KafkaDeliveryInfo deliveryInfo;
92
93     }
94
95     @SerializedName("info_type_id")
96     @Expose
97     public String infoTypeId = "";
98
99     @SerializedName("job_owner")
100     @Expose
101     public String owner = "";
102
103     @SerializedName("job_definition")
104     @Expose
105     public PmJobParameters jobDefinition;
106
107     public ConsumerJobInfo() {}
108
109     public ConsumerJobInfo(String infoTypeId, PmJobParameters jobData, String owner) {
110         this.infoTypeId = infoTypeId;
111         this.jobDefinition = jobData;
112         this.owner = owner;
113     }
114 }