Add mod/runtimeapi
[dcaegen2/platform.git] / mod / runtimeapi / runtime-web / src / main / java / org / onap / dcae / runtime / web / configuration / PropertyConfig.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
4  * ================================================================================
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  * 
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  * 
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  * ============LICENSE_END=========================================================
17  */
18 package org.onap.dcae.runtime.web.configuration;
19
20 import org.onap.dcae.runtime.web.models.DashboardConfig;
21 import org.springframework.beans.factory.annotation.Autowired;
22 import org.springframework.beans.factory.annotation.Value;
23 import org.springframework.context.annotation.Bean;
24 import org.springframework.context.annotation.Configuration;
25 import org.springframework.core.env.Environment;
26
27 @Configuration
28 public class PropertyConfig {
29
30     @Autowired
31     Environment env;
32
33     @Value("${dashboard.url}")
34     String dashboardUrl;
35
36     @Value("${dashboard.username}")
37     String dashboardUser;
38
39     @Value("${dashboard.password}")
40     String dashboardPassword;
41
42     @Bean
43     public DashboardConfig getDashboardConfig(){
44         DashboardConfig dashboardConfig = new DashboardConfig();
45         dashboardConfig.setUrl(this.dashboardUrl);
46         dashboardConfig.setUsername(this.dashboardUser);
47         dashboardConfig.setPassword(this.dashboardPassword);
48         return dashboardConfig;
49     }
50 }