2 * ============LICENSE_START=======================================================
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
20 package org.openecomp.sdc.be.config;
22 import java.util.ArrayList;
23 import java.util.HashSet;
24 import java.util.List;
27 import org.openecomp.sdc.common.api.BasicConfiguration;
28 import org.openecomp.sdc.common.http.config.ExternalServiceConfig;
30 public class DistributionEngineConfiguration extends BasicConfiguration {
32 private List<String> uebServers;
33 private String distributionNotifTopicName;
34 private String distributionStatusTopicName;
35 private String kafkaBootStrapServers;
36 private Integer initRetryIntervalSec;
37 private Integer initMaxIntervalSec;
38 private ComponentArtifactTypesConfig distribNotifServiceArtifactTypes;
39 private ComponentArtifactTypesConfig distribNotifResourceArtifactTypes;
40 private String uebPublicKey;
41 private String uebSecretKey;
42 private List<String> environments;
43 private DistributionStatusTopicConfig distributionStatusTopic;
44 private CreateTopicConfig createTopic;
45 private boolean startDistributionEngine;
46 private DistributionNotificationTopicConfig distributionNotificationTopic;
47 private Integer defaultArtifactInstallationTimeout = 60;
48 private Integer currentArtifactInstallationTimeout = 120;
49 private boolean useHttpsWithDmaap;
50 private ExternalServiceConfig aaiConfig;
51 private ExternalServiceConfig msoConfig;
52 private Integer opEnvRecoveryIntervalSec;
53 private Integer allowedTimeBeforeStaleSec;
55 public List<String> getUebServers() {
59 public void setUebServers(List<String> uebServers) {
60 this.uebServers = uebServers;
63 public String getDistributionNotifTopicName() {
64 return distributionNotifTopicName;
67 public void setDistributionNotifTopicName(String distributionNotifTopicName) {
68 this.distributionNotifTopicName = distributionNotifTopicName;
71 public String getDistributionStatusTopicName() {
72 return distributionStatusTopicName;
75 public void setDistributionStatusTopicName(String distributionStatusTopicName) {
76 this.distributionStatusTopicName = distributionStatusTopicName;
79 public String getKafkaBootStrapServers() {
80 return kafkaBootStrapServers;
83 public void setKafkaBootStrapServers(String kafkaBootStrapServers) {
84 this.kafkaBootStrapServers = kafkaBootStrapServers;
87 public Integer getInitRetryIntervalSec() {
88 return initRetryIntervalSec;
91 public void setInitRetryIntervalSec(Integer initRetryIntervalSec) {
92 this.initRetryIntervalSec = initRetryIntervalSec;
95 public ComponentArtifactTypesConfig getDistribNotifServiceArtifactTypes() {
96 return distribNotifServiceArtifactTypes;
99 public void setDistribNotifServiceArtifactTypes(ComponentArtifactTypesConfig distribNotifServiceArtifactTypes) {
100 this.distribNotifServiceArtifactTypes = distribNotifServiceArtifactTypes;
103 public ComponentArtifactTypesConfig getDistribNotifResourceArtifactTypes() {
104 return distribNotifResourceArtifactTypes;
107 public void setDistribNotifResourceArtifactTypes(ComponentArtifactTypesConfig distribNotifResourceArtifactTypes) {
108 this.distribNotifResourceArtifactTypes = distribNotifResourceArtifactTypes;
111 public String getUebPublicKey() {
115 public void setUebPublicKey(String uebPublicKey) {
116 this.uebPublicKey = uebPublicKey;
119 public String getUebSecretKey() {
123 public void setUebSecretKey(String uebSecretKey) {
124 this.uebSecretKey = uebSecretKey;
127 public List<String> getEnvironments() {
131 public void setEnvironments(List<String> environments) {
132 Set<String> set = new HashSet<>();
133 if (environments != null) {
134 set.addAll(environments);
135 this.environments = new ArrayList<>(set);
137 this.environments = null;
141 public DistributionStatusTopicConfig getDistributionStatusTopic() {
142 return distributionStatusTopic;
145 public void setDistributionStatusTopic(DistributionStatusTopicConfig distributionStatusTopic) {
146 this.distributionStatusTopic = distributionStatusTopic;
149 public Integer getInitMaxIntervalSec() {
150 return initMaxIntervalSec;
153 public void setInitMaxIntervalSec(Integer initMaxIntervalSec) {
154 this.initMaxIntervalSec = initMaxIntervalSec;
157 public CreateTopicConfig getCreateTopic() {
161 public void setCreateTopic(CreateTopicConfig createTopic) {
162 this.createTopic = createTopic;
165 public boolean isStartDistributionEngine() {
166 return startDistributionEngine;
169 public void setStartDistributionEngine(boolean startDistributionEngine) {
170 this.startDistributionEngine = startDistributionEngine;
173 public DistributionNotificationTopicConfig getDistributionNotificationTopic() {
174 return distributionNotificationTopic;
177 public void setDistributionNotificationTopic(DistributionNotificationTopicConfig distributionNotificationTopic) {
178 this.distributionNotificationTopic = distributionNotificationTopic;
181 public int getDefaultArtifactInstallationTimeout() {
182 return defaultArtifactInstallationTimeout;
185 public void setDefaultArtifactInstallationTimeout(int defaultArtifactInstallationTimeout) {
186 this.defaultArtifactInstallationTimeout = defaultArtifactInstallationTimeout;
189 public int getCurrentArtifactInstallationTimeout() {
190 return currentArtifactInstallationTimeout;
193 public void setCurrentArtifactInstallationTimeout(int currentArtifactInstallationTimeout) {
194 this.currentArtifactInstallationTimeout = currentArtifactInstallationTimeout;
197 public boolean isUseHttpsWithDmaap() {
198 return useHttpsWithDmaap;
201 public void setUseHttpsWithDmaap(boolean useHttpsWithDmaap) {
202 this.useHttpsWithDmaap = useHttpsWithDmaap;
205 public Integer getOpEnvRecoveryIntervalSec() {
206 return opEnvRecoveryIntervalSec;
209 public void setOpEnvRecoveryIntervalSec(Integer opEnvRecoveryIntervalSec) {
210 this.opEnvRecoveryIntervalSec = opEnvRecoveryIntervalSec;
213 public Integer getAllowedTimeBeforeStaleSec() {
214 return allowedTimeBeforeStaleSec;
217 public void setAllowedTimeBeforeStaleSec(Integer allowedTimeBeforeStaleSec) {
218 this.allowedTimeBeforeStaleSec = allowedTimeBeforeStaleSec;
221 public ExternalServiceConfig getAaiConfig() {
225 public void setAaiConfig(ExternalServiceConfig aaiConfig) {
226 this.aaiConfig = aaiConfig;
229 public ExternalServiceConfig getMsoConfig() {
233 public void setMsoConfig(ExternalServiceConfig msoConfig) {
234 this.msoConfig = msoConfig;
237 public enum ArtifcatTypeEnum {
238 MURANO_PKG("MURANO-PKG"), HEAT("HEAT"), DG_XML("DG_XML");
241 private ArtifcatTypeEnum(String value) {
245 public String getValue() {
250 public static class DistribNotifServiceArtifacts {
252 Map<String, Object> service;
253 Map<String, Object> resource;
255 public Map<String, Object> getService() {
259 public void setService(Map<String, Object> service) {
260 this.service = service;
263 public Map<String, Object> getResource() {
267 public void setResource(Map<String, Object> resource) {
268 this.resource = resource;
272 public static class NotifArtifactTypes {
275 List<String> lifecycle;
277 public List<String> getInfo() {
281 public void setInfo(List<String> info) {
285 public List<String> getLifecycle() {
289 public void setLifecycle(List<String> lifecycle) {
290 this.lifecycle = lifecycle;
294 public static class NotifArtifactTypesResource {
296 List<ArtifcatTypeEnum> lifecycle;
299 public static class CreateTopicConfig {
301 private Integer partitionCount;
302 private Integer replicationCount;
304 public Integer getPartitionCount() {
305 return partitionCount;
308 public void setPartitionCount(Integer partitionCount) {
309 this.partitionCount = partitionCount;
312 public Integer getReplicationCount() {
313 return replicationCount;
316 public void setReplicationCount(Integer replicationCount) {
317 this.replicationCount = replicationCount;
321 public String toString() {
322 return "CreateTopicConfig [partitionCount=" + partitionCount + ", replicationCount=" + replicationCount + "]";
326 public static class EnvironmentConfig {
329 private List<String> uebServers;
331 public String getName() {
335 public void setName(String name) {
339 public List<String> getUebServers() {
343 public void setUebServers(List<String> uebServers) {
344 this.uebServers = uebServers;
348 public String toString() {
349 return "EnvironmentConfig [name=" + name + ", uebServers=" + uebServers + "]";
353 public static class DistributionStatusTopicConfig {
355 private Integer pollingIntervalSec;
356 private Integer fetchTimeSec;
357 private String consumerGroup;
358 private String consumerId;
360 public Integer getPollingIntervalSec() {
361 return pollingIntervalSec;
364 public void setPollingIntervalSec(Integer pollingIntervalSec) {
365 this.pollingIntervalSec = pollingIntervalSec;
368 public Integer getFetchTimeSec() {
372 public void setFetchTimeSec(Integer fetchTimeSec) {
373 this.fetchTimeSec = fetchTimeSec;
376 public String getConsumerGroup() {
377 return consumerGroup;
380 public void setConsumerGroup(String consumerGroup) {
381 this.consumerGroup = consumerGroup;
384 public String getConsumerId() {
388 public void setConsumerId(String consumerId) {
389 this.consumerId = consumerId;
393 public String toString() {
394 return "DistributionStatusTopicConfig [pollingIntervalSec=" + pollingIntervalSec + ", fetchTimeSec=" + fetchTimeSec + ", consumerGroup="
395 + consumerGroup + ", consumerId=" + consumerId + "]";
399 public static class DistributionNotificationTopicConfig {
401 private Integer maxWaitingAfterSendingSeconds;
402 private Integer maxThreadPoolSize;
403 private Integer minThreadPoolSize;
405 public Integer getMaxWaitingAfterSendingSeconds() {
406 return maxWaitingAfterSendingSeconds;
409 public void setMaxWaitingAfterSendingSeconds(Integer maxWaitingAfterSendingSeconds) {
410 this.maxWaitingAfterSendingSeconds = maxWaitingAfterSendingSeconds;
413 public Integer getMaxThreadPoolSize() {
414 return maxThreadPoolSize;
417 public void setMaxThreadPoolSize(Integer maxThreadPoolSize) {
418 this.maxThreadPoolSize = maxThreadPoolSize;
421 public Integer getMinThreadPoolSize() {
422 return minThreadPoolSize;
425 public void setMinThreadPoolSize(Integer minThreadPoolSize) {
426 this.minThreadPoolSize = minThreadPoolSize;
430 public String toString() {
431 return "DistributionNotificationTopicConfig [maxWaitingAfterSendingSeconds=" + maxWaitingAfterSendingSeconds + ", maxThreadPoolSize="
432 + maxThreadPoolSize + ", minThreadPoolSize=" + minThreadPoolSize + "]";
436 public static class ComponentArtifactTypesConfig {
438 private List<String> info;
439 private List<String> lifecycle;
441 public List<String> getInfo() {
445 public void setInfo(List<String> info) {
449 public List<String> getLifecycle() {
453 public void setLifecycle(List<String> lifecycle) {
454 this.lifecycle = lifecycle;
458 public String toString() {
459 return "ArtifactTypesConfig [info=" + info + ", lifecycle=" + lifecycle + "]";