2 * ========================LICENSE_START=================================
5 * Copyright (C) 2020 Nordix Foundation
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.oransc.enrichment.configuration;
23 import javax.validation.constraints.NotEmpty;
27 import org.springframework.beans.factory.annotation.Value;
28 import org.springframework.boot.context.properties.ConfigurationProperties;
29 import org.springframework.boot.context.properties.EnableConfigurationProperties;
31 @EnableConfigurationProperties
32 @ConfigurationProperties()
33 public class ApplicationConfig {
36 @Value("${app.filepath}")
37 private String localConfigurationFilePath;
39 @Value("${server.ssl.key-store-type}")
40 private String sslKeyStoreType = "";
42 @Value("${server.ssl.key-store-password}")
43 private String sslKeyStorePassword = "";
45 @Value("${server.ssl.key-store}")
46 private String sslKeyStore = "";
48 @Value("${server.ssl.key-password}")
49 private String sslKeyPassword = "";
51 @Value("${app.webclient.trust-store-used}")
52 private boolean sslTrustStoreUsed = false;
54 @Value("${app.webclient.trust-store-password}")
55 private String sslTrustStorePassword = "";
57 @Value("${app.webclient.trust-store}")
58 private String sslTrustStore = "";
60 public WebClientConfig getWebClientConfig() {
61 return ImmutableWebClientConfig.builder() //
62 .keyStoreType(this.sslKeyStoreType) //
63 .keyStorePassword(this.sslKeyStorePassword) //
64 .keyStore(this.sslKeyStore) //
65 .keyPassword(this.sslKeyPassword) //
66 .isTrustStoreUsed(this.sslTrustStoreUsed) //
67 .trustStore(this.sslTrustStore) //
68 .trustStorePassword(this.sslTrustStorePassword) //