3dfb07eb83f44864c50ea2d7cdc6f194f35c202f
[ccsdk/cds.git] /
1 /*
2  * Copyright © 2019 Bell Canada
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 package org.onap.ccsdk.cds.cdssdclistener;
17
18 import java.util.List;
19 import org.onap.sdc.api.consumer.IConfiguration;
20 import org.springframework.beans.factory.annotation.Value;
21 import org.springframework.boot.context.properties.ConfigurationProperties;
22
23 /**
24  * In order to initiate a SDC distribution client we need to supply some pre-configuration values that
25  * distribution client needs.
26  */
27 @ConfigurationProperties("listenerservice")
28 public class CdsSdcListenerConfiguration implements IConfiguration {
29
30     public static final String TOSCA_CSAR = "TOSCA_CSAR";
31
32     @Value("${listenerservice.config.asdcAddress}")
33     private String asdcAddress;
34
35     @Value("${listenerservice.config.messageBusAddress}")
36     private List<String> messageBusAddress;
37
38     @Value("${listenerservice.config.user}")
39     private String user;
40
41     @Value("${listenerservice.config.password}")
42     private String password;
43
44     @Value("${listenerservice.config.pollingTimeout}")
45     private int pollingTimeout;
46
47     @Value("${listenerservice.config.pollingInterval}")
48     private int pollingInterval;
49
50     @Value("${listenerservice.config.relevantArtifactTypes}")
51     private List<String> relevantArtifactTypes;
52
53     @Value("${listenerservice.config.consumerGroup}")
54     private String consumerGroup;
55
56     @Value("${listenerservice.config.environmentName}")
57     private String envName;
58
59     @Value("${listenerservice.config.consumerId}")
60     private String consumerId;
61
62     @Value("${listenerservice.config.activateServerTLSAuth}")
63     private boolean activateServerTLSAuth;
64
65     @Value("${listenerservice.config.isUseHttpsWithDmaap}")
66     private boolean isUseHttpsWithDmaap;
67
68     @Override
69     public String getAsdcAddress() {
70         return asdcAddress;
71     }
72
73     @Override
74     public List<String> getMsgBusAddress() {
75         return messageBusAddress;
76     }
77
78     @Override
79     public String getUser() {
80         return user;
81     }
82
83     @Override
84     public String getPassword() {
85         return password;
86     }
87
88     @Override
89     public int getPollingInterval() {
90         return pollingInterval;
91     }
92
93     @Override
94     public int getPollingTimeout() {
95         return pollingTimeout;
96     }
97
98     @Override
99     public List<String> getRelevantArtifactTypes() {
100         return relevantArtifactTypes;
101     }
102
103     @Override
104     public String getConsumerGroup() {
105         return consumerGroup;
106     }
107
108     @Override
109     public String getEnvironmentName() {
110         return envName;
111     }
112
113     @Override
114     public String getConsumerID() {
115         return consumerId;
116     }
117
118     @Override
119     public String getKeyStorePath() {
120         return null;
121     }
122
123     @Override
124     public String getKeyStorePassword() {
125         return null;
126     }
127
128     @Override
129     public boolean activateServerTLSAuth() {
130         return activateServerTLSAuth;
131     }
132
133     @Override
134     public boolean isFilterInEmptyResources() {
135         return false;
136     }
137
138     @Override
139     public Boolean isUseHttpsWithDmaap() {
140         return isUseHttpsWithDmaap;
141     }
142 }
143