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;
62 private boolean useHttpsWithDmaap;
64 private ExternalServiceConfig aaiConfig;
66 private ExternalServiceConfig msoConfig;
68 private Integer opEnvRecoveryIntervalSec;
70 private Integer allowedTimeBeforeStaleSec;
72 public static class DistribNotifServiceArtifacts {
74 Map<String, Object> service;
75 Map<String, Object> resource;
79 public Map<String, Object> getService() {
83 public void setService(Map<String, Object> service) {
84 this.service = service;
87 public Map<String, Object> getResource() {
91 public void setResource(Map<String, Object> resource) {
92 this.resource = resource;
97 public static class NotifArtifactTypes {
100 List<String> lifecycle;
102 public List<String> getInfo() {
106 public void setInfo(List<String> info) {
110 public List<String> getLifecycle() {
114 public void setLifecycle(List<String> lifecycle) {
115 this.lifecycle = lifecycle;
120 public static class NotifArtifactTypesResource {
122 List<ArtifcatTypeEnum> lifecycle;
126 public enum ArtifcatTypeEnum {
128 MURANO_PKG("MURANO-PKG"), HEAT("HEAT"), DG_XML("DG_XML");
132 private ArtifcatTypeEnum(String value) {
136 public String getValue() {
142 public List<String> getUebServers() {
146 public void setUebServers(List<String> uebServers) {
147 this.uebServers = uebServers;
150 public String getDistributionNotifTopicName() {
151 return distributionNotifTopicName;
154 public void setDistributionNotifTopicName(String distributionNotifTopicName) {
155 this.distributionNotifTopicName = distributionNotifTopicName;
158 public String getDistributionStatusTopicName() {
159 return distributionStatusTopicName;
162 public void setDistributionStatusTopicName(String distributionStatusTopicName) {
163 this.distributionStatusTopicName = distributionStatusTopicName;
166 public Integer getInitRetryIntervalSec() {
167 return initRetryIntervalSec;
170 public void setInitRetryIntervalSec(Integer initRetryIntervalSec) {
171 this.initRetryIntervalSec = initRetryIntervalSec;
174 public ComponentArtifactTypesConfig getDistribNotifServiceArtifactTypes() {
175 return distribNotifServiceArtifactTypes;
178 public void setDistribNotifServiceArtifactTypes(ComponentArtifactTypesConfig distribNotifServiceArtifactTypes) {
179 this.distribNotifServiceArtifactTypes = distribNotifServiceArtifactTypes;
182 public ComponentArtifactTypesConfig getDistribNotifResourceArtifactTypes() {
183 return distribNotifResourceArtifactTypes;
186 public void setDistribNotifResourceArtifactTypes(ComponentArtifactTypesConfig distribNotifResourceArtifactTypes) {
187 this.distribNotifResourceArtifactTypes = distribNotifResourceArtifactTypes;
190 public String getUebPublicKey() {
194 public void setUebPublicKey(String uebPublicKey) {
195 this.uebPublicKey = uebPublicKey;
198 public String getUebSecretKey() {
202 public void setUebSecretKey(String uebSecretKey) {
203 this.uebSecretKey = uebSecretKey;
206 public List<String> getEnvironments() {
210 public void setEnvironments(List<String> environments) {
212 Set<String> set = new HashSet<>();
213 if (environments != null) {
214 set.addAll(environments);
215 this.environments = new ArrayList<>(set);
217 this.environments = null;
222 public DistributionStatusTopicConfig getDistributionStatusTopic() {
223 return distributionStatusTopic;
226 public void setDistributionStatusTopic(DistributionStatusTopicConfig distributionStatusTopic) {
227 this.distributionStatusTopic = distributionStatusTopic;
230 public Integer getInitMaxIntervalSec() {
231 return initMaxIntervalSec;
234 public void setInitMaxIntervalSec(Integer initMaxIntervalSec) {
235 this.initMaxIntervalSec = initMaxIntervalSec;
238 public CreateTopicConfig getCreateTopic() {
242 public void setCreateTopic(CreateTopicConfig createTopic) {
243 this.createTopic = createTopic;
246 public boolean isStartDistributionEngine() {
247 return startDistributionEngine;
250 public void setStartDistributionEngine(boolean startDistributionEngine) {
251 this.startDistributionEngine = startDistributionEngine;
254 public DistributionNotificationTopicConfig getDistributionNotificationTopic() {
255 return distributionNotificationTopic;
258 public void setDistributionNotificationTopic(DistributionNotificationTopicConfig distributionNotificationTopic) {
259 this.distributionNotificationTopic = distributionNotificationTopic;
262 public int getDefaultArtifactInstallationTimeout() {
263 return defaultArtifactInstallationTimeout;
266 public void setDefaultArtifactInstallationTimeout(int defaultArtifactInstallationTimeout) {
267 this.defaultArtifactInstallationTimeout = defaultArtifactInstallationTimeout;
270 public int getCurrentArtifactInstallationTimeout() {
271 return currentArtifactInstallationTimeout;
274 public void setCurrentArtifactInstallationTimeout(int currentArtifactInstallationTimeout) {
275 this.currentArtifactInstallationTimeout = currentArtifactInstallationTimeout;
278 public boolean isUseHttpsWithDmaap() {
279 return useHttpsWithDmaap;
282 public void setUseHttpsWithDmaap(boolean useHttpsWithDmaap) {
283 this.useHttpsWithDmaap = useHttpsWithDmaap;
286 public static class CreateTopicConfig {
288 private Integer partitionCount;
289 private Integer replicationCount;
291 public Integer getPartitionCount() {
292 return partitionCount;
295 public void setPartitionCount(Integer partitionCount) {
296 this.partitionCount = partitionCount;
299 public Integer getReplicationCount() {
300 return replicationCount;
303 public void setReplicationCount(Integer replicationCount) {
304 this.replicationCount = replicationCount;
308 public String toString() {
309 return "CreateTopicConfig [partitionCount=" + partitionCount + ", replicationCount=" + replicationCount
315 public static class EnvironmentConfig {
318 private List<String> uebServers;
320 public String getName() {
324 public void setName(String name) {
328 public List<String> getUebServers() {
332 public void setUebServers(List<String> uebServers) {
333 this.uebServers = uebServers;
337 public String toString() {
338 return "EnvironmentConfig [name=" + name + ", uebServers=" + uebServers + "]";
343 public static class DistributionStatusTopicConfig {
345 private Integer pollingIntervalSec;
346 private Integer fetchTimeSec;
347 private String consumerGroup;
348 private String consumerId;
350 public Integer getPollingIntervalSec() {
351 return pollingIntervalSec;
354 public void setPollingIntervalSec(Integer pollingIntervalSec) {
355 this.pollingIntervalSec = pollingIntervalSec;
358 public Integer getFetchTimeSec() {
362 public void setFetchTimeSec(Integer fetchTimeSec) {
363 this.fetchTimeSec = fetchTimeSec;
366 public String getConsumerGroup() {
367 return consumerGroup;
370 public void setConsumerGroup(String consumerGroup) {
371 this.consumerGroup = consumerGroup;
374 public String getConsumerId() {
378 public void setConsumerId(String consumerId) {
379 this.consumerId = consumerId;
383 public String toString() {
384 return "DistributionStatusTopicConfig [pollingIntervalSec=" + pollingIntervalSec + ", fetchTimeSec="
385 + fetchTimeSec + ", consumerGroup=" + 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
423 + ", maxThreadPoolSize=" + maxThreadPoolSize + ", minThreadPoolSize=" + minThreadPoolSize + "]";
428 public static class ComponentArtifactTypesConfig {
430 private List<String> info;
431 private List<String> lifecycle;
433 public List<String> getInfo() {
437 public void setInfo(List<String> info) {
441 public List<String> getLifecycle() {
445 public void setLifecycle(List<String> lifecycle) {
446 this.lifecycle = lifecycle;
450 public String toString() {
451 return "ArtifactTypesConfig [info=" + info + ", lifecycle=" + lifecycle + "]";
456 public Integer getOpEnvRecoveryIntervalSec() {
457 return opEnvRecoveryIntervalSec;
460 public void setOpEnvRecoveryIntervalSec(Integer opEnvRecoveryIntervalSec) {
461 this.opEnvRecoveryIntervalSec = opEnvRecoveryIntervalSec;
464 public Integer getAllowedTimeBeforeStaleSec() {
465 return allowedTimeBeforeStaleSec;
468 public void setAllowedTimeBeforeStaleSec(Integer allowedTimeBeforeStaleSec) {
469 this.allowedTimeBeforeStaleSec = allowedTimeBeforeStaleSec;
472 public ExternalServiceConfig getAaiConfig() {
476 public void setAaiConfig(ExternalServiceConfig aaiConfig) {
477 this.aaiConfig = aaiConfig;
480 public ExternalServiceConfig getMsoConfig() {
484 public void setMsoConfig(ExternalServiceConfig msoConfig) {
485 this.msoConfig = msoConfig;