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;
40 @Value("${app.vardata-directory}")
41 private String vardataDirectory;
43 @Value("${server.ssl.key-store-type}")
44 private String sslKeyStoreType = "";
46 @Value("${server.ssl.key-store-password}")
47 private String sslKeyStorePassword = "";
49 @Value("${server.ssl.key-store}")
50 private String sslKeyStore = "";
52 @Value("${server.ssl.key-password}")
53 private String sslKeyPassword = "";
55 @Value("${app.webclient.trust-store-used}")
56 private boolean sslTrustStoreUsed = false;
58 @Value("${app.webclient.trust-store-password}")
59 private String sslTrustStorePassword = "";
61 @Value("${app.webclient.trust-store}")
62 private String sslTrustStore = "";
64 public WebClientConfig getWebClientConfig() {
65 return ImmutableWebClientConfig.builder() //
66 .keyStoreType(this.sslKeyStoreType) //
67 .keyStorePassword(this.sslKeyStorePassword) //
68 .keyStore(this.sslKeyStore) //
69 .keyPassword(this.sslKeyPassword) //
70 .isTrustStoreUsed(this.sslTrustStoreUsed) //
71 .trustStore(this.sslTrustStore) //
72 .trustStorePassword(this.sslTrustStorePassword) //