aboutsummaryrefslogtreecommitdiffstats
path: root/common-app-api/src/main/java/org/openecomp/sdc/be/config/DistributionEngineConfiguration.java
blob: 834d7cb57927261ce5e89d2a535f131d85115306 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
/*-
 * ============LICENSE_START=======================================================
 * SDC
 * ================================================================================
 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
 * ================================================================================
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * ============LICENSE_END=========================================================
 */
package org.openecomp.sdc.be.config;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.openecomp.sdc.common.api.BasicConfiguration;
import org.openecomp.sdc.common.http.config.ExternalServiceConfig;

public class DistributionEngineConfiguration extends BasicConfiguration {

    private List<String> uebServers;
    private String distributionNotifTopicName;
    private String distributionStatusTopicName;
    private Integer initRetryIntervalSec;
    private Integer initMaxIntervalSec;
    private ComponentArtifactTypesConfig distribNotifServiceArtifactTypes;
    private ComponentArtifactTypesConfig distribNotifResourceArtifactTypes;
    private String uebPublicKey;
    private String uebSecretKey;
    private List<String> environments;
    private DistributionStatusTopicConfig distributionStatusTopic;
    private CreateTopicConfig createTopic;
    private boolean startDistributionEngine;
    private DistributionNotificationTopicConfig distributionNotificationTopic;
    private Integer defaultArtifactInstallationTimeout = 60;
    private Integer currentArtifactInstallationTimeout = 120;
    private boolean useHttpsWithDmaap;
    private ExternalServiceConfig aaiConfig;
    private ExternalServiceConfig msoConfig;
    private Integer opEnvRecoveryIntervalSec;
    private Integer allowedTimeBeforeStaleSec;

    public List<String> getUebServers() {
        return uebServers;
    }

    public void setUebServers(List<String> uebServers) {
        this.uebServers = uebServers;
    }

    public String getDistributionNotifTopicName() {
        return distributionNotifTopicName;
    }

    public void setDistributionNotifTopicName(String distributionNotifTopicName) {
        this.distributionNotifTopicName = distributionNotifTopicName;
    }

    public String getDistributionStatusTopicName() {
        return distributionStatusTopicName;
    }

    public void setDistributionStatusTopicName(String distributionStatusTopicName) {
        this.distributionStatusTopicName = distributionStatusTopicName;
    }

    public Integer getInitRetryIntervalSec() {
        return initRetryIntervalSec;
    }

    public void setInitRetryIntervalSec(Integer initRetryIntervalSec) {
        this.initRetryIntervalSec = initRetryIntervalSec;
    }

    public ComponentArtifactTypesConfig getDistribNotifServiceArtifactTypes() {
        return distribNotifServiceArtifactTypes;
    }

    public void setDistribNotifServiceArtifactTypes(ComponentArtifactTypesConfig distribNotifServiceArtifactTypes) {
        this.distribNotifServiceArtifactTypes = distribNotifServiceArtifactTypes;
    }

    public ComponentArtifactTypesConfig getDistribNotifResourceArtifactTypes() {
        return distribNotifResourceArtifactTypes;
    }

    public void setDistribNotifResourceArtifactTypes(ComponentArtifactTypesConfig distribNotifResourceArtifactTypes) {
        this.distribNotifResourceArtifactTypes = distribNotifResourceArtifactTypes;
    }

    public String getUebPublicKey() {
        return uebPublicKey;
    }

    public void setUebPublicKey(String uebPublicKey) {
        this.uebPublicKey = uebPublicKey;
    }

    public String getUebSecretKey() {
        return uebSecretKey;
    }

    public void setUebSecretKey(String uebSecretKey) {
        this.uebSecretKey = uebSecretKey;
    }

    public List<String> getEnvironments() {
        return environments;
    }

    public void setEnvironments(List<String> environments) {
        Set<String> set = new HashSet<>();
        if (environments != null) {
            set.addAll(environments);
            this.environments = new ArrayList<>(set);
        } else {
            this.environments = null;
        }
    }

    public DistributionStatusTopicConfig getDistributionStatusTopic() {
        return distributionStatusTopic;
    }

