Standalone TCA with EELF Logger
[dcaegen2/analytics/tca-gen2.git] / dcae-analytics / dcae-analytics-model / src / main / java / org / onap / dcae / analytics / model / configbindingservice / BaseConfigBindingServiceProperties.java
1 /*
2  * ================================================================================
3  * Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  * ============LICENSE_END=========================================================
17  *
18  */
19
20 package org.onap.dcae.analytics.model.configbindingservice;
21
22 import lombok.Data;
23 import lombok.EqualsAndHashCode;
24 import lombok.Getter;
25 import lombok.RequiredArgsConstructor;
26 import lombok.Setter;
27 import lombok.ToString;
28
29 import java.util.LinkedHashMap;
30 import java.util.List;
31 import java.util.Map;
32
33 /**
34  * Base call for Controller Config Binding Service Properties. Other analytics components
35  * must extend this base class and add properties specific to their requirements
36  * <p>NOTE: The base class supports all standard config binding service properties and additional custom properties</p>
37  *
38  * @author Rajiv Singla
39  */
40 @Data
41 public abstract class BaseConfigBindingServiceProperties implements ConfigBindingServiceModel {
42
43     private static final long serialVersionUID = 1L;
44
45     protected Map<String, List<String>> servicesCalls = new LinkedHashMap<>();
46     protected Map<String, PublisherDetails> streamsPublishes = new LinkedHashMap<>();
47     protected Map<String, SubscriberDetails> streamsSubscribes = new LinkedHashMap<>();
48
49     /**
50      * Publisher and Subscriber common properties
51      */
52     @Data
53     @ToString(exclude = "aafPassword")
54     public static class PubSubCommonDetails implements ConfigBindingServiceModel {
55
56         private static final long serialVersionUID = 1L;
57
58         private String type;
59         private String aafUsername;
60         private String aafPassword;
61         private DmaapInfo dmaapInfo;
62
63         // custom additional properties
64         private String proxyUrl;
65         private Boolean ignoreSSLValidation;
66
67     }
68
69     /**
70      * Publisher Details
71      */
72     @Getter
73     @Setter
74     @RequiredArgsConstructor
75     @ToString(callSuper = true)
76     @EqualsAndHashCode(callSuper = true)
77     public static class PublisherDetails extends PubSubCommonDetails {
78
79         private static final long serialVersionUID = 1L;
80
81     }
82
83
84     /**
85      * Subscriber Details
86      */
87     @Getter
88     @Setter
89     @RequiredArgsConstructor
90     @ToString(callSuper = true)
91     @EqualsAndHashCode(callSuper = true)
92     public static class SubscriberDetails extends PubSubCommonDetails {
93
94         private static final long serialVersionUID = 1L;
95
96         // custom subscriber properties
97         private String consumerGroup;
98         private List<String> consumerIds;
99         private Integer messageLimit;
100         private Integer timeout;
101
102         // custom polling configuration
103         private Polling polling;
104     }
105
106     /**
107      * DMaaP Info
108      */
109     @Data
110     public static class DmaapInfo implements ConfigBindingServiceModel {
111
112         private static final long serialVersionUID = 1L;
113
114         private String clientRole;
115         private String clientId;
116         private String location;
117         private String topicUrl;
118
119     }
120
121
122     /**
123      * Polling Details
124      */
125     @Data
126     public static class Polling implements ConfigBindingServiceModel {
127
128         private static final long serialVersionUID = 1L;
129
130         private Integer fixedRate;
131         private AutoAdjusting autoAdjusting;
132
133     }
134
135
136     /**
137      * Auto Adjusting Polling Details
138      */
139     @Data
140     public static class AutoAdjusting implements ConfigBindingServiceModel {
141
142         private static final long serialVersionUID = 1L;
143
144         private Integer min;
145         private Integer stepUp;
146         private Integer max;
147         private Integer stepDown;
148
149     }
150
151
152 }