VES PM data for slicing use case. [Issue-Id: ODUHIGH-384]
[o-du/l2.git] / src / o1 / ConfigLoader.cpp
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2020-2021] [HCL Technologies Ltd.]                          #
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 ################################################################################
17 *******************************************************************************/
18 /* This is a singleton class to load and store all configuration parameters */
19
20 #include "ConfigLoader.hpp"
21
22 /* Constructor */
23 ConfigLoader::ConfigLoader() 
24     : mNetconfConfig(NETCONF_CONFIG), 
25     mOamConfig(OAM_VES_CONFIG),
26     mSmoConfig(SMO_VES_CONFIG)
27 {
28 };
29 /* Default Destructor */
30 ConfigLoader::~ConfigLoader()
31 {
32 }
33  
34 /*******************************************************************
35  *
36  * @brief Load all configuration files 
37  *
38  * @details
39  *
40  *    Function : loadConfigurations
41  *
42  *    Functionality:
43  *      - Loads all the configuration files
44  *
45  *
46  * @params[in] void
47  * @return true  - success
48  *         false - failure
49  ******************************************************************/
50 bool ConfigLoader::loadConfigurations() {
51     return mOamConfig.loadConfigFile() 
52             &&
53             mSmoConfig.loadConfigFile()
54             &&
55             mNetconfConfig.loadConfigFile();
56 }
57
58 /*******************************************************************
59  *
60  * @brief Get OAM Ves collector configuration 
61  *
62  * @details
63  *
64  *    Function : getOamConfigFile
65  *
66  *    Functionality:
67  *      -  Returns the OAM config object
68  *
69  *
70  * @params[in] void
71  * @return const reference to VesConfigFile
72  *         
73  ******************************************************************/
74 const VesConfigFile& ConfigLoader::getOamConfigFile() const{
75     return mOamConfig;
76 }
77
78 /*******************************************************************
79  *
80  * @brief Get SMO Ves collector configuration
81  *
82  * @details
83  *
84  *    Function : getsmoConfigFile
85  *
86  *    Functionality:
87  *      -  Returns the Smo config object
88  *
89  *
90  * @params[in] void
91  * @return const reference to VesConfigFile
92  *         
93  ******************************************************************/
94 const VesConfigFile& ConfigLoader::getSmoConfigFile() const{
95     return mSmoConfig;
96 }
97
98 /*******************************************************************
99  *
100  * @brief Get Netconf server configuration
101  *
102  * @details
103  *
104  *    Function : getNetconfConfigFile
105  *
106  *    Functionality:
107  *      -  Returns the Netconf config object
108  *
109  *
110  * @params[in] void
111  * @return const reference to NetconfConfigFile
112  *         
113  ******************************************************************/
114 const NetconfConfigFile& ConfigLoader::getNetconfConfigFile() const{
115     return mNetconfConfig;
116 }
117
118 /**********************************************************************
119   End of file
120  **********************************************************************/