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