OAM NF Adopter REST PM
[oam/nf-oam-adopter.git] / ves-nf-oam-adopter / ves-nf-oam-adopter-pm-manager / src / main / java / org / o / ran / oam / nf / oam / adopter / pm / rest / manager / configurations / PerformanceManagementRestManagerConfig.java
1 /*
2  *  ============LICENSE_START=======================================================
3  *  O-RAN-SC
4  *  ================================================================================
5  *  Copyright © 2021 AT&T Intellectual Property. All rights reserved.
6  *  ================================================================================
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
10  *        http://www.apache.org/licenses/LICENSE-2.0
11  *
12  *  Unless required by applicable law or agreed to in writing, software
13  *  distributed under the License is distributed on an "AS IS" BASIS,
14  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  *  See the License for the specific language governing permissions and
16  *  limitations under the License.
17  *  ============LICENSE_END=========================================================
18  */
19
20 package org.o.ran.oam.nf.oam.adopter.pm.rest.manager.configurations;
21
22 import org.o.ran.oam.nf.oam.adopter.api.VesEventNotifier;
23 import org.o.ran.oam.nf.oam.adopter.pm.rest.manager.PerformanceManagementRestAgentFactory;
24 import org.o.ran.oam.nf.oam.adopter.pm.rest.manager.api.HttpRestClient;
25 import org.o.ran.oam.nf.oam.adopter.pm.rest.manager.mapper.PerformanceManagementFile2VesMapper;
26 import org.o.ran.oam.nf.oam.adopter.pm.rest.manager.properties.PerformanceManagementManagerProperties;
27 import org.springframework.beans.factory.annotation.Autowired;
28 import org.springframework.boot.context.properties.EnableConfigurationProperties;
29 import org.springframework.context.annotation.Bean;
30 import org.springframework.context.annotation.Configuration;
31
32 @Configuration
33 @EnableConfigurationProperties
34 public class PerformanceManagementRestManagerConfig {
35     private final PerformanceManagementManagerProperties pmManagerProperties;
36     private final VesEventNotifier eventListener;
37     private final PerformanceManagementFile2VesMapper pmFileMapper;
38
39     /**
40      * Default constructor.
41      */
42     @Autowired
43     public PerformanceManagementRestManagerConfig(final VesEventNotifier eventListener,
44             final PerformanceManagementFile2VesMapper pmFileMapper,
45             final PerformanceManagementManagerProperties pmManagerProperties) {
46         this.eventListener = eventListener;
47         this.pmFileMapper = pmFileMapper;
48         this.pmManagerProperties = pmManagerProperties;
49     }
50
51     @Bean
52     PerformanceManagementRestAgentFactory getPerformanceManagementRestManagerFactoryService(
53             final HttpRestClient httpRestClient) {
54         return new PerformanceManagementRestAgentFactory(eventListener, pmFileMapper, pmManagerProperties,
55                 httpRestClient);
56     }
57 }