    public void setDistributionStatusTopic(DistributionStatusTopicConfig distributionStatusTopic) {
        this.distributionStatusTopic = distributionStatusTopic;
    }

    public Integer getInitMaxIntervalSec() {
        return initMaxIntervalSec;
    }

    public void setInitMaxIntervalSec(Integer initMaxIntervalSec) {
        this.initMaxIntervalSec = initMaxIntervalSec;
    }

    public CreateTopicConfig getCreateTopic() {
        return createTopic;
    }

    public void setCreateTopic(CreateTopicConfig createTopic) {
        this.createTopic = createTopic;
    }

    public boolean isStartDistributionEngine() {
        return startDistributionEngine;
    }

    public void setStartDistributionEngine(boolean startDistributionEngine) {
        this.startDistributionEngine = startDistributionEngine;
    }

    public DistributionNotificationTopicConfig getDistributionNotificationTopic() {
        return distributionNotificationTopic;
    }

    public void setDistributionNotificationTopic(DistributionNotificationTopicConfig distributionNotificationTopic) {
        this.distributionNotificationTopic = distributionNotificationTopic;
    }

    public int getDefaultArtifactInstallationTimeout() {
        return defaultArtifactInstallationTimeout;
    }

    public void setDefaultArtifactInstallationTimeout(int defaultArtifactInstallationTimeout) {
        this.defaultArtifactInstallationTimeout = defaultArtifactInstallationTimeout;
    }

    public int getCurrentArtifactInstallationTimeout() {
        return currentArtifactInstallationTimeout;
    }

    public void setCurrentArtifactInstallationTimeout(int currentArtifactInstallationTimeout) {
        this.currentArtifactInstallationTimeout = currentArtifactInstallationTimeout;
    }

    public boolean isUseHttpsWithDmaap() {
        return useHttpsWithDmaap;
    }

    public void setUseHttpsWithDmaap(boolean useHttpsWithDmaap) {
        this.useHttpsWithDmaap = useHttpsWithDmaap;
    }

    public Integer getOpEnvRecoveryIntervalSec() {
        return opEnvRecoveryIntervalSec;
    }

    public void setOpEnvRecoveryIntervalSec(Integer opEnvRecoveryIntervalSec) {
        this.opEnvRecoveryIntervalSec = opEnvRecoveryIntervalSec;
    }

    public Integer getAllowedTimeBeforeStaleSec() {
        return allowedTimeBeforeStaleSec;
    }

    public void setAllowedTimeBeforeStaleSec(Integer allowedTimeBeforeStaleSec) {
        this.allowedTimeBeforeStaleSec = allowedTimeBeforeStaleSec;
    }

    public ExternalServiceConfig getAaiConfig() {
        return aaiConfig;
    }

    public void setAaiConfig(ExternalServiceConfig aaiConfig) {
        this.aaiConfig = aaiConfig;
    }

    public ExternalServiceConfig getMsoConfig() {
        return msoConfig;
    }

    public void setMsoConfig(ExternalServiceConfig msoConfig) {
        this.msoConfig = msoConfig;
    }

    public enum ArtifcatTypeEnum {
        MURANO_PKG("MURANO-PKG"), HEAT("HEAT"), DG_XML("DG_XML");
        String value;

        private ArtifcatTypeEnum(String value) {
            this.value = value;
        }

        public String getValue() {
            return value;
        }
    }

    public static class DistribNotifServiceArtifacts {

        Map<String, Object> service;
        Map<String, Object> resource;

        public Map<String, Object> getService() {
            return service;
        }

        public void setService(Map<String, Object> service) {
            this.service = service;
        }

        public Map<String, Object> getResource() {
            return resource;
        }

        public void setResource(Map<String, Object> resource) {
            this.resource = resource;
        }
    }

    public static class NotifArtifactTypes {

        List<String> info;
        List<String> lifecycle;

        public List<String> getInfo() {
            return info;
        }

        public void setInfo(List<String> info) {
            this.info = info;
        }

        public List<String> getLifecycle() {
            return lifecycle;
        }

        public void setLifecycle(List<String> lifecycle) {
            this.lifecycle = lifecycle;
        }
    }

    public static class NotifArtifactTypesResource {

