ICS sample producer and consumer
[nonrtric.git] / sample-services / ics-producer-consumer / producer / src / main / java / com / demo / producer / repository / Job.java
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  *
5  * Copyright (C) 2024: OpenInfra Foundation Europe
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 com.demo.producer.repository;
22
23 import com.fasterxml.jackson.annotation.JsonProperty;
24
25 import lombok.Builder;
26 import lombok.EqualsAndHashCode;
27 import lombok.Getter;
28 import lombok.ToString;
29
30 @ToString
31 public class Job {
32     @Builder
33     public static class Parameters {
34
35         @Builder
36         @EqualsAndHashCode
37         public static class KafkaDeliveryInfo {
38             @Getter
39             private String topic;
40
41             @Getter
42             private String bootStrapServers;
43
44             @JsonProperty(value = "numberOfMessages")
45             @Getter
46             private int numberOfMessages;
47         }
48
49         @Getter
50         private KafkaDeliveryInfo deliveryInfo;
51     }
52
53     @Getter
54     private final String id;
55
56     @Getter
57     private final InfoType type;
58
59     @Getter
60     private final String owner;
61
62     @Getter
63     private final Parameters parameters;
64
65     public Job(String id, InfoType type, String owner, Parameters parameters) {
66         this.id = id;
67         this.type = type;
68         this.owner = owner;
69         this.parameters = parameters;
70     }
71 }