Add data-provider
[ccsdk/features.git] / sdnr / wt / data-provider / model / src / main / java / org / onap / ccsdk / features / sdnr / wt / dataprovider / model / DataProvider.java
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.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionlogEntity;
23 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogEntity;
24 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentEntity;
25 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogEntity;
26 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Inventory;
27 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionEntity;
28
29 public interface DataProvider extends ArchiveCleanProvider {
30
31     // -- Connection log
32     void writeConnectionLog(ConnectionlogEntity event);
33
34     // -- Event log
35     void writeEventLog(EventlogEntity event);
36
37     void writeFaultLog(FaultlogEntity fault);
38
39     void updateFaultCurrent(FaultcurrentEntity fault);
40
41     /**
42      * Remove all entries for one node
43      *
44      * @param nodeName contains the mountpointname
45      * @return number of deleted entries
46      */
47     int clearFaultsCurrentOfNode(String nodeName);
48
49     /**
50      * Remove all entries for one node
51      *
52      * @param nodeName contains the mountpointname
53      * @param objectId of element to be deleted
54      * @return number of deleted entries
55      */
56     int clearFaultsCurrentOfNodeWithObjectId(String nodeName, String objectId);
57
58     /**
59      * Deliver list with all mountpoint/node-names in the database.
60      *
61      * @return List of all mountpoint/node-names the had active alarms.
62      */
63     List<String> getAllNodesWithCurrentAlarms();
64
65     /**
66      * write internal equipment to database
67      * @param internalEquipment with mandatory fields.
68      */
69     void writeInventory(Inventory internalEquipment);
70
71     /**
72      *
73      * @param networkElementConnectionEntitiy to wirte to DB
74      * @param nodeId Id for this DB element
75      */
76     void updateNetworkConnectionDeviceType(NetworkElementConnectionEntity networkElementConnectionEntitiy,
77             String nodeId);
78
79     /**
80      * Update after new mountpoint registration
81      * @param networkElementConnectionEntitiy data
82      * @param nodeId of device (mountpoint name)
83      */
84     void updateNetworkConnection22(NetworkElementConnectionEntity networkElementConnectionEntitiy, String nodeId);
85
86     void removeNetworkConnection(String nodeId);
87
88     @Override
89         int doIndexClean(Date olderAreOutdated);
90
91     @Override
92         int getNumberOfOldObjects(Date olderAreOutdated);
93
94     List<NetworkElementConnectionEntity> getNetworkElementConnections();
95 }