e6eb7a4e8522693834e40dc89831ed923e5a1fcd
[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.Date;
21 import java.util.List;
22 import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.ConnectionlogEntity;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultcurrentEntity;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.FaultlogEntity;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Guicutthrough;
28 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.Inventory;
29 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementConnectionEntity;
30 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.PmdataEntity;
31
32 public interface DataProvider extends ArchiveCleanProvider {
33
34     // -- Connection log
35     void writeConnectionLog(ConnectionlogEntity event);
36
37     // -- Event log
38     void writeEventLog(EventlogEntity event);
39
40     void writeFaultLog(FaultlogEntity fault);
41
42     void updateFaultCurrent(FaultcurrentEntity fault);
43
44     /**
45      * Remove all entries for one node
46      *
47      * @param nodeName contains the mountpointname
48      * @return number of deleted entries
49      */
50     int clearFaultsCurrentOfNode(String nodeName);
51
52     /**
53      * Remove all entries for one node
54      *
55      * @param nodeName contains the mountpointname
56      * @param objectId of element to be deleted
57      * @return number of deleted entries
58      */
59     int clearFaultsCurrentOfNodeWithObjectId(String nodeName, String objectId);
60
61     /**
62      * Deliver list with all mountpoint/node-names in the database.
63      *
64      * @return List of all mountpoint/node-names the had active alarms.
65      */
66     List<String> getAllNodesWithCurrentAlarms();
67
68     /**
69      * write internal equipment to database
70      * @param internalEquipment with mandatory fields.
71      */
72     void writeInventory(Inventory internalEquipment);
73     /**
74      * write internal equipment to database
75      * @param nodeId
76      * @param list with mandatory fields.
77      */
78     void writeInventory(String nodeId, List<Inventory> list);
79
80     /**
81     * write GUI Cut through data to database
82     *
83     * @param gcData
84     */
85     void writeGuiCutThroughData(Guicutthrough gcData, String nodeId);
86
87     /**
88      *
89      * @param networkElementConnectionEntitiy to wirte to DB
90      * @param nodeId Id for this DB element
91      * @return if succeeded
92      */
93     boolean updateNetworkConnectionDeviceType(NetworkElementConnectionEntity networkElementConnectionEntitiy,
94             String nodeId);
95
96     /**
97      * Update after new mountpoint registration
98      *
99      * @param networkElementConnectionEntitiy data
100      * @param nodeId of device (mountpoint name)
101      * @return if succeeded
102      */
103     boolean updateNetworkConnection22(NetworkElementConnectionEntity networkElementConnectionEntitiy, String nodeId);
104
105     void removeNetworkConnection(String nodeId);
106
107     @Override
108     int doIndexClean(Date olderAreOutdated);
109
110     @Override
111     int getNumberOfOldObjects(Date olderAreOutdated);
112
113     List<NetworkElementConnectionEntity> getNetworkElementConnections();
114
115     /**
116      * @param list
117      */
118     void doWritePerformanceData(List<PmdataEntity> list);
119
120     /**
121      * @return raw database client
122      */
123     HtDatabaseClient getRawClient();
124
125 }