SDN-R data-provider with ES7
[ccsdk/features.git] / sdnr / wt / data-provider / setup / src / main / java / org / onap / ccsdk / features / sdnr / wt / dataprovider / setup / guilin / GuilinReleaseInformation.java
1 /*
2  * ============LICENSE_START=======================================================
3  * ONAP : ccsdk features
4  * ================================================================================
5  * Copyright (C) 2020 highstreet technologies GmbH Intellectual Property.
6  * All rights reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *     http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  *
21  */
22 package org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.guilin;
23
24 import java.util.HashMap;
25 import java.util.Map;
26
27 import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
28 import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.ReleaseInformation;
29 import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.data.ComponentName;
30 import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.data.DatabaseInfo;
31 import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.data.KeepDataSearchHitConverter;
32 import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.data.Release;
33 import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.data.SearchHitConverter;
34
35 public class GuilinReleaseInformation extends ReleaseInformation {
36
37     /**
38      * @param r
39      * @param dbMap
40      */
41     public GuilinReleaseInformation() {
42         super(Release.GUILIN_R1, createDBMap());
43
44     }
45
46     private static Map<ComponentName, DatabaseInfo> createDBMap() {
47         Map<ComponentName, DatabaseInfo> map = new HashMap<>();
48         map.put(ComponentName.EVENTLOG, new DatabaseInfo("eventlog", "eventlog", ""));
49         map.put(ComponentName.FAULTCURRENT, new DatabaseInfo("faultcurrent", "faultcurrent", ""));
50         map.put(ComponentName.FAULTLOG, new DatabaseInfo("faultlog", "faultlog", ""));
51         map.put(ComponentName.INVENTORY, new DatabaseInfo("inventoryequipment", "inventoryequipment", ""));
52         map.put(ComponentName.HISTORICAL_PERFORMANCE_15M,
53                 new DatabaseInfo("historicalperformance15min", "historicalperformance15min", ""));
54         map.put(ComponentName.HISTORICAL_PERFORMANCE_24H,
55                 new DatabaseInfo("historicalperformance24h", "historicalperformance24h", ""));
56         map.put(ComponentName.REQUIRED_NETWORKELEMENT,
57                 new DatabaseInfo("networkelement-connection", "networkelement-connection", ""));
58         map.put(ComponentName.MEDIATOR_SERVER, new DatabaseInfo("mediator-server", "mediator-server", ""));
59         map.put(ComponentName.MAINTENANCE, new DatabaseInfo("maintenancemode", "maintenancemode", ""));
60         return map;
61     }
62
63     @Override
64     public SearchHitConverter getConverter(Release dst, ComponentName comp) {
65         if (dst == Release.GUILIN_R1) {
66             return new KeepDataSearchHitConverter(comp);
67         }
68         return null;
69     }
70
71     @Override
72     protected boolean runPreInitCommands(HtDatabaseClient dbClient) {
73         return true;
74     }
75
76     @Override
77     protected boolean runPostInitCommands(HtDatabaseClient dbClient) {
78         return true;
79     }
80
81 }