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=========================================================
21 package org.openecomp.sdc.be.config;
23 import org.openecomp.sdc.common.api.BasicConfiguration;
24 import org.openecomp.sdc.common.http.config.ExternalServiceConfig;
28 public class DistributionEngineConfiguration extends BasicConfiguration {
30 private List<String> uebServers;
32 private String distributionNotifTopicName;
34 private String distributionStatusTopicName;
36 private Integer initRetryIntervalSec;
38 private Integer initMaxIntervalSec;
40 private ComponentArtifactTypesConfig distribNotifServiceArtifactTypes;
42 private ComponentArtifactTypesConfig distribNotifResourceArtifactTypes;
44 private String uebPublicKey;
46 private String uebSecretKey;
48 private List<String> environments;
50 private DistributionStatusTopicConfig distributionStatusTopic;
52 private CreateTopicConfig createTopic;
54 private boolean startDistributionEngine;
56 private DistributionNotificationTopicConfig distributionNotificationTopic;
58 private Integer defaultArtifactInstallationTimeout = 60;
60 private Integer currentArtifactInstallationTimeout = 120;
61 private boolean useHttpsWithDmaap;
63 private ExternalServiceConfig aaiConfig;
65 private ExternalServiceConfig msoConfig;
67 private Integer opEnvRecoveryIntervalSec;
69 private Integer allowedTimeBeforeStaleSec;
71 public static class DistribNotifServiceArtifacts {
73 Map<String, Object> service;
74 Map<String, Object> resource;
78 public Map<String, Object> getService() {
82 public void setService(Map<String, Object> service) {
83 this.service = service;
86 public Map<String, Object> getResource() {
90 public void setResource(Map<String, Object> resource) {
91 this.resource = resource;
96 public static class NotifArtifactTypes {
99 List<String> lifecycle;
101 public List<String> getInfo() {
105 public void setInfo(List<String> info) {
109 public List<String> getLifecycle() {
113 public void setLifecycle(List<String> lifecycle) {
114 this.lifecycle = lifecycle;
119 public static class NotifArtifactTypesResource {
121 List<ArtifcatTypeEnum> lifecycle;
125 public enum ArtifcatTypeEnum {
127 MURANO_PKG("MURANO-PKG"), HEAT("HEAT"), DG_XML("DG_XML");
131 private ArtifcatTypeEnum(String value) {
135 public String getValue() {
141 public List<String> getUebServers() {
145 public void setUebServers(List<String> uebServers) {
146 this.uebServers = uebServers;
149 public String getDistributionNotifTopicName() {
150 return distributionNotifTopicName;
153 public void setDistributionNotifTopicName(String distributionNotifTopicName) {
154 this.distributionNotifTopicName = distributionNotifTopicName;
157 public String getDistributionStatusTopicName() {
158 return distributionStatusTopicName;
161 public void setDistributionStatusTopicName(String distributionStatusTopicName) {
162 this.distributionStatusTopicName = distributionStatusTopicName;
165 public Integer getInitRetryIntervalSec() {
166 return initRetryIntervalSec;
169 public void setInitRetryIntervalSec(Integer initRetryIntervalSec) {
170 this.initRetryIntervalSec = initRetryIntervalSec;
173 public ComponentArtifactTypesConfig getDistribNotifServiceArtifactTypes() {
174 return distribNotifServiceArtifactTypes;
177 public void setDistribNotifServiceArtifactTypes(ComponentArtifactTypesConfig distribNotifServiceArtifactTypes) {
178 this.distribNotifServiceArtifactTypes = distribNotifServiceArtifactTypes;
181 public ComponentArtifactTypesConfig getDistribNotifResourceArtifactTypes() {
182 return distribNotifResourceArtifactTypes;
185 public void setDistribNotifResourceArtifactTypes(ComponentArtifactTypesConfig distribNotifResourceArtifactTypes) {
186 this.distribNotifResourceArtifactTypes = distribNotifResourceArtifactTypes;
189 public String getUebPublicKey() {
193 public void setUebPublicKey(String uebPublicKey) {
194 this.uebPublicKey = uebPublicKey;
197 public String getUebSecretKey() {
201 public void setUebSecretKey(String uebSecretKey) {
202 this.uebSecretKey = uebSecretKey;
205 public List<String> getEnvironments() {
209 public void setEnvironments(List<String> environments) {
211 Set<String> set = new HashSet<>();
212 if (environments != null) {
213 set.addAll(environments);
214 this.environments = new ArrayList<>(set);
216 this.environments = null;
221 public DistributionStatusTopicConfig getDistributionStatusTopic() {
222 return distributionStatusTopic;
225 public void setDistributionStatusTopic(DistributionStatusTopicConfig distributionStatusTopic) {
226 this.distributionStatusTopic = distributionStatusTopic;
229 public Integer getInitMaxIntervalSec() {
230 return initMaxIntervalSec;
233 public void setInitMaxIntervalSec(Integer initMaxIntervalSec) {
234 this.initMaxIntervalSec = initMaxIntervalSec;
237 public CreateTopicConfig getCreateTopic() {
241 public void setCreateTopic(CreateTopicConfig createTopic) {
242 this.createTopic = createTopic;
245 public boolean isStartDistributionEngine() {
246 return startDistributionEngine;
249 public void setStartDistributionEngine(boolean startDistributionEngine) {
250 this.startDistributionEngine = startDistributionEngine;
255 public DistributionNotificationTopicConfig getDistributionNotificationTopic() {
256 return distributionNotificationTopic;
259 public void setDistributionNotificationTopic(DistributionNotificationTopicConfig distributionNotificationTopic) {
260 this.distributionNotificationTopic = distributionNotificationTopic;
263 public int getDefaultArtifactInstallationTimeout() {
264 return defaultArtifactInstallationTimeout;
266 public void setDefaultArtifactInstallationTimeout(int defaultArtifactInstallationTimeout) {
267 this.defaultArtifactInstallationTimeout = defaultArtifactInstallationTimeout;
270 public int getCurrentArtifactInstallationTimeout() {
271 return currentArtifactInstallationTimeout;
273 public void setCurrentArtifactInstallationTimeout(int currentArtifactInstallationTimeout) {
274 this.currentArtifactInstallationTimeout = currentArtifactInstallationTimeout;
276 public boolean isUseHttpsWithDmaap() {
277 return useHttpsWithDmaap;
280 public void setUseHttpsWithDmaap(boolean useHttpsWithDmaap) {
281 this.useHttpsWithDmaap = useHttpsWithDmaap;
284 public static class CreateTopicConfig {
286 private Integer partitionCount;
287 private Integer replicationCount;
289 public Integer getPartitionCount() {
290 return partitionCount;
293 public void setPartitionCount(Integer partitionCount) {
294 this.partitionCount = partitionCount;
297 public Integer getReplicationCount() {
298 return replicationCount;
301 public void setReplicationCount(Integer replicationCount) {
302 this.replicationCount = replicationCount;
306 public String toString() {
307 return "CreateTopicConfig [partitionCount=" + partitionCount + ", replicationCount=" + replicationCount
313 public static class EnvironmentConfig {
316 private List<String> uebServers;
318 public String getName() {
322 public void setName(String name) {
326 public List<String> getUebServers() {
330 public void setUebServers(List<String> uebServers) {
331 this.uebServers = uebServers;
335 public String toString() {
336 return "EnvironmentConfig [name=" + name + ", uebServers=" + uebServers + "]";
341 public static class DistributionStatusTopicConfig {
343 private Integer pollingIntervalSec;
344 private Integer fetchTimeSec;
345 private String consumerGroup;
346 private String consumerId;
348 public Integer getPollingIntervalSec() {
349 return pollingIntervalSec;
352 public void setPollingIntervalSec(Integer pollingIntervalSec) {
353 this.pollingIntervalSec = pollingIntervalSec;
356 public Integer getFetchTimeSec() {
360 public void setFetchTimeSec(Integer fetchTimeSec) {
361 this.fetchTimeSec = fetchTimeSec;
364 public String getConsumerGroup() {
365 return consumerGroup;
368 public void setConsumerGroup(String consumerGroup) {
369 this.consumerGroup = consumerGroup;
372 public String getConsumerId() {
376 public void setConsumerId(String consumerId) {
377 this.consumerId = consumerId;
381 public String toString() {
382 return "DistributionStatusTopicConfig [pollingIntervalSec=" + pollingIntervalSec + ", fetchTimeSec="
383 + fetchTimeSec + ", consumerGroup=" + consumerGroup + ", consumerId=" + consumerId + "]";
388 public static class DistributionNotificationTopicConfig {
390 private Integer maxWaitingAfterSendingSeconds;
391 private Integer maxThreadPoolSize;
392 private Integer minThreadPoolSize;
394 public Integer getMaxWaitingAfterSendingSeconds() {
395 return maxWaitingAfterSendingSeconds;
398 public void setMaxWaitingAfterSendingSeconds(Integer maxWaitingAfterSendingSeconds) {
399 this.maxWaitingAfterSendingSeconds = maxWaitingAfterSendingSeconds;
402 public Integer getMaxThreadPoolSize() {
403 return maxThreadPoolSize;
406 public void setMaxThreadPoolSize(Integer maxThreadPoolSize) {
407 this.maxThreadPoolSize = maxThreadPoolSize;
410 public Integer getMinThreadPoolSize() {
411 return minThreadPoolSize;
414 public void setMinThreadPoolSize(Integer minThreadPoolSize) {
415 this.minThreadPoolSize = minThreadPoolSize;
419 public String toString() {
420 return "DistributionNotificationTopicConfig [maxWaitingAfterSendingSeconds=" + maxWaitingAfterSendingSeconds
421 + ", maxThreadPoolSize=" + maxThreadPoolSize + ", minThreadPoolSize=" + minThreadPoolSize + "]";
426 public static class ComponentArtifactTypesConfig {
428 private List<String> info;
429 private List<String> lifecycle;
431 public List<String> getInfo() {
435 public void setInfo(List<String> info) {
439 public List<String> getLifecycle() {
443 public void setLifecycle(List<String> lifecycle) {
444 this.lifecycle = lifecycle;
448 public String toString() {
449 return "ArtifactTypesConfig [info=" + info + ", lifecycle=" + lifecycle + "]";
454 public Integer getOpEnvRecoveryIntervalSec() {
455 return opEnvRecoveryIntervalSec;
458 public void setOpEnvRecoveryIntervalSec(Integer opEnvRecoveryIntervalSec) {
459 this.opEnvRecoveryIntervalSec = opEnvRecoveryIntervalSec;
462 public Integer getAllowedTimeBeforeStaleSec() {
463 return allowedTimeBeforeStaleSec;
466 public void setAllowedTimeBeforeStaleSec(Integer allowedTimeBeforeStaleSec) {
467 this.allowedTimeBeforeStaleSec = allowedTimeBeforeStaleSec;
470 public ExternalServiceConfig getAaiConfig() {
474 public void setAaiConfig(ExternalServiceConfig aaiConfig) {
475 this.aaiConfig = aaiConfig;
478 public ExternalServiceConfig getMsoConfig() {
482 public void setMsoConfig(ExternalServiceConfig msoConfig) {
483 this.msoConfig = msoConfig;