        List<ArtifcatTypeEnum> lifecycle;
    }

    public static class CreateTopicConfig {

        private Integer partitionCount;
        private Integer replicationCount;

        public Integer getPartitionCount() {
            return partitionCount;
        }

        public void setPartitionCount(Integer partitionCount) {
            this.partitionCount = partitionCount;
        }

        public Integer getReplicationCount() {
            return replicationCount;
        }

        public void setReplicationCount(Integer replicationCount) {
            this.replicationCount = replicationCount;
        }

        @Override
        public String toString() {
            return "CreateTopicConfig [partitionCount=" + partitionCount + ", replicationCount=" + replicationCount + "]";
        }
    }

    public static class EnvironmentConfig {

        private String name;
        private List<String> uebServers;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public List<String> getUebServers() {
            return uebServers;
        }

        public void setUebServers(List<String> uebServers) {
            this.uebServers = uebServers;
        }

        @Override
        public String toString() {
            return "EnvironmentConfig [name=" + name + ", uebServers=" + uebServers + "]";
        }
    }

    public static class DistributionStatusTopicConfig {

        private Integer pollingIntervalSec;
        private Integer fetchTimeSec;
        private String consumerGroup;
        private String consumerId;

        public Integer getPollingIntervalSec() {
            return pollingIntervalSec;
        }

        public void setPollingIntervalSec(Integer pollingIntervalSec) {
            this.pollingIntervalSec = pollingIntervalSec;
        }

        public Integer getFetchTimeSec() {
            return fetchTimeSec;
        }

        public void setFetchTimeSec(Integer fetchTimeSec) {
            this.fetchTimeSec = fetchTimeSec;
        }

        public String getConsumerGroup() {
            return consumerGroup;
        }

        public void setConsumerGroup(String consumerGroup) {
            this.consumerGroup = consumerGroup;
        }

        public String getConsumerId() {
            return consumerId;
        }

        public void setConsumerId(String consumerId) {
            this.consumerId = consumerId;
        }

        @Override
        public String toString() {
            return "DistributionStatusTopicConfig [pollingIntervalSec=" + pollingIntervalSec + ", fetchTimeSec=" + fetchTimeSec + ", consumerGroup="
                + consumerGroup + ", consumerId=" + consumerId + "]";
        }
    }

    public static class DistributionNotificationTopicConfig {

        private Integer maxWaitingAfterSendingSeconds;
        private Integer maxThreadPoolSize;
        private Integer minThreadPoolSize;

        public Integer getMaxWaitingAfterSendingSeconds() {
            return maxWaitingAfterSendingSeconds;
        }

        public void setMaxWaitingAfterSendingSeconds(Integer maxWaitingAfterSendingSeconds) {
            this.maxWaitingAfterSendingSeconds = maxWaitingAfterSendingSeconds;
        }

        public Integer getMaxThreadPoolSize() {
            return maxThreadPoolSize;
        }

        public void setMaxThreadPoolSize(Integer maxThreadPoolSize) {
            this.maxThreadPoolSize = maxThreadPoolSize;
        }

        public Integer getMinThreadPoolSize() {
            return minThreadPoolSize;
        }

        public void setMinThreadPoolSize(Integer minThreadPoolSize) {
            this.minThreadPoolSize = minThreadPoolSize;
        }

        @Override
        public String toString() {
            return "DistributionNotificationTopicConfig [maxWaitingAfterSendingSeconds=" + maxWaitingAfterSendingSeconds + ", maxThreadPoolSize="
                + maxThreadPoolSize + ", minThreadPoolSize=" + minThreadPoolSize + "]";
        }
    }

    public static class ComponentArtifactTypesConfig {

        private List<String> info;
        private List<String> lifecycle;

        public List<String> getInfo() {
            return info;
        }

        public void setInfo(List<String> info) {
            this.info = info;
        }

        public List<String> getLifecycle() {
            return lifecycle;
        }

        public void setLifecycle(List<String> lifecycle) {
            this.lifecycle = lifecycle;
        }

        @Override
        public String toString() {
            return "ArtifactTypesConfig [info=" + info + ", lifecycle=" + lifecycle + "]";
        }
    }
}