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 Integer initRetryIntervalSec;
36 private Integer initMaxIntervalSec;
37 private ComponentArtifactTypesConfig distribNotifServiceArtifactTypes;
38 private ComponentArtifactTypesConfig distribNotifResourceArtifactTypes;
39 private String uebPublicKey;
40 private String uebSecretKey;
41 private List<String> environments;
42 private DistributionStatusTopicConfig distributionStatusTopic;
43 private CreateTopicConfig createTopic;
44 private boolean startDistributionEngine;
45 private DistributionNotificationTopicConfig distributionNotificationTopic;
46 private Integer defaultArtifactInstallationTimeout = 60;
47 private Integer currentArtifactInstallationTimeout = 120;
48 private boolean useHttpsWithDmaap;
49 private ExternalServiceConfig aaiConfig;
50 private ExternalServiceConfig msoConfig;
51 private Integer opEnvRecoveryIntervalSec;
52 private Integer allowedTimeBeforeStaleSec;
54 public List<String> getUebServers() {
58 public void setUebServers(List<String> uebServers) {
59 this.uebServers = uebServers;
62 public String getDistributionNotifTopicName() {
63 return distributionNotifTopicName;
66 public void setDistributionNotifTopicName(String distributionNotifTopicName) {
67 this.distributionNotifTopicName = distributionNotifTopicName;
70 public String getDistributionStatusTopicName() {
71 return distributionStatusTopicName;
74 public void setDistributionStatusTopicName(String distributionStatusTopicName) {
75 this.distributionStatusTopicName = distributionStatusTopicName;
78 public Integer getInitRetryIntervalSec() {
79 return initRetryIntervalSec;
82 public void setInitRetryIntervalSec(Integer initRetryIntervalSec) {
83 this.initRetryIntervalSec = initRetryIntervalSec;
86 public ComponentArtifactTypesConfig getDistribNotifServiceArtifactTypes() {
87 return distribNotifServiceArtifactTypes;
90 public void setDistribNotifServiceArtifactTypes(ComponentArtifactTypesConfig distribNotifServiceArtifactTypes) {
91 this.distribNotifServiceArtifactTypes = distribNotifServiceArtifactTypes;
94 public ComponentArtifactTypesConfig getDistribNotifResourceArtifactTypes() {
95 return distribNotifResourceArtifactTypes;
98 public void setDistribNotifResourceArtifactTypes(ComponentArtifactTypesConfig distribNotifResourceArtifactTypes) {
99 this.distribNotifResourceArtifactTypes = distribNotifResourceArtifactTypes;
102 public String getUebPublicKey() {
106 public void setUebPublicKey(String uebPublicKey) {
107 this.uebPublicKey = uebPublicKey;
110 public String getUebSecretKey() {
114 public void setUebSecretKey(String uebSecretKey) {
115 this.uebSecretKey = uebSecretKey;
118 public List<String> getEnvironments() {
122 public void setEnvironments(List<String> environments) {
123 Set<String> set = new HashSet<>();
124 if (environments != null) {
125 set.addAll(environments);
126 this.environments = new ArrayList<>(set);
128 this.environments = null;
132 public DistributionStatusTopicConfig getDistributionStatusTopic() {
133 return distributionStatusTopic;
136 public void setDistributionStatusTopic(DistributionStatusTopicConfig distributionStatusTopic) {
137 this.distributionStatusTopic = distributionStatusTopic;
140 public Integer getInitMaxIntervalSec() {
141 return initMaxIntervalSec;
144 public void setInitMaxIntervalSec(Integer initMaxIntervalSec) {
145 this.initMaxIntervalSec = initMaxIntervalSec;
148 public CreateTopicConfig getCreateTopic() {
152 public void setCreateTopic(CreateTopicConfig createTopic) {
153 this.createTopic = createTopic;
156 public boolean isStartDistributionEngine() {
157 return startDistributionEngine;
160 public void setStartDistributionEngine(boolean startDistributionEngine) {
161 this.startDistributionEngine = startDistributionEngine;
164 public DistributionNotificationTopicConfig getDistributionNotificationTopic() {
165 return distributionNotificationTopic;
168 public void setDistributionNotificationTopic(DistributionNotificationTopicConfig distributionNotificationTopic) {
169 this.distributionNotificationTopic = distributionNotificationTopic;
172 public int getDefaultArtifactInstallationTimeout() {
173 return defaultArtifactInstallationTimeout;
176 public void setDefaultArtifactInstallationTimeout(int defaultArtifactInstallationTimeout) {
177 this.defaultArtifactInstallationTimeout = defaultArtifactInstallationTimeout;
180 public int getCurrentArtifactInstallationTimeout() {
181 return currentArtifactInstallationTimeout;
184 public void setCurrentArtifactInstallationTimeout(int currentArtifactInstallationTimeout) {
185 this.currentArtifactInstallationTimeout = currentArtifactInstallationTimeout;
188 public boolean isUseHttpsWithDmaap() {
189 return useHttpsWithDmaap;
192 public void setUseHttpsWithDmaap(boolean useHttpsWithDmaap) {
193 this.useHttpsWithDmaap = useHttpsWithDmaap;
196 public Integer getOpEnvRecoveryIntervalSec() {
197 return opEnvRecoveryIntervalSec;
200 public void setOpEnvRecoveryIntervalSec(Integer opEnvRecoveryIntervalSec) {
201 this.opEnvRecoveryIntervalSec = opEnvRecoveryIntervalSec;
204 public Integer getAllowedTimeBeforeStaleSec() {
205 return allowedTimeBeforeStaleSec;
208 public void setAllowedTimeBeforeStaleSec(Integer allowedTimeBeforeStaleSec) {
209 this.allowedTimeBeforeStaleSec = allowedTimeBeforeStaleSec;
212 public ExternalServiceConfig getAaiConfig() {
216 public void setAaiConfig(ExternalServiceConfig aaiConfig) {
217 this.aaiConfig = aaiConfig;
220 public ExternalServiceConfig getMsoConfig() {
224 public void setMsoConfig(ExternalServiceConfig msoConfig) {
225 this.msoConfig = msoConfig;
228 public enum ArtifcatTypeEnum {
229 MURANO_PKG("MURANO-PKG"), HEAT("HEAT"), DG_XML("DG_XML");
232 private ArtifcatTypeEnum(String value) {
236 public String getValue() {
241 public static class DistribNotifServiceArtifacts {
243 Map<String, Object> service;
244 Map<String, Object> resource;
246 public Map<String, Object> getService() {
250 public void setService(Map<String, Object> service) {
251 this.service = service;
254 public Map<String, Object> getResource() {
258 public void setResource(Map<String, Object> resource) {
259 this.resource = resource;
263 public static class NotifArtifactTypes {
266 List<String> lifecycle;
268 public List<String> getInfo() {
272 public void setInfo(List<String> info) {
276 public List<String> getLifecycle() {
280 public void setLifecycle(List<String> lifecycle) {
281 this.lifecycle = lifecycle;
285 public static class NotifArtifactTypesResource {
287 List<ArtifcatTypeEnum> lifecycle;
290 public static class CreateTopicConfig {
292 private Integer partitionCount;
293 private Integer replicationCount;
295 public Integer getPartitionCount() {
296 return partitionCount;
299 public void setPartitionCount(Integer partitionCount) {
300 this.partitionCount = partitionCount;
303 public Integer getReplicationCount() {
304 return replicationCount;
307 public void setReplicationCount(Integer replicationCount) {
308 this.replicationCount = replicationCount;
312 public String toString() {
313 return "CreateTopicConfig [partitionCount=" + partitionCount + ", replicationCount=" + replicationCount + "]";
317 public static class EnvironmentConfig {
320 private List<String> uebServers;
322 public String getName() {
326 public void setName(String name) {
330 public List<String> getUebServers() {
334 public void setUebServers(List<String> uebServers) {
335 this.uebServers = uebServers;
339 public String toString() {
340 return "EnvironmentConfig [name=" + name + ", uebServers=" + uebServers + "]";
344 public static class DistributionStatusTopicConfig {
346 private Integer pollingIntervalSec;
347 private Integer fetchTimeSec;
348 private String consumerGroup;
349 private String consumerId;
351 public Integer getPollingIntervalSec() {
352 return pollingIntervalSec;
355 public void setPollingIntervalSec(Integer pollingIntervalSec) {
356 this.pollingIntervalSec = pollingIntervalSec;
359 public Integer getFetchTimeSec() {
363 public void setFetchTimeSec(Integer fetchTimeSec) {
364 this.fetchTimeSec = fetchTimeSec;
367 public String getConsumerGroup() {
368 return consumerGroup;
371 public void setConsumerGroup(String consumerGroup) {
372 this.consumerGroup = consumerGroup;
375 public String getConsumerId() {
379 public void setConsumerId(String consumerId) {
380 this.consumerId = consumerId;
384 public String toString() {
385 return "DistributionStatusTopicConfig [pollingIntervalSec=" + pollingIntervalSec + ", fetchTimeSec=" + fetchTimeSec + ", consumerGroup="
386 + consumerGroup + ", consumerId=" + consumerId + "]";
390 public static class DistributionNotificationTopicConfig {
392 private Integer maxWaitingAfterSendingSeconds;
393 private Integer maxThreadPoolSize;
394 private Integer minThreadPoolSize;
396 public Integer getMaxWaitingAfterSendingSeconds() {
397 return maxWaitingAfterSendingSeconds;
400 public void setMaxWaitingAfterSendingSeconds(Integer maxWaitingAfterSendingSeconds) {
401 this.maxWaitingAfterSendingSeconds = maxWaitingAfterSendingSeconds;
404 public Integer getMaxThreadPoolSize() {
405 return maxThreadPoolSize;
408 public void setMaxThreadPoolSize(Integer maxThreadPoolSize) {
409 this.maxThreadPoolSize = maxThreadPoolSize;
412 public Integer getMinThreadPoolSize() {
413 return minThreadPoolSize;
416 public void setMinThreadPoolSize(Integer minThreadPoolSize) {
417 this.minThreadPoolSize = minThreadPoolSize;
421 public String toString() {
422 return "DistributionNotificationTopicConfig [maxWaitingAfterSendingSeconds=" + maxWaitingAfterSendingSeconds + ", maxThreadPoolSize="
423 + maxThreadPoolSize + ", minThreadPoolSize=" + minThreadPoolSize + "]";
427 public static class ComponentArtifactTypesConfig {
429 private List<String> info;
430 private List<String> lifecycle;
432 public List<String> getInfo() {
436 public void setInfo(List<String> info) {
440 public List<String> getLifecycle() {
444 public void setLifecycle(List<String> lifecycle) {
445 this.lifecycle = lifecycle;
449 public String toString() {
450 return "ArtifactTypesConfig [info=" + info + ", lifecycle=" + lifecycle + "]";