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 java.util.ArrayList;
24 import java.util.HashSet;
25 import java.util.List;
29 import org.openecomp.sdc.common.api.BasicConfiguration;
31 public class DistributionEngineConfiguration extends BasicConfiguration {
33 private List<String> uebServers;
35 private String distributionNotifTopicName;
37 private String distributionStatusTopicName;
39 private Integer initRetryIntervalSec;
41 private Integer initMaxIntervalSec;
43 private ComponentArtifactTypesConfig distribNotifServiceArtifactTypes;
45 private ComponentArtifactTypesConfig distribNotifResourceArtifactTypes;
47 // private List<String> distribNotifServiceInfoArtifactTypes;
49 // private List<String> distribNotifResourceLifecycleArtifactTypes;
51 private String uebPublicKey;
53 private String uebSecretKey;
55 private List<String> environments;
57 private DistributionStatusTopicConfig distributionStatusTopic;
59 private CreateTopicConfig createTopic;
61 private boolean startDistributionEngine;
63 private DistributionNotificationTopicConfig distributionNotificationTopic;
65 private Integer defaultArtifactInstallationTimeout = 60;
67 private boolean useHttpsWithDmaap;
69 public static class DistribNotifServiceArtifacts {
71 Map<String, Object> service;
72 Map<String, Object> resource;
74 public Map<String, Object> getService() {
78 public void setService(Map<String, Object> service) {
79 this.service = service;
82 public Map<String, Object> getResource() {
86 public void setResource(Map<String, Object> resource) {
87 this.resource = resource;
92 public static class NotifArtifactTypes {
95 List<String> lifecycle;
97 public List<String> getInfo() {
101 public void setInfo(List<String> info) {
105 public List<String> getLifecycle() {
109 public void setLifecycle(List<String> lifecycle) {
110 this.lifecycle = lifecycle;
115 public static class NotifArtifactTypesResource {
117 List<ArtifcatTypeEnum> lifecycle;
121 public static enum ArtifcatTypeEnum {
123 MURANO_PKG("MURANO-PKG"), HEAT("HEAT"), DG_XML("DG_XML");
127 private ArtifcatTypeEnum(String value) {
131 public String getValue() {
137 public List<String> getUebServers() {
141 public void setUebServers(List<String> uebServers) {
142 this.uebServers = uebServers;
145 public String getDistributionNotifTopicName() {
146 return distributionNotifTopicName;
149 public void setDistributionNotifTopicName(String distributionNotifTopicName) {
150 this.distributionNotifTopicName = distributionNotifTopicName;
153 public String getDistributionStatusTopicName() {
154 return distributionStatusTopicName;
157 public void setDistributionStatusTopicName(String distributionStatusTopicName) {
158 this.distributionStatusTopicName = distributionStatusTopicName;
161 public Integer getInitRetryIntervalSec() {
162 return initRetryIntervalSec;
165 public void setInitRetryIntervalSec(Integer initRetryIntervalSec) {
166 this.initRetryIntervalSec = initRetryIntervalSec;
169 public ComponentArtifactTypesConfig getDistribNotifServiceArtifactTypes() {
170 return distribNotifServiceArtifactTypes;
173 public void setDistribNotifServiceArtifactTypes(ComponentArtifactTypesConfig distribNotifServiceArtifactTypes) {
174 this.distribNotifServiceArtifactTypes = distribNotifServiceArtifactTypes;
177 public ComponentArtifactTypesConfig getDistribNotifResourceArtifactTypes() {
178 return distribNotifResourceArtifactTypes;
181 public void setDistribNotifResourceArtifactTypes(ComponentArtifactTypesConfig distribNotifResourceArtifactTypes) {
182 this.distribNotifResourceArtifactTypes = distribNotifResourceArtifactTypes;
185 public String getUebPublicKey() {
189 public void setUebPublicKey(String uebPublicKey) {
190 this.uebPublicKey = uebPublicKey;
193 public String getUebSecretKey() {
197 public void setUebSecretKey(String uebSecretKey) {
198 this.uebSecretKey = uebSecretKey;
201 public List<String> getEnvironments() {
205 public void setEnvironments(List<String> environments) {
207 Set<String> set = new HashSet<String>();
208 if (environments != null) {
209 set.addAll(environments);
210 this.environments = new ArrayList<String>(set);
212 this.environments = null;
217 public DistributionStatusTopicConfig getDistributionStatusTopic() {
218 return distributionStatusTopic;
221 public void setDistributionStatusTopic(DistributionStatusTopicConfig distributionStatusTopic) {
222 this.distributionStatusTopic = distributionStatusTopic;
225 public Integer getInitMaxIntervalSec() {
226 return initMaxIntervalSec;
229 public void setInitMaxIntervalSec(Integer initMaxIntervalSec) {
230 this.initMaxIntervalSec = initMaxIntervalSec;
233 public CreateTopicConfig getCreateTopic() {
237 public void setCreateTopic(CreateTopicConfig createTopic) {
238 this.createTopic = createTopic;
241 public boolean isStartDistributionEngine() {
242 return startDistributionEngine;
245 public void setStartDistributionEngine(boolean startDistributionEngine) {
246 this.startDistributionEngine = startDistributionEngine;
249 public DistributionNotificationTopicConfig getDistributionNotificationTopic() {
250 return distributionNotificationTopic;
253 public void setDistributionNotificationTopic(DistributionNotificationTopicConfig distributionNotificationTopic) {
254 this.distributionNotificationTopic = distributionNotificationTopic;
257 public int getDefaultArtifactInstallationTimeout() {
258 return defaultArtifactInstallationTimeout;
261 public void setDefaultArtifactInstallationTimeout(int defaultArtifactInstallationTimeout) {
262 this.defaultArtifactInstallationTimeout = defaultArtifactInstallationTimeout;
265 public boolean isUseHttpsWithDmaap() {
266 return useHttpsWithDmaap;
269 public void setUseHttpsWithDmaap(boolean useHttpsWithDmaap) {
270 this.useHttpsWithDmaap = useHttpsWithDmaap;
273 public static class CreateTopicConfig {
275 private Integer partitionCount;
276 private Integer replicationCount;
278 public Integer getPartitionCount() {
279 return partitionCount;
282 public void setPartitionCount(Integer partitionCount) {
283 this.partitionCount = partitionCount;
286 public Integer getReplicationCount() {
287 return replicationCount;
290 public void setReplicationCount(Integer replicationCount) {
291 this.replicationCount = replicationCount;
295 public String toString() {
296 return "CreateTopicConfig [partitionCount=" + partitionCount + ", replicationCount=" + replicationCount
302 public static class EnvironmentConfig {
305 private List<String> uebServers;
307 public String getName() {
311 public void setName(String name) {
315 public List<String> getUebServers() {
319 public void setUebServers(List<String> uebServers) {
320 this.uebServers = uebServers;
324 public String toString() {
325 return "EnvironmentConfig [name=" + name + ", uebServers=" + uebServers + "]";
330 public static class DistributionStatusTopicConfig {
332 private Integer pollingIntervalSec;
333 private Integer fetchTimeSec;
334 private String consumerGroup;
335 private String consumerId;
337 public Integer getPollingIntervalSec() {
338 return pollingIntervalSec;
341 public void setPollingIntervalSec(Integer pollingIntervalSec) {
342 this.pollingIntervalSec = pollingIntervalSec;
345 public Integer getFetchTimeSec() {
349 public void setFetchTimeSec(Integer fetchTimeSec) {
350 this.fetchTimeSec = fetchTimeSec;
353 public String getConsumerGroup() {
354 return consumerGroup;
357 public void setConsumerGroup(String consumerGroup) {
358 this.consumerGroup = consumerGroup;
361 public String getConsumerId() {
365 public void setConsumerId(String consumerId) {
366 this.consumerId = consumerId;
370 public String toString() {
371 return "DistributionStatusTopicConfig [pollingIntervalSec=" + pollingIntervalSec + ", fetchTimeSec="
372 + fetchTimeSec + ", consumerGroup=" + consumerGroup + ", consumerId=" + consumerId + "]";
377 public static class DistributionNotificationTopicConfig {
379 private Integer maxWaitingAfterSendingSeconds;
380 private Integer maxThreadPoolSize;
381 private Integer minThreadPoolSize;
383 public Integer getMaxWaitingAfterSendingSeconds() {
384 return maxWaitingAfterSendingSeconds;
387 public void setMaxWaitingAfterSendingSeconds(Integer maxWaitingAfterSendingSeconds) {
388 this.maxWaitingAfterSendingSeconds = maxWaitingAfterSendingSeconds;
391 public Integer getMaxThreadPoolSize() {
392 return maxThreadPoolSize;
395 public void setMaxThreadPoolSize(Integer maxThreadPoolSize) {
396 this.maxThreadPoolSize = maxThreadPoolSize;
399 public Integer getMinThreadPoolSize() {
400 return minThreadPoolSize;
403 public void setMinThreadPoolSize(Integer minThreadPoolSize) {
404 this.minThreadPoolSize = minThreadPoolSize;
408 public String toString() {
409 return "DistributionNotificationTopicConfig [maxWaitingAfterSendingSeconds=" + maxWaitingAfterSendingSeconds
410 + ", maxThreadPoolSize=" + maxThreadPoolSize + ", minThreadPoolSize=" + minThreadPoolSize + "]";
415 public static class ComponentArtifactTypesConfig {
417 private List<String> info;
418 private List<String> lifecycle;
420 public List<String> getInfo() {
424 public void setInfo(List<String> info) {
428 public List<String> getLifecycle() {
432 public void setLifecycle(List<String> lifecycle) {
433 this.lifecycle = lifecycle;
437 public String toString() {
438 return "ArtifactTypesConfig [info=" + info + ", lifecycle=" + lifecycle + "]";