a81a6f0fde03c9b4e7705e7ee669f8341144aaf9
[ccsdk/features.git] /
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.List;
26 import java.util.Map;
27
28 import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.data.ComponentName;
29 import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.data.KeepDataSearchHitConverter;
30 import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.data.Release;
31 import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.data.SearchHitConverter;
32 import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
33 import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.ReleaseInformation;
34 import org.onap.ccsdk.features.sdnr.wt.dataprovider.setup.data.DatabaseInfo;
35
36 public class GuilinReleaseInformation extends ReleaseInformation {
37
38     /**
39      * @param r
40      * @param dbMap
41      */
42     public GuilinReleaseInformation() {
43         super(Release.GUILIN, createDBMap());
44
45     }
46
47     private static Map<ComponentName, DatabaseInfo> createDBMap() {
48         Map<ComponentName, DatabaseInfo> map = new HashMap<>();
49         map.put(ComponentName.EVENTLOG, new DatabaseInfo("eventlog", "eventlog", ""));
50         map.put(ComponentName.FAULTCURRENT, new DatabaseInfo("faultcurrent", "faultcurrent", ""));
51         map.put(ComponentName.FAULTLOG, new DatabaseInfo("faultlog", "faultlog", ""));
52         map.put(ComponentName.INVENTORY, new DatabaseInfo("inventoryequipment", "inventoryequipment", ""));
53         map.put(ComponentName.HISTORICAL_PERFORMANCE_15M,
54                 new DatabaseInfo("historicalperformance15min", "historicalperformance15min", ""));
55         map.put(ComponentName.HISTORICAL_PERFORMANCE_24H,
56                 new DatabaseInfo("historicalperformance24h", "historicalperformance24h", ""));
57         map.put(ComponentName.REQUIRED_NETWORKELEMENT,
58                 new DatabaseInfo("networkelement-connection", "networkelement-connection", ""));
59         map.put(ComponentName.MEDIATOR_SERVER, new DatabaseInfo("mediator-server", "mediator-server", ""));
60         map.put(ComponentName.MAINTENANCE, new DatabaseInfo("maintenancemode", "maintenancemode", ""));
61         return map;
62     }
63
64     @Override
65     public SearchHitConverter getConverter(Release dst, ComponentName comp) {
66         if (dst == Release.GUILIN) {
67             return new KeepDataSearchHitConverter(comp);
68         }
69         return null;
70     }
71
72     @Override
73     protected boolean runPreInitCommands(HtDatabaseClient dbClient) {
74         return true;
75     }
76
77     @Override
78     protected boolean runPostInitCommands(HtDatabaseClient dbClient) {
79         return true;
80     }
81
82 }