[sdc] update to the current code base
[sdc.git] / common-app-api / src / main / java / org / openecomp / sdc / be / config / DistributionEngineConfiguration.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * SDC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
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.openecomp.sdc.be.config;
22
23 import java.util.ArrayList;
24 import java.util.HashSet;
25 import java.util.List;
26 import java.util.Map;
27 import java.util.Set;
28
29 import org.openecomp.sdc.common.api.BasicConfiguration;
30
31 public class DistributionEngineConfiguration extends BasicConfiguration {
32
33         private List<String> uebServers;
34
35         private String distributionNotifTopicName;
36
37         private String distributionStatusTopicName;
38
39         private Integer initRetryIntervalSec;
40
41         private Integer initMaxIntervalSec;
42
43         private ComponentArtifactTypesConfig distribNotifServiceArtifactTypes;
44
45         private ComponentArtifactTypesConfig distribNotifResourceArtifactTypes;
46
47         // private List<String> distribNotifServiceInfoArtifactTypes;
48
49         // private List<String> distribNotifResourceLifecycleArtifactTypes;
50
51         private String uebPublicKey;
52
53         private String uebSecretKey;
54
55         private List<String> environments;
56
57         private DistributionStatusTopicConfig distributionStatusTopic;
58
59         private CreateTopicConfig createTopic;
60
61         private boolean startDistributionEngine;
62
63         private DistributionNotificationTopicConfig distributionNotificationTopic;
64
65         private Integer defaultArtifactInstallationTimeout = 60;
66
67         private boolean useHttpsWithDmaap;
68
69         public static class DistribNotifServiceArtifacts {
70
71                 Map<String, Object> service;
72                 Map<String, Object> resource;
73
74                 public Map<String, Object> getService() {
75                         return service;
76                 }
77
78                 public void setService(Map<String, Object> service) {
79                         this.service = service;
80                 }
81
82                 public Map<String, Object> getResource() {
83                         return resource;
84                 }
85
86                 public void setResource(Map<String, Object> resource) {
87                         this.resource = resource;
88                 }
89
90         }
91
92         public static class NotifArtifactTypes {
93
94                 List<String> info;
95                 List<String> lifecycle;
96
97                 public List<String> getInfo() {
98                         return info;
99                 }
100
101                 public void setInfo(List<String> info) {
102                         this.info = info;
103                 }
104
105                 public List<String> getLifecycle() {
106                         return lifecycle;
107                 }
108
109                 public void setLifecycle(List<String> lifecycle) {
110                         this.lifecycle = lifecycle;
111                 }
112
113         }
114
115         public static class NotifArtifactTypesResource {
116
117                 List<ArtifcatTypeEnum> lifecycle;
118
119         }
120
121         public static enum ArtifcatTypeEnum {
122
123                 MURANO_PKG("MURANO-PKG"), HEAT("HEAT"), DG_XML("DG_XML");
124
125                 String value;
126
127                 private ArtifcatTypeEnum(String value) {
128                         this.value = value;
129                 }
130
131                 public String getValue() {
132
133                         return value;
134                 }
135         }
136
137         public List<String> getUebServers() {
138                 return uebServers;
139         }
140
141         public void setUebServers(List<String> uebServers) {
142                 this.uebServers = uebServers;
143         }
144
145         public String getDistributionNotifTopicName() {
146                 return distributionNotifTopicName;
147         }
148
149         public void setDistributionNotifTopicName(String distributionNotifTopicName) {
150                 this.distributionNotifTopicName = distributionNotifTopicName;
151         }
152
153         public String getDistributionStatusTopicName() {
154                 return distributionStatusTopicName;
155         }
156
157         public void setDistributionStatusTopicName(String distributionStatusTopicName) {
158                 this.distributionStatusTopicName = distributionStatusTopicName;
159         }
160
161         public Integer getInitRetryIntervalSec() {
162                 return initRetryIntervalSec;
163         }
164
165         public void setInitRetryIntervalSec(Integer initRetryIntervalSec) {
166                 this.initRetryIntervalSec = initRetryIntervalSec;
167         }
168
169         public ComponentArtifactTypesConfig getDistribNotifServiceArtifactTypes() {
170                 return distribNotifServiceArtifactTypes;
171         }
172
173         public void setDistribNotifServiceArtifactTypes(ComponentArtifactTypesConfig distribNotifServiceArtifactTypes) {
174                 this.distribNotifServiceArtifactTypes = distribNotifServiceArtifactTypes;
175         }
176
177         public ComponentArtifactTypesConfig getDistribNotifResourceArtifactTypes() {
178                 return distribNotifResourceArtifactTypes;
179         }
180
181         public void setDistribNotifResourceArtifactTypes(ComponentArtifactTypesConfig distribNotifResourceArtifactTypes) {
182                 this.distribNotifResourceArtifactTypes = distribNotifResourceArtifactTypes;
183         }
184
185         public String getUebPublicKey() {
186                 return uebPublicKey;
187         }
188
189         public void setUebPublicKey(String uebPublicKey) {
190                 this.uebPublicKey = uebPublicKey;
191         }
192
193         public String getUebSecretKey() {
194                 return uebSecretKey;
195         }
196
197         public void setUebSecretKey(String uebSecretKey) {
198                 this.uebSecretKey = uebSecretKey;
199         }
200
201         public List<String> getEnvironments() {
202                 return environments;
203         }
204
205         public void setEnvironments(List<String> environments) {
206
207                 Set<String> set = new HashSet<String>();
208                 if (environments != null) {
209                         set.addAll(environments);
210                         this.environments = new ArrayList<String>(set);
211                 } else {
212                         this.environments = null;
213                 }
214
215         }
216
217         public DistributionStatusTopicConfig getDistributionStatusTopic() {
218                 return distributionStatusTopic;
219         }
220
221         public void setDistributionStatusTopic(DistributionStatusTopicConfig distributionStatusTopic) {
222                 this.distributionStatusTopic = distributionStatusTopic;
223         }
224
225         public Integer getInitMaxIntervalSec() {
226                 return initMaxIntervalSec;
227         }
228
229         public void setInitMaxIntervalSec(Integer initMaxIntervalSec) {
230                 this.initMaxIntervalSec = initMaxIntervalSec;
231         }
232
233         public CreateTopicConfig getCreateTopic() {
234                 return createTopic;
235         }
236
237         public void setCreateTopic(CreateTopicConfig createTopic) {
238                 this.createTopic = createTopic;
239         }
240
241         public boolean isStartDistributionEngine() {
242                 return startDistributionEngine;
243         }
244
245         public void setStartDistributionEngine(boolean startDistributionEngine) {
246                 this.startDistributionEngine = startDistributionEngine;
247         }
248
249         public DistributionNotificationTopicConfig getDistributionNotificationTopic() {
250                 return distributionNotificationTopic;
251         }
252
253         public void setDistributionNotificationTopic(DistributionNotificationTopicConfig distributionNotificationTopic) {
254                 this.distributionNotificationTopic = distributionNotificationTopic;
255         }
256
257         public int getDefaultArtifactInstallationTimeout() {
258                 return defaultArtifactInstallationTimeout;
259         }
260
261         public void setDefaultArtifactInstallationTimeout(int defaultArtifactInstallationTimeout) {
262                 this.defaultArtifactInstallationTimeout = defaultArtifactInstallationTimeout;
263         }
264
265         public boolean isUseHttpsWithDmaap() {
266                 return useHttpsWithDmaap;
267         }
268
269         public void setUseHttpsWithDmaap(boolean useHttpsWithDmaap) {
270                 this.useHttpsWithDmaap = useHttpsWithDmaap;
271         }
272
273         public static class CreateTopicConfig {
274
275                 private Integer partitionCount;
276                 private Integer replicationCount;
277
278                 public Integer getPartitionCount() {
279                         return partitionCount;
280                 }
281
282                 public void setPartitionCount(Integer partitionCount) {
283                         this.partitionCount = partitionCount;
284                 }
285
286                 public Integer getReplicationCount() {
287                         return replicationCount;
288                 }
289
290                 public void setReplicationCount(Integer replicationCount) {
291                         this.replicationCount = replicationCount;
292                 }
293
294                 @Override
295                 public String toString() {
296                         return "CreateTopicConfig [partitionCount=" + partitionCount + ", replicationCount=" + replicationCount
297                                         + "]";
298                 }
299
300         }
301
302         public static class EnvironmentConfig {
303
304                 private String name;
305                 private List<String> uebServers;
306
307                 public String getName() {
308                         return name;
309                 }
310
311                 public void setName(String name) {
312                         this.name = name;
313                 }
314
315                 public List<String> getUebServers() {
316                         return uebServers;
317                 }
318
319                 public void setUebServers(List<String> uebServers) {
320                         this.uebServers = uebServers;
321                 }
322
323                 @Override
324                 public String toString() {
325                         return "EnvironmentConfig [name=" + name + ", uebServers=" + uebServers + "]";
326                 }
327
328         }
329
330         public static class DistributionStatusTopicConfig {
331
332                 private Integer pollingIntervalSec;
333                 private Integer fetchTimeSec;
334                 private String consumerGroup;
335                 private String consumerId;
336
337                 public Integer getPollingIntervalSec() {
338                         return pollingIntervalSec;
339                 }
340
341                 public void setPollingIntervalSec(Integer pollingIntervalSec) {
342                         this.pollingIntervalSec = pollingIntervalSec;
343                 }
344
345                 public Integer getFetchTimeSec() {
346                         return fetchTimeSec;
347                 }
348
349                 public void setFetchTimeSec(Integer fetchTimeSec) {
350                         this.fetchTimeSec = fetchTimeSec;
351                 }
352
353                 public String getConsumerGroup() {
354                         return consumerGroup;
355                 }
356
357                 public void setConsumerGroup(String consumerGroup) {
358                         this.consumerGroup = consumerGroup;
359                 }
360
361                 public String getConsumerId() {
362                         return consumerId;
363                 }
364
365                 public void setConsumerId(String consumerId) {
366                         this.consumerId = consumerId;
367                 }
368
369                 @Override
370                 public String toString() {
371                         return "DistributionStatusTopicConfig [pollingIntervalSec=" + pollingIntervalSec + ", fetchTimeSec="
372                                         + fetchTimeSec + ", consumerGroup=" + consumerGroup + ", consumerId=" + consumerId + "]";
373                 }
374
375         }
376
377         public static class DistributionNotificationTopicConfig {
378
379                 private Integer maxWaitingAfterSendingSeconds;
380                 private Integer maxThreadPoolSize;
381                 private Integer minThreadPoolSize;
382
383                 public Integer getMaxWaitingAfterSendingSeconds() {
384                         return maxWaitingAfterSendingSeconds;
385                 }
386
387                 public void setMaxWaitingAfterSendingSeconds(Integer maxWaitingAfterSendingSeconds) {
388                         this.maxWaitingAfterSendingSeconds = maxWaitingAfterSendingSeconds;
389                 }
390
391                 public Integer getMaxThreadPoolSize() {
392                         return maxThreadPoolSize;
393                 }
394
395                 public void setMaxThreadPoolSize(Integer maxThreadPoolSize) {
396                         this.maxThreadPoolSize = maxThreadPoolSize;
397                 }
398
399                 public Integer getMinThreadPoolSize() {
400                         return minThreadPoolSize;
401                 }
402
403                 public void setMinThreadPoolSize(Integer minThreadPoolSize) {
404                         this.minThreadPoolSize = minThreadPoolSize;
405                 }
406
407                 @Override
408                 public String toString() {
409                         return "DistributionNotificationTopicConfig [maxWaitingAfterSendingSeconds=" + maxWaitingAfterSendingSeconds
410                                         + ", maxThreadPoolSize=" + maxThreadPoolSize + ", minThreadPoolSize=" + minThreadPoolSize + "]";
411                 }
412
413         }
414
415         public static class ComponentArtifactTypesConfig {
416
417                 private List<String> info;
418                 private List<String> lifecycle;
419
420                 public List<String> getInfo() {
421                         return info;
422                 }
423
424                 public void setInfo(List<String> info) {
425                         this.info = info;
426                 }
427
428                 public List<String> getLifecycle() {
429                         return lifecycle;
430                 }
431
432                 public void setLifecycle(List<String> lifecycle) {
433                         this.lifecycle = lifecycle;
434                 }
435
436                 @Override
437                 public String toString() {
438                         return "ArtifactTypesConfig [info=" + info + ", lifecycle=" + lifecycle + "]";
439                 }
440
441         }
442
443 }