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.onap.config.api.JettySSLUtils;
28 import org.openecomp.sdc.common.api.BasicConfiguration;
29 import org.openecomp.sdc.common.http.config.ExternalServiceConfig;
31 public class DistributionEngineConfiguration extends BasicConfiguration {
33 private List<String> uebServers;
34 private String distributionNotifTopicName;
35 private String distributionStatusTopicName;
36 private String kafkaBootStrapServers;
37 private Integer initRetryIntervalSec;
38 private Integer initMaxIntervalSec;
39 private ComponentArtifactTypesConfig distribNotifServiceArtifactTypes;
40 private ComponentArtifactTypesConfig distribNotifResourceArtifactTypes;
41 private String uebPublicKey;
42 private String uebSecretKey;
43 private List<String> environments;
44 private DistributionStatusTopicConfig distributionStatusTopic;
45 private CreateTopicConfig createTopic;
46 private boolean startDistributionEngine;
47 private DistributionNotificationTopicConfig distributionNotificationTopic;
48 private Integer defaultArtifactInstallationTimeout = 60;
49 private Integer currentArtifactInstallationTimeout = 120;
50 private boolean useHttpsWithDmaap;
51 private ExternalServiceConfig aaiConfig;
52 private ExternalServiceConfig msoConfig;
53 private Integer opEnvRecoveryIntervalSec;
54 private Integer allowedTimeBeforeStaleSec;
56 public List<String> getUebServers() {
60 public void setUebServers(List<String> uebServers) {
61 this.uebServers = uebServers;
64 public String getDistributionNotifTopicName() {
65 return distributionNotifTopicName;
68 public void setDistributionNotifTopicName(String distributionNotifTopicName) {
69 this.distributionNotifTopicName = distributionNotifTopicName;
72 public String getDistributionStatusTopicName() {
73 return distributionStatusTopicName;
76 public void setDistributionStatusTopicName(String distributionStatusTopicName) {
77 this.distributionStatusTopicName = distributionStatusTopicName;
80 public String getKafkaBootStrapServers() {
81 return kafkaBootStrapServers;
84 public void setKafkaBootStrapServers(String kafkaBootStrapServers) {
85 this.kafkaBootStrapServers = kafkaBootStrapServers;
88 public Integer getInitRetryIntervalSec() {
89 return initRetryIntervalSec;
92 public void setInitRetryIntervalSec(Integer initRetryIntervalSec) {
93 this.initRetryIntervalSec = initRetryIntervalSec;
96 public ComponentArtifactTypesConfig getDistribNotifServiceArtifactTypes() {
97 return distribNotifServiceArtifactTypes;
100 public void setDistribNotifServiceArtifactTypes(ComponentArtifactTypesConfig distribNotifServiceArtifactTypes) {
101 this.distribNotifServiceArtifactTypes = distribNotifServiceArtifactTypes;
104 public ComponentArtifactTypesConfig getDistribNotifResourceArtifactTypes() {
105 return distribNotifResourceArtifactTypes;
108 public void setDistribNotifResourceArtifactTypes(ComponentArtifactTypesConfig distribNotifResourceArtifactTypes) {
109 this.distribNotifResourceArtifactTypes = distribNotifResourceArtifactTypes;
112 public String getUebPublicKey() {
116 public void setUebPublicKey(String uebPublicKey) {
117 this.uebPublicKey = uebPublicKey;
120 public String getUebSecretKey() {
124 public void setUebSecretKey(String uebSecretKey) {
125 this.uebSecretKey = uebSecretKey;
128 public List<String> getEnvironments() {
132 public void setEnvironments(List<String> environments) {
133 Set<String> set = new HashSet<>();
134 if (environments != null) {
135 set.addAll(environments);
136 this.environments = new ArrayList<>(set);
138 this.environments = null;
142 public DistributionStatusTopicConfig getDistributionStatusTopic() {
143 return distributionStatusTopic;
146 public void setDistributionStatusTopic(DistributionStatusTopicConfig distributionStatusTopic) {
147 this.distributionStatusTopic = distributionStatusTopic;
150 public Integer getInitMaxIntervalSec() {
151 return initMaxIntervalSec;
154 public void setInitMaxIntervalSec(Integer initMaxIntervalSec) {
155 this.initMaxIntervalSec = initMaxIntervalSec;
158 public CreateTopicConfig getCreateTopic() {
162 public void setCreateTopic(CreateTopicConfig createTopic) {
163 this.createTopic = createTopic;
166 public boolean isStartDistributionEngine() {
167 return startDistributionEngine;
170 public void setStartDistributionEngine(boolean startDistributionEngine) {
171 this.startDistributionEngine = startDistributionEngine;
174 public DistributionNotificationTopicConfig getDistributionNotificationTopic() {
175 return distributionNotificationTopic;
178 public void setDistributionNotificationTopic(DistributionNotificationTopicConfig distributionNotificationTopic) {
179 this.distributionNotificationTopic = distributionNotificationTopic;
182 public int getDefaultArtifactInstallationTimeout() {
183 return defaultArtifactInstallationTimeout;
186 public void setDefaultArtifactInstallationTimeout(int defaultArtifactInstallationTimeout) {
187 this.defaultArtifactInstallationTimeout = defaultArtifactInstallationTimeout;
190 public int getCurrentArtifactInstallationTimeout() {
191 return currentArtifactInstallationTimeout;
194 public void setCurrentArtifactInstallationTimeout(int currentArtifactInstallationTimeout) {
195 this.currentArtifactInstallationTimeout = currentArtifactInstallationTimeout;
198 public boolean isUseHttpsWithDmaap() {
199 return useHttpsWithDmaap;
202 public void setUseHttpsWithDmaap(boolean useHttpsWithDmaap) {
203 this.useHttpsWithDmaap = useHttpsWithDmaap;
206 public Integer getOpEnvRecoveryIntervalSec() {
207 return opEnvRecoveryIntervalSec;
210 public void setOpEnvRecoveryIntervalSec(Integer opEnvRecoveryIntervalSec) {
211 this.opEnvRecoveryIntervalSec = opEnvRecoveryIntervalSec;
214 public Integer getAllowedTimeBeforeStaleSec() {
215 return allowedTimeBeforeStaleSec;
218 public void setAllowedTimeBeforeStaleSec(Integer allowedTimeBeforeStaleSec) {
219 this.allowedTimeBeforeStaleSec = allowedTimeBeforeStaleSec;
222 public ExternalServiceConfig getAaiConfig() {
226 public void setAaiConfig(ExternalServiceConfig aaiConfig) {
227 this.aaiConfig = aaiConfig;
230 public ExternalServiceConfig getMsoConfig() {
234 public void setMsoConfig(ExternalServiceConfig msoConfig) {
235 this.msoConfig = msoConfig;
238 public enum ArtifcatTypeEnum {
239 MURANO_PKG("MURANO-PKG"), HEAT("HEAT"), DG_XML("DG_XML");
242 private ArtifcatTypeEnum(String value) {
246 public String getValue() {
251 public static class DistribNotifServiceArtifacts {
253 Map<String, Object> service;
254 Map<String, Object> resource;
256 public Map<String, Object> getService() {
260 public void setService(Map<String, Object> service) {
261 this.service = service;
264 public Map<String, Object> getResource() {
268 public void setResource(Map<String, Object> resource) {
269 this.resource = resource;
273 public static class NotifArtifactTypes {
276 List<String> lifecycle;
278 public List<String> getInfo() {
282 public void setInfo(List<String> info) {
286 public List<String> getLifecycle() {
290 public void setLifecycle(List<String> lifecycle) {
291 this.lifecycle = lifecycle;
295 public static class NotifArtifactTypesResource {
297 List<ArtifcatTypeEnum> lifecycle;
300 public static class CreateTopicConfig {
302 private Integer partitionCount;
303 private Integer replicationCount;
305 public Integer getPartitionCount() {
306 return partitionCount;
309 public void setPartitionCount(Integer partitionCount) {
310 this.partitionCount = partitionCount;
313 public Integer getReplicationCount() {
314 return replicationCount;
317 public void setReplicationCount(Integer replicationCount) {
318 this.replicationCount = replicationCount;
322 public String toString() {
323 return "CreateTopicConfig [partitionCount=" + partitionCount + ", replicationCount=" + replicationCount + "]";
327 public static class EnvironmentConfig {
330 private List<String> uebServers;
332 public String getName() {
336 public void setName(String name) {
340 public List<String> getUebServers() {
344 public void setUebServers(List<String> uebServers) {
345 this.uebServers = uebServers;
349 public String toString() {
350 return "EnvironmentConfig [name=" + name + ", uebServers=" + uebServers + "]";
354 public static class DistributionStatusTopicConfig {
356 private Integer pollingIntervalSec;
357 private Integer fetchTimeSec;
358 private String consumerGroup;
359 private String consumerId;
361 public Integer getPollingIntervalSec() {
362 return pollingIntervalSec;
365 public void setPollingIntervalSec(Integer pollingIntervalSec) {
366 this.pollingIntervalSec = pollingIntervalSec;
369 public Integer getFetchTimeSec() {
373 public void setFetchTimeSec(Integer fetchTimeSec) {
374 this.fetchTimeSec = fetchTimeSec;
377 public String getConsumerGroup() {
378 return consumerGroup;
381 public void setConsumerGroup(String consumerGroup) {
382 this.consumerGroup = consumerGroup;
385 public String getConsumerId() {
389 public void setConsumerId(String consumerId) {
390 this.consumerId = consumerId;
394 public String toString() {
395 return "DistributionStatusTopicConfig [pollingIntervalSec=" + pollingIntervalSec + ", fetchTimeSec=" + fetchTimeSec + ", consumerGroup="
396 + consumerGroup + ", consumerId=" + consumerId + "]";
400 public static class DistributionNotificationTopicConfig {
402 private Integer maxWaitingAfterSendingSeconds;
403 private Integer maxThreadPoolSize;
404 private Integer minThreadPoolSize;
406 public Integer getMaxWaitingAfterSendingSeconds() {
407 return maxWaitingAfterSendingSeconds;
410 public void setMaxWaitingAfterSendingSeconds(Integer maxWaitingAfterSendingSeconds) {
411 this.maxWaitingAfterSendingSeconds = maxWaitingAfterSendingSeconds;
414 public Integer getMaxThreadPoolSize() {
415 return maxThreadPoolSize;
418 public void setMaxThreadPoolSize(Integer maxThreadPoolSize) {
419 this.maxThreadPoolSize = maxThreadPoolSize;
422 public Integer getMinThreadPoolSize() {
423 return minThreadPoolSize;
426 public void setMinThreadPoolSize(Integer minThreadPoolSize) {
427 this.minThreadPoolSize = minThreadPoolSize;
431 public String toString() {
432 return "DistributionNotificationTopicConfig [maxWaitingAfterSendingSeconds=" + maxWaitingAfterSendingSeconds + ", maxThreadPoolSize="
433 + maxThreadPoolSize + ", minThreadPoolSize=" + minThreadPoolSize + "]";
437 public static class ComponentArtifactTypesConfig {
439 private List<String> info;
440 private List<String> lifecycle;
442 public List<String> getInfo() {
446 public void setInfo(List<String> info) {
450 public List<String> getLifecycle() {
454 public void setLifecycle(List<String> lifecycle) {
455 this.lifecycle = lifecycle;
459 public String toString() {
460 return "ArtifactTypesConfig [info=" + info + ", lifecycle=" + lifecycle + "]";
464 public JettySSLUtils.JettySslConfig getSSLConfig() {
465 return JettySSLUtils.getSSLConfig();