aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/data-provider/model/src/main/java
diff options
context:
space:
mode:
authorherbert <herbert.eiselt@highstreet-technologies.com>2019-12-11 15:06:19 +0100
committerTimoney, Dan (dt5972) <dtimoney@att.com>2019-12-13 14:56:50 -0500
commit58f412ad18c1daf622e54ed36db6014f4e04f3f7 (patch)
tree91cc5f6630b4bf6a0ef12c1dee5a03fa2ebbb6cc /sdnr/wt/data-provider/model/src/main/java
parent05e4277510b9947e3cdcbab8c7bb3846a4211af6 (diff)
Add data-provider
data-provider and change to avoid heap overflow Issue-ID: SDNC-994 Signed-off-by: herbert <herbert.eiselt@highstreet-technologies.com> Change-Id: Ifcc6ce1198442e4b48fc08ba71108cfd5b5ca8aa
Diffstat (limited to 'sdnr/wt/data-provider/model/src/main/java')
-rw-r--r--sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/ArchiveCleanProvider.java39
-rw-r--r--sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/DataProvider.java95
-rw-r--r--sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/IEntityDataProvider.java26
3 files changed, 160 insertions, 0 deletions
diff --git a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/ArchiveCleanProvider.java b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/ArchiveCleanProvider.java
new file mode 100644
index 000000000..00ec2e60e
--- /dev/null
+++ b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/ArchiveCleanProvider.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.model;
+
+import java.util.Date;
+
+public interface ArchiveCleanProvider {
+
+ /**
+ * Remove all index data older, than specified
+ * @param olderAreOutdated time to specify older elements
+ * @return number of removed elements
+ */
+ int doIndexClean(Date olderAreOutdated);
+
+ /**
+ * Get number of elements older then
+ * @param olderAreOutdated date to compare with and specify older elements
+ * @return number of elements
+ */
+ public int getNumberOfOldObjects(Date olderAreOutdated);
+
+
+}
diff --git a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/DataProvider.java b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/DataProvider.java
new file mode 100644
index 000000000..fbfd18a2f
--- /dev/null
+++ b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/DataProvider.java
@@ -0,0 +1,95 @@
+/**
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ */
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.model;
+
+import java.util.Date;
+import java.util.List;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionlogEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogEntity;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Inventory;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionEntity;
+
+public interface DataProvider extends ArchiveCleanProvider {
+
+ // -- Connection log
+ void writeConnectionLog(ConnectionlogEntity event);
+
+ // -- Event log
+ void writeEventLog(EventlogEntity event);
+
+ void writeFaultLog(FaultlogEntity fault);
+
+ void updateFaultCurrent(FaultcurrentEntity fault);
+
+ /**
+ * Remove all entries for one node
+ *
+ * @param nodeName contains the mountpointname
+ * @return number of deleted entries
+ */
+ int clearFaultsCurrentOfNode(String nodeName);
+
+ /**
+ * Remove all entries for one node
+ *
+ * @param nodeName contains the mountpointname
+ * @param objectId of element to be deleted
+ * @return number of deleted entries
+ */
+ int clearFaultsCurrentOfNodeWithObjectId(String nodeName, String objectId);
+
+ /**
+ * Deliver list with all mountpoint/node-names in the database.
+ *
+ * @return List of all mountpoint/node-names the had active alarms.
+ */
+ List<String> getAllNodesWithCurrentAlarms();
+
+ /**
+ * write internal equipment to database
+ * @param internalEquipment with mandatory fields.
+ */
+ void writeInventory(Inventory internalEquipment);
+
+ /**
+ *
+ * @param networkElementConnectionEntitiy to wirte to DB
+ * @param nodeId Id for this DB element
+ */
+ void updateNetworkConnectionDeviceType(NetworkElementConnectionEntity networkElementConnectionEntitiy,
+ String nodeId);
+
+ /**
+ * Update after new mountpoint registration
+ * @param networkElementConnectionEntitiy data
+ * @param nodeId of device (mountpoint name)
+ */
+ void updateNetworkConnection22(NetworkElementConnectionEntity networkElementConnectionEntitiy, String nodeId);
+
+ void removeNetworkConnection(String nodeId);
+
+ @Override
+ int doIndexClean(Date olderAreOutdated);
+
+ @Override
+ int getNumberOfOldObjects(Date olderAreOutdated);
+
+ List<NetworkElementConnectionEntity> getNetworkElementConnections();
+}
diff --git a/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/IEntityDataProvider.java b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/IEntityDataProvider.java
new file mode 100644
index 000000000..c8c940433
--- /dev/null
+++ b/sdnr/wt/data-provider/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/dataprovider/model/IEntityDataProvider.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * ============LICENSE_START========================================================================
+ * ONAP : ccsdk feature sdnr wt
+ * =================================================================================================
+ * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved.
+ * =================================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
+ * in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
+ * or implied. See the License for the specific language governing permissions and limitations under
+ * the License.
+ * ============LICENSE_END==========================================================================
+ ******************************************************************************/
+package org.onap.ccsdk.features.sdnr.wt.dataprovider.model;
+
+public interface IEntityDataProvider {
+
+ /** Get provider for database read/write operations **/
+ public DataProvider getDataProvider();
+
+ public void setReadyStatus(boolean status);
+}