128138ee3c254e3a5ef8c27fa20560bde9a1dccd
[ccsdk/features.git] /
1 /*
2  * ============LICENSE_START========================================================================
3  * ONAP : ccsdk feature sdnr wt
4  * =================================================================================================
5  * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
6  * =================================================================================================
7  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
8  * in compliance with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software distributed under the License
13  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
14  * or implied. See the License for the specific language governing permissions and limitations under
15  * the License.
16  * ============LICENSE_END==========================================================================
17  */
18 package org.onap.ccsdk.features.sdnr.wt.dataprovider.model;
19
20 import java.util.List;
21 import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
22 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionlogEntity;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultcurrentEntity;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogEntity;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Guicutthrough;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Inventory;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementConnectionEntity;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PmdataEntity;
30
31 public interface DataProvider extends ArchiveCleanProvider {
32
33     // -- Connection log
34     void writeConnectionLog(ConnectionlogEntity event);
35
36     // -- Event log
37     void writeEventLog(EventlogEntity event);
38
39     void writeFaultLog(FaultlogEntity fault);
40
41     void updateFaultCurrent(FaultcurrentEntity fault);
42
43     /**
44      * Remove all entries for one node
45      *
46      * @param nodeName contains the mountpointname
47      * @return number of deleted entries
48      */
49     int clearFaultsCurrentOfNode(String nodeName);
50
51     /**
52      * Remove all entries for one node
53      *
54      * @param nodeName contains the mountpointname
55      * @param objectId of element to be deleted
56      * @return number of deleted entries
57      */
58     int clearFaultsCurrentOfNodeWithObjectId(String nodeName, String objectId);
59
60     /**
61      * Deliver list with all mountpoint/node-names in the database.
62      *
63      * @return List of all mountpoint/node-names the had active alarms.
64      */
65     List<String> getAllNodesWithCurrentAlarms();
66
67     /**
68      * write internal equipment to database
69      * @param nodeId
70      * @param internalEquipment with mandatory fields.
71      */
72     void writeInventory(String nodeId, List<Inventory> list);
73
74     /**
75     * write GUI Cut through data to database
76     *
77     * @param gcData
78     */
79     void writeGuiCutThroughData(Guicutthrough gcData, String nodeId);
80
81     /**
82      *
83      * @param nodeName
84      * @return number of entries
85      */
86     public int clearGuiCutThroughEntriesOfNode(String nodeName);
87
88     /**
89      *
90      * @param networkElementConnectionEntitiy to wirte to DB
91      * @param nodeId Id for this DB element
92      * @return if succeeded
93      */
94     boolean updateNetworkConnectionDeviceType(NetworkElementConnectionEntity networkElementConnectionEntitiy,
95             String nodeId);
96
97     /**
98      * Update after new mountpoint registration
99      *
100      * @param networkElementConnectionEntitiy data
101      * @param nodeId of device (mountpoint name)
102      * @return if succeeded
103      */
104     boolean updateNetworkConnection22(NetworkElementConnectionEntity networkElementConnectionEntitiy, String nodeId);
105
106     void removeNetworkConnection(String nodeId);
107
108     List<NetworkElementConnectionEntity> getNetworkElementConnections();
109
110     /**
111      * @param list
112      */
113     void doWritePerformanceData(List<PmdataEntity> list);
114
115     /**
116      * @return raw database client
117      */
118     HtDatabaseClient getRawClient();
119
120 }