summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/devicemanager/provider/src/main
diff options
context:
space:
mode:
authorHerbert Eiselt <herbert.eiselt@highstreet-technologies.com>2019-02-28 17:10:18 +0100
committerHerbert Eiselt <herbert.eiselt@highstreet-technologies.com>2019-02-28 17:10:46 +0100
commite91c316e653979d96c43fd107895be80b33832fc (patch)
tree13d40239d4588a5d3eda9467ad7ef112a16ae9d6 /sdnr/wt/devicemanager/provider/src/main
parent49b155ec687cdf58fb51fe8245a2f5f4582b68f0 (diff)
junit tests devicemanager
test cases added and improved Change-Id: I3f0a6ca238e61ad140a3086504d4f21792b986e9 Issue-ID: SDNC-672 Signed-off-by: Herbert Eiselt <herbert.eiselt@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/devicemanager/provider/src/main')
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/database/HtDatabaseNode.java12
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCOreNetworkElementCoreData.java11
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElement12.java1
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElement12Base.java1
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElementBase.java1
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElementFactory.java1
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerApiServiceImpl.java1
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerImpl.java76
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerService.java20
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/database/types/equipment/ExtendedEquipment.java6
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/listener/NetconfChangeListener.java133
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/listener/ODLEventListener.java80
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientDummyImpl.java38
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientImpl2.java4
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/database/types/EsPerformanceData.java2
-rw-r--r--sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/index/sdnevents/sdneventsMapping.json325
16 files changed, 410 insertions, 302 deletions
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/database/HtDatabaseNode.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/database/HtDatabaseNode.java
index 6a23a3460..93a5bbd40 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/database/HtDatabaseNode.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/database/HtDatabaseNode.java
@@ -123,8 +123,15 @@ public class HtDatabaseNode implements AutoCloseable {
if (!f.exists()) {
f.mkdir();
}
- Resources.copyFolderInto(RESFOLDER_PLUGINHEAD, PLUGINFOLDER, RESFOLDER_PLUGIN);
- Resources.copyFolderInto(RESFOLDER_PLUGINDELETE, PLUGINFOLDER, RESFOLDER_PLUGIN);
+ if (!Resources.copyFolderInto(RESFOLDER_PLUGINHEAD, PLUGINFOLDER, RESFOLDER_PLUGIN)) {
+ throw new IllegalArgumentException("Copy not successfull Name: " + RESFOLDER_PLUGINHEAD + " folder src "
+ + PLUGINFOLDER + " folder dst " + RESFOLDER_PLUGIN);
+ }
+ //Normal JAR loaded by classloader as part of the bundle
+ if (!Resources.copyFolderInto(RESFOLDER_PLUGINDELETE, PLUGINFOLDER, RESFOLDER_PLUGIN)) {
+ throw new IllegalArgumentException("Copy not successfull Name: " + RESFOLDER_PLUGINDELETE + " folder src "
+ + PLUGINFOLDER + " folder dst " + RESFOLDER_PLUGIN);
+ }
}
/**
@@ -232,6 +239,7 @@ public class HtDatabaseNode implements AutoCloseable {
/**
* Start as singleton
+ *
* @param config data
* @param akkaConfig data
* @param geoConfig data
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCOreNetworkElementCoreData.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCOreNetworkElementCoreData.java
index 265a3db84..3aa7116d6 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCOreNetworkElementCoreData.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCOreNetworkElementCoreData.java
@@ -6,9 +6,9 @@
* =================================================================================================
* 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
@@ -20,10 +20,11 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.NetworkElement;
+@SuppressWarnings("deprecation")
public interface ONFCOreNetworkElementCoreData {
- public String getMountpoint();
- public DataBroker getDataBroker();
- public NetworkElement getOptionalNetworkElement();
+ public String getMountpoint();
+ public DataBroker getDataBroker();
+ public NetworkElement getOptionalNetworkElement();
}
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElement12.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElement12.java
index b57e8c906..3a38c4e28 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElement12.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElement12.java
@@ -77,6 +77,7 @@ import com.google.common.base.Optional;
* @author herbert
*
*/
+@SuppressWarnings("deprecation")
public class ONFCoreNetworkElement12 extends ONFCoreNetworkElement12Base
implements ONFCoreNetworkElementCallback, NotificationActor<AttributeValueChangedNotificationXml> {
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElement12Base.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElement12Base.java
index 8fc4c3308..f0ce392d7 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElement12Base.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElement12Base.java
@@ -49,6 +49,7 @@ import org.slf4j.LoggerFactory;
* This class contains the ONF Core model Version 1.2 related functions.
* It should import
*/
+@SuppressWarnings("deprecation")
public abstract class ONFCoreNetworkElement12Base extends ONFCoreNetworkElementBase implements ONFCOreNetworkElementCoreData {
private static final Logger LOG = LoggerFactory.getLogger(ONFCoreNetworkElement12Base.class);
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElementBase.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElementBase.java
index e49ff6591..530dabb42 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElementBase.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElementBase.java
@@ -32,6 +32,7 @@ import org.slf4j.LoggerFactory;
* @author herbert
*
*/
+@SuppressWarnings("deprecation")
public abstract class ONFCoreNetworkElementBase implements AutoCloseable, ONFCoreNetworkElementRepresentation {
private static final Logger LOG = LoggerFactory.getLogger(ONFCoreNetworkElementBase.class);
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElementFactory.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElementFactory.java
index a314fd99f..bda77f223 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElementFactory.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/base/netconf/ONFCoreNetworkElementFactory.java
@@ -45,6 +45,7 @@ import org.slf4j.LoggerFactory;
* terms than "revision" are provided.
*
*/
+@SuppressWarnings("deprecation")
public class ONFCoreNetworkElementFactory {
private static final Logger LOG = LoggerFactory.getLogger(ONFCoreNetworkElementFactory.class);
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerApiServiceImpl.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerApiServiceImpl.java
index 6e8d85bda..79b4b056f 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerApiServiceImpl.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerApiServiceImpl.java
@@ -48,6 +48,7 @@ import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@SuppressWarnings("deprecation")
public class DeviceManagerApiServiceImpl implements DevicemanagerService, AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(DevicemanagerService.class);
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerImpl.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerImpl.java
index fcd7c1bc9..f0efe7aa4 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerImpl.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerImpl.java
@@ -40,7 +40,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.listener.NetconfChange
import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.listener.ODLEventListener;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ProblemNotificationXml;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.WebSocketServiceClient;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.WebSocketServiceClientImpl;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.WebSocketServiceClientDummyImpl;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.WebSocketServiceClientImpl2;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.index.impl.IndexConfigService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.index.impl.IndexMwtnService;
@@ -59,6 +59,7 @@ import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification.
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.NotificationsService;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.StreamNameType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNodeConnectionStatus.ConnectionStatus;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.network.topology.topology.topology.types.TopologyNetconf;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
@@ -71,6 +72,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+@SuppressWarnings("deprecation")
public class DeviceManagerImpl implements DeviceManagerService, AutoCloseable, ResyncNetworkElementsListener {
private static final Logger LOG = LoggerFactory.getLogger(DeviceManagerImpl.class);
@@ -126,7 +128,6 @@ public class DeviceManagerImpl implements DeviceManagerService, AutoCloseable, R
public void setRpcProviderRegistry(RpcProviderRegistry rpcProviderRegistry) {
this.rpcProviderRegistry = rpcProviderRegistry;
-
}
public void setNotificationPublishService(NotificationPublishService notificationPublishService) {
@@ -186,7 +187,7 @@ public class DeviceManagerImpl implements DeviceManagerService, AutoCloseable, R
this.configService = new IndexConfigService(htDatabase);
this.mwtnService = new IndexMwtnService(htDatabase);
} catch (Exception e) {
- LOG.warn("Can not start ES access clients to provide database index config, mwtn. ",e);
+ LOG.warn("Can not start ES access clients to provide database index config, mwtn. ", e);
}
}
// start service for device maintenance service
@@ -196,7 +197,7 @@ public class DeviceManagerImpl implements DeviceManagerService, AutoCloseable, R
this.webSocketService = new WebSocketServiceClientImpl2(rpcProviderRegistry);
} catch (Exception e) {
LOG.error("Can not start websocket service. Loading mock class.", e);
- this.webSocketService = new WebSocketServiceClientImpl();
+ this.webSocketService = new WebSocketServiceClientDummyImpl();
}
// DCAE
this.dcaeProviderClient = new DcaeProviderClient(config, dbConfig.getCluster(), this);
@@ -293,9 +294,12 @@ public class DeviceManagerImpl implements DeviceManagerService, AutoCloseable, R
}
}
+ /*-------------------------------------------------------------------------------------------
+ * Functions for interface DeviceManagerService
+ */
+
/**
* For each mounted device a mountpoint is created and this listener is called.
- *
*/
@Override
public void startListenerOnNodeForConnectedState(Action action, NodeId nNodeId, NetconfNode nNode) {
@@ -333,17 +337,9 @@ public class DeviceManagerImpl implements DeviceManagerService, AutoCloseable, R
Optional<MountPoint> optionalMountPoint = null;
int timeout = 10000;
while (!(optionalMountPoint = mountPointService.getMountPoint(instanceIdentifier)).isPresent() && timeout > 0) {
-
LOG.info("Event listener waiting for mount point for Netconf device :: Name : {}", mountPointNodeName);
- try {
- Thread.sleep(1000);
- timeout -= 1000;
- } catch (InterruptedException e) {
- LOG.info("Event listener waiting for mount point for Netconf device :: Name : {} Time: {}",
- mountPointNodeName, timeout);
- // Restore interrupted state...
- Thread.currentThread().interrupt();
- }
+ sleepMs(1000);
+ timeout -= 1000;
}
if (!optionalMountPoint.isPresent()) {
@@ -353,14 +349,17 @@ public class DeviceManagerImpl implements DeviceManagerService, AutoCloseable, R
}
// Mountpoint is present for sure
MountPoint mountPoint = optionalMountPoint.get();
+ //BindingDOMDataBrokerAdapter.BUILDER_FACTORY;
+ LOG.info("Mountpoint with id: {} class {} toString {}", mountPoint.getIdentifier(), mountPoint.getClass().getName(), mountPoint);
+ Optional<DataBroker> optionalNetconfNodeDatabroker = mountPoint.getService(DataBroker.class);
- DataBroker netconfNodeDataBroker = mountPoint.getService(DataBroker.class).orNull();
- if (netconfNodeDataBroker == null) {
- LOG.info("Mountpoint is slave mountpoint {}", mountPointNodeName);
+ if (! optionalNetconfNodeDatabroker.isPresent()) {
+ LOG.info("Slave mountpoint {} without databroker", mountPointNodeName);
return;
}
- LOG.info("Databroker service 1:{} 2:{}", dataBroker.hashCode(), netconfNodeDataBroker.hashCode());
+ DataBroker netconfNodeDataBroker = optionalNetconfNodeDatabroker.get();
+ LOG.info("Master mountpoint {}", mountPointNodeName);
// getNodeInfoTest(dataBroker);
// create automatic empty maintenance entry into db before reading and listening for problems
@@ -400,15 +399,15 @@ public class DeviceManagerImpl implements DeviceManagerService, AutoCloseable, R
LOG.info("Starting Event listener on Netconf device :: Name : {} finished", mountPointNodeName);
}
- // removeListenerOnNode
@Override
- public void leaveConnectedState(NodeId nNodeId, NetconfNode nNode) {
+ public void enterNonConnectedState(NodeId nNodeId, NetconfNode nNode) {
String mountPointNodeName = nNodeId.getValue();
- LOG.info("leaveConnectedState for device :: Name : {}", mountPointNodeName);
+ LOG.info("enter Non ConnectedState for device :: Name : {}", mountPointNodeName);
- this.maintenanceService.deleteIfNotRequired(mountPointNodeName);
ONFCoreNetworkElementRepresentation ne = networkElementRepresentations.remove(mountPointNodeName);
if (ne != null) {
+ // Handling transition mountpoint connected -> connecting
+ this.maintenanceService.deleteIfNotRequired(mountPointNodeName);
int problems = ne.removeAllCurrentProblemsOfNode();
LOG.debug("Removed all {} problems from database at deregistration for {}", problems, mountPointNodeName);
if (odlEventListener != null) {
@@ -421,7 +420,13 @@ public class DeviceManagerImpl implements DeviceManagerService, AutoCloseable, R
aaiProviderClient.onDeviceUnregistered(mountPointNodeName);
}
} else {
- LOG.info("No related ne object for mountpoint {} to deregister .", mountPointNodeName);
+ // Handling -> create not connected mountpoint, or change other beside connected.
+ ConnectionStatus csts = nNode.getConnectionStatus();
+ if (csts != null) {
+ odlEventListener.updateRegistration(mountPointNodeName, csts.getClass().getSimpleName(), csts.getName());
+ } else {
+ LOG.info("Unknown connection status");
+ }
}
if (deviceMonitor != null) {
deviceMonitor.deviceDisconnectIndication(mountPointNodeName);
@@ -429,19 +434,17 @@ public class DeviceManagerImpl implements DeviceManagerService, AutoCloseable, R
}
- /*
- * @Override public void mountpointNodeCreation(NodeId nNodeId, NetconfNode nNode) { String
- * mountPointNodeName = nNodeId.getValue(); LOG.info("mountpointNodeCreation {} {}",
- * nNodeId.getValue(), nNode.getConnectionStatus());
- * deviceMonitor.createMountpointIndication(mountPointNodeName); }
- */
@Override
- public void mountpointNodeRemoved(NodeId nNodeId) {
+ public void removeMountpointState(NodeId nNodeId) {
String mountPointNodeName = nNodeId.getValue();
LOG.info("mountpointNodeRemoved {}", nNodeId.getValue());
deviceMonitor.removeMountpointIndication(mountPointNodeName);
}
+ /*-------------------------------------------------------------------------------------------
+ * Functions
+ */
+
/**
* Async RPC Interface implementation
*/
@@ -630,4 +633,15 @@ public class DeviceManagerImpl implements DeviceManagerService, AutoCloseable, R
return true;
}
+
+ private void sleepMs(int milliseconds) {
+ try {
+ Thread.sleep(milliseconds);
+ } catch (InterruptedException e) {
+ LOG.debug("Interrupted sleep");
+ // Restore interrupted state...
+ Thread.currentThread().interrupt();
+ }
+ }
+
}
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerService.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerService.java
index 817d78d42..13fbc644e 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerService.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/DeviceManagerService.java
@@ -6,9 +6,9 @@
* =================================================================================================
* 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
@@ -16,35 +16,35 @@
* ============LICENSE_END==========================================================================
******************************************************************************/
package org.onap.ccsdk.features.sdnr.wt.devicemanager.impl;
+import javax.annotation.Nonnull;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
-
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
public interface DeviceManagerService {
public enum Action {
- ADD,
+ CREATE,
REMOVE,
UPDATE
}
/**
- * Managed device is connected to node/mountpoint.
+ * Mountpoint was created or existing. Managed device is now fully connected to node/mountpoint.
* @param action provide action
* @param nNodeId id of the mountpoint
* @param nNode mountpoint contents
*/
- void startListenerOnNodeForConnectedState(Action action, NodeId nNodeId, NetconfNode nNode);
+ void startListenerOnNodeForConnectedState(@Nonnull Action action, @Nonnull NodeId nNodeId, @Nonnull NetconfNode nNode);
/**
- * Managed device is disconnected from node/mountpoint.
+ * Mountpoint created or existing. Managed device is actually disconnected from node/ mountpoint.
* @param nNodeId id of the mountpoint
* @param nNode mountpoint contents
*/
- void leaveConnectedState(NodeId nNodeId, NetconfNode nNode);
+ void enterNonConnectedState(@Nonnull NodeId nNodeId, @Nonnull NetconfNode nNode);
/**
- * Removal indication of node/mountpoint.
+ * Mountpoint removed indication.
* @param nNodeId id of the mountpoint
*/
- void mountpointNodeRemoved(NodeId nNodeId);
+ void removeMountpointState(@Nonnull NodeId nNodeId);
}
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/database/types/equipment/ExtendedEquipment.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/database/types/equipment/ExtendedEquipment.java
index cdccd97ed..680a663ad 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/database/types/equipment/ExtendedEquipment.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/database/types/equipment/ExtendedEquipment.java
@@ -51,6 +51,10 @@ public class ExtendedEquipment {
return treeLevel;
}
-
+ @Override
+ public String toString() {
+ return "ExtendedEquipment [parentUuid=" + parentUuid + ", treeLevel=" + treeLevel + ", equipment=" + equipment
+ + "]";
+ }
}
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/listener/NetconfChangeListener.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/listener/NetconfChangeListener.java
index 1a92f37b7..fc5607557 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/listener/NetconfChangeListener.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/listener/NetconfChangeListener.java
@@ -42,16 +42,17 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-// 07.09.18 Switched to DataTreeChangeListener from ClusteredDataTreeChangeListener -> DM Service is running at all nodes
+// 07.09.18 Switched to DataTreeChangeListener from ClusteredDataTreeChangeListener -> DM Service is
+// running at all nodes
// This is not correct
public class NetconfChangeListener implements ClusteredDataTreeChangeListener<Node>, AutoCloseable {
private static final Logger LOG = LoggerFactory.getLogger(NetconfChangeListener.class);
- private static final InstanceIdentifier<Node> NETCONF_NODE_TOPO_IID = InstanceIdentifier
- .create(NetworkTopology.class)
- .child(Topology.class, new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName())))
- .child(Node.class);
+ private static final InstanceIdentifier<Node> NETCONF_NODE_TOPO_IID =
+ InstanceIdentifier.create(NetworkTopology.class)
+ .child(Topology.class, new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName())))
+ .child(Node.class);
// Name of ODL controller NETCONF instance
private static final String CONTROLLER = "controller-config";
@@ -65,8 +66,8 @@ public class NetconfChangeListener implements ClusteredDataTreeChangeListener<No
}
public void register() {
- DataTreeIdentifier<Node> treeId = new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL,
- NETCONF_NODE_TOPO_IID);
+ DataTreeIdentifier<Node> treeId = new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, NETCONF_NODE_TOPO_IID);
+
dlcReg = dataBroker.registerDataTreeChangeListener(treeId, this);
}
@@ -79,20 +80,16 @@ public class NetconfChangeListener implements ClusteredDataTreeChangeListener<No
/*---------------------------------------------------------------------------
* Listener
*/
-
@Override
public void onDataTreeChanged(Collection<DataTreeModification<Node>> changes) {
- if (LOG.isTraceEnabled()) {
- LOG.trace("OnDataChange, TreeChange {}", changes);
- } else if (LOG.isDebugEnabled()) {
- LOG.debug("OnDataChange, TreeChange");
- }
+ LOG.debug("OnDataChange, TreeChange, changes:{}", changes.size());
for (final DataTreeModification<Node> change : changes) {
final DataObjectModification<Node> root = change.getRootNode();
final ModificationType modificationType = root.getModificationType();
if (LOG.isTraceEnabled()) {
- LOG.trace("Handle this modificationType:{} path:{} root:{}", modificationType, change.getRootPath(), root);
+ LOG.trace("Handle this modificationType:{} path:{} root:{}", modificationType, change.getRootPath(),
+ root);
}
switch (modificationType) {
case SUBTREE_MODIFIED:
@@ -105,76 +102,92 @@ public class NetconfChangeListener implements ClusteredDataTreeChangeListener<No
// Treat an overwrite as an update
boolean update = root.getDataBefore() != null;
if (update) {
- //update(change);
+ // update(change);
doProcessing(Action.UPDATE, root.getDataAfter());
} else {
- //add(change);
- doProcessing(Action.ADD, root.getDataAfter());
+ // add(change);
+ doProcessing(Action.CREATE, root.getDataAfter());
}
break;
case DELETE:
// Node removed
- //remove(change);
+ // remove(change);
doProcessing(Action.REMOVE, root.getDataBefore());
break;
}
}
}
- /* ----------------------------------------------------------------
- * Functions to select the right node from DataObjectModification
+ /*
+ * ---------------------------------------------------------------- Functions to select the right
+ * node from DataObjectModification
*/
/**
* Process event and forward to clients
+ *
* @param action
- * @param node Basis node
+ * @param node Basis node
*/
private void doProcessing(Action action, Node node) {
- NodeId nodeId;
- NetconfNode nnode;
- try {
- NodeKey nodeKey = node.key();
- nodeId = nodeKey.getNodeId();
- nnode = node.augmentation(NetconfNode.class);
- } catch (NullPointerException e) {
- LOG.warn("Unexpected null .. stop processing.", e);
- return;
- }
-
- LOG.debug("doProcessing action {} {}",action, nodeId);
- String nodeIdString = nodeId.getValue();
- // Do not forward any controller related events to devicemanager
- if (nodeIdString.equals(CONTROLLER)) {
- LOG.debug("Stop processing for [{}]", nodeIdString);
- return;
- }
-
- // Related to action
- if (action == Action.REMOVE) {
- deviceManagerService.mountpointNodeRemoved(nodeId); //Stop Monitor
- deviceManagerService.leaveConnectedState(nodeId, nnode); //Remove Mountpoint handler
- return;
- }
+ NodeId nodeId = null;
+ NetconfNode nnode = null;
+ NodeKey nodeKey = null;
- // Related to Mountpoint status
- ConnectionStatus csts = nnode.getConnectionStatus();
- LOG.debug("NETCONF Node handled with status: {} {}", csts, nnode.getClusteredConnectionStatus());
- if (csts != null) {
- switch (csts) {
- case Connected: {
- deviceManagerService.startListenerOnNodeForConnectedState(action, nodeId, nnode);
- break;
+ try {
+ if (node != null) {
+ if ((nodeKey = node.key()) != null) {
+ nodeId = nodeKey.getNodeId();
}
- case UnableToConnect:
- case Connecting: {
- deviceManagerService.leaveConnectedState(nodeId, nnode);
- break;
+ nnode = node.augmentation(NetconfNode.class);
+ }
+
+ if (node == null || nnode == null || nodeId == null || nodeKey == null) {
+ LOG.warn("Unexpected node {}, netconf node {} or key {} or id {}", node, nnode, nodeKey, nodeId);
+ } else {
+
+ String nodeIdString = nodeId.getValue();
+ ConnectionStatus csts = nnode.getConnectionStatus();
+ LOG.debug("NETCONF Node processing with id {} action {} status {} cluster status {}", nodeIdString,
+ action, csts, nnode.getClusteredConnectionStatus());
+
+ // Do not forward any controller related events to devicemanager
+ if (nodeIdString.equals(CONTROLLER)) {
+ LOG.debug("Stop processing for [{}]", nodeIdString);
+ } else {
+ // Action related to mountpoint status
+ switch (action) {
+ case REMOVE:
+ deviceManagerService.removeMountpointState(nodeId); // Stop Monitor
+ deviceManagerService.enterNonConnectedState(nodeId, nnode); // Remove Mountpoint handler
+ break;
+
+ case UPDATE:
+ case CREATE:
+ if (csts != null) {
+ switch (csts) {
+ case Connected: {
+ deviceManagerService.startListenerOnNodeForConnectedState(action, nodeId,
+ nnode);
+ break;
+ }
+ case UnableToConnect:
+ case Connecting: {
+ deviceManagerService.enterNonConnectedState(nodeId, nnode);
+ break;
+ }
+ }
+ } else {
+ LOG.debug("NETCONF Node handled with null status for action", action);
+ }
+ break;
+ }
}
}
- } else {
- LOG.debug("NETCONF Node handled with null status");
+ } catch (NullPointerException e) {
+ LOG.warn("Unexpected null .. stop processing.", e);
}
}
+
}
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/listener/ODLEventListener.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/listener/ODLEventListener.java
index ace5f123d..ecaf06b55 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/listener/ODLEventListener.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/listener/ODLEventListener.java
@@ -23,6 +23,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.internalTypes.Internal
import org.onap.ccsdk.features.sdnr.wt.devicemanager.base.netconf.util.NetconfTimeStamp;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.ProviderClient;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.database.service.HtDatabaseEventsService;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.AttributeValueChangedNotificationXml;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ObjectCreationNotificationXml;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ObjectDeletionNotificationXml;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ProblemNotificationXml;
@@ -33,10 +34,10 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
- * Responsible class for documenting changes in the ODL itself. The occurence of
- * such an event is documented in the database and to clients. Specific example
- * here is the registration or deregistration of a netconf device. This service
- * has an own eventcounter to apply to the ONF Coremodel netconf behaviour.
+ * Responsible class for documenting changes in the ODL itself. The occurence of such an event is
+ * documented in the database and to clients. Specific example here is the registration or
+ * deregistration of a netconf device. This service has an own eventcounter to apply to the ONF
+ * Coremodel netconf behaviour.
*
* Important: Websocket notification must be the last action.
*
@@ -64,11 +65,10 @@ public class ODLEventListener {
/**
* Create a Service to document events to clients and within a database
*
- * @param ownKeyName The name of this service, that is used in the
- * database as identification key.
- * @param webSocketService service to direct messages to clients
- * @param databaseService service to write to the database
- * @param dcaeProvider to deliver problems to
+ * @param ownKeyName The name of this service, that is used in the database as identification key.
+ * @param webSocketService service to direct messages to clients
+ * @param databaseService service to write to the database
+ * @param dcaeProvider to deliver problems to
* @param maintenanceService2
*/
@SuppressWarnings("javadoc")
@@ -90,56 +90,65 @@ public class ODLEventListener {
}
/*---------------------------------------------------------------
- * Functions
+ * Handling of ODL Controller events
*/
/**
- * A registration of a mountpoint occured.
+ * A registration of a mountpoint occured, that is in connect state
*
- * @param registrationName Name of the event that is used as key in the
- * database.
+ * @param registrationName Name of the event that is used as key in the database.
*/
public void registration(String registrationName) {
- ObjectCreationNotificationXml cNotificationXml = new ObjectCreationNotificationXml(ownKeyName,
- popEvntNumberAsString(), InternalDateAndTime.valueOf(NETCONFTIME_CONVERTER.getTimeStamp()),
- registrationName);
+ ObjectCreationNotificationXml cNotificationXml =
+ new ObjectCreationNotificationXml(ownKeyName, getEventNumberAsString(),
+ InternalDateAndTime.valueOf(NETCONFTIME_CONVERTER.getTimeStamp()), registrationName);
// Write first to prevent missing entries
databaseService.writeEventLog(cNotificationXml);
-
webSocketService.sendViaWebsockets(registrationName, cNotificationXml);
-
}
+
/**
* A deregistration of a mountpoint occured.
*
- * @param registrationName Name of the event that is used as key in the
- * database.
+ * @param registrationName Name of the event that is used as key in the database.
*/
public void deRegistration(String registrationName) {
- ObjectDeletionNotificationXml dNotificationXml = new ObjectDeletionNotificationXml(ownKeyName,
- popEvntNumberAsString(), InternalDateAndTime.valueOf(NETCONFTIME_CONVERTER.getTimeStamp()),
- registrationName);
+ ObjectDeletionNotificationXml dNotificationXml =
+ new ObjectDeletionNotificationXml(ownKeyName, getEventNumberAsString(),
+ InternalDateAndTime.valueOf(NETCONFTIME_CONVERTER.getTimeStamp()), registrationName);
// Write first to prevent missing entries
databaseService.writeEventLog(dNotificationXml);
-
webSocketService.sendViaWebsockets(registrationName, dNotificationXml);
}
/**
+ * Mountpoint state changed .. from connected -> connecting or unable-to-connect or vis-e-versa.
+ *
+ * @param registrationName Name of the event that is used as key in the database.
+ */
+ public void updateRegistration(String registrationName, String attribute, String attributeNewValue) {
+ AttributeValueChangedNotificationXml notificationXml = new AttributeValueChangedNotificationXml(ownKeyName,
+ getEventNumberAsString(), InternalDateAndTime.valueOf(NETCONFTIME_CONVERTER.getTimeStamp()),
+ registrationName, attribute, attributeNewValue);
+ databaseService.writeEventLog(notificationXml);
+ webSocketService.sendViaWebsockets(registrationName, notificationXml);
+
+ }
+
+ /**
* At a mountpoint a problem situation is indicated
*
- * @param registrationName indicating object within SDN controller, normally the
- * mountpointName
- * @param problemName that changed
- * @param problemSeverity of the problem according to NETCONF/YANG
+ * @param registrationName indicating object within SDN controller, normally the mountpointName
+ * @param problemName that changed
+ * @param problemSeverity of the problem according to NETCONF/YANG
*/
public void onProblemNotification(String registrationName, String problemName, InternalSeverity problemSeverity) {
@@ -150,10 +159,10 @@ public class ODLEventListener {
.getSimpleName());
// notification
- ProblemNotificationXml notificationXml = new ProblemNotificationXml(ownKeyName, registrationName, problemName,
- problemSeverity,
- // popEvntNumberAsString(), InternalDateAndTime.TESTPATTERN );
- popEvntNumberAsString(), InternalDateAndTime.valueOf(NETCONFTIME_CONVERTER.getTimeStamp()));
+ ProblemNotificationXml notificationXml =
+ new ProblemNotificationXml(ownKeyName, registrationName, problemName, problemSeverity,
+ // popEvntNumberAsString(), InternalDateAndTime.TESTPATTERN );
+ getEventNumberAsString(), InternalDateAndTime.valueOf(NETCONFTIME_CONVERTER.getTimeStamp()));
databaseService.writeFaultLog(notificationXml);
databaseService.updateFaultCurrent(notificationXml);
@@ -173,6 +182,11 @@ public class ODLEventListener {
webSocketService.sendViaWebsockets(registrationName, notificationXml);
}
+
+ /*---------------------------------------------
+ * Handling of ODL Controller events
+ */
+
/**
* Called on exit to remove everything for a node from the current list.
*
@@ -198,7 +212,7 @@ public class ODLEventListener {
* Private
*/
- private String popEvntNumberAsString() {
+ private String getEventNumberAsString() {
return String.valueOf(popEvntNumber());
}
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientDummyImpl.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientDummyImpl.java
new file mode 100644
index 000000000..90f46ae96
--- /dev/null
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientDummyImpl.java
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * ============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.devicemanager.impl.xml;
+
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.listener.ODLEventListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * WrapperMock class for web-socket notifications to the web-socket service.
+ */
+public class WebSocketServiceClientDummyImpl implements WebSocketServiceClient {
+
+ private static final Logger LOG = LoggerFactory.getLogger(ODLEventListener.class);
+
+ public WebSocketServiceClientDummyImpl() {
+ }
+
+ @Override
+ public <T extends MwtNotificationBase & GetEventType> void sendViaWebsockets(String nodeName, T notificationXml) {
+ LOG.info("Dummy to send websocket event {} for mountpoint {}", notificationXml.getClass().getSimpleName(), nodeName);
+ }
+}
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientImpl2.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientImpl2.java
index 0cc83cf50..6ca7a5c18 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientImpl2.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/impl/xml/WebSocketServiceClientImpl2.java
@@ -6,9 +6,9 @@
* =================================================================================================
* 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
diff --git a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/database/types/EsPerformanceData.java b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/database/types/EsPerformanceData.java
index ef25f0282..d55311164 100644
--- a/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/database/types/EsPerformanceData.java
+++ b/sdnr/wt/devicemanager/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/performancemanager/impl/database/types/EsPerformanceData.java
@@ -410,7 +410,7 @@ public class EsPerformanceData {
}
@JsonGetter("tx-ethernet-bytes-sum")
- java.lang.Long getTxEthernetBytesSum() {
+ public java.lang.Long getTxEthernetBytesSum() {
return dataEthContainer12 != null ? dataEthContainer12.getTxEthernetBytesSum()
: dataEthContainer1211 != null ? dataEthContainer1211.getTxEthernetBytesSum()
: dataEthContainer1211p != null ? dataEthContainer1211p.getTxEthernetBytesSum() : null;
diff --git a/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/index/sdnevents/sdneventsMapping.json b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/index/sdnevents/sdneventsMapping.json
index 25cabedfc..83b7ffdaa 100644
--- a/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/index/sdnevents/sdneventsMapping.json
+++ b/sdnr/wt/devicemanager/provider/src/main/resources/elasticsearch/index/sdnevents/sdneventsMapping.json
@@ -1,157 +1,168 @@
-{
- "mappings": {
- "faultlog": {
- "properties": {
- "fault": {
- "properties": {
- "nodeName": {
- "index": "not_analyzed",
- "type": "string"
- },
- "severity": {
- "index": "not_analyzed",
- "type": "string"
- },
- "timeStamp": {
- "index": "not_analyzed",
- "type": "string"
- },
- "problem": {
- "index": "not_analyzed",
- "type": "string"
- },
- "counter": {
- "index": "not_analyzed",
- "type": "string"
- },
- "objectId": {
- "index": "not_analyzed",
- "type": "string"
- }
- }
- }
- }
- },
- "faultcurrent": {
- "properties": {
- "faultCurrent": {
- "properties": {
- "nodeName": {
- "index": "not_analyzed",
- "type": "string"
- },
- "severity": {
- "index": "not_analyzed",
- "type": "string"
- },
- "timeStamp": {
- "index": "not_analyzed",
- "type": "string"
- },
- "problem": {
- "index": "not_analyzed",
- "type": "string"
- },
- "counter": {
- "index": "not_analyzed",
- "type": "string"
- },
- "objectId": {
- "index": "not_analyzed",
- "type": "string"
- }
- }
- }
- }
- },
- "eventlog": {
- "properties": {
- "event": {
- "properties": {
- "nodeName": {
- "index": "not_analyzed",
- "type": "string"
- },
- "timeStamp": {
- "index": "not_analyzed",
- "type": "string"
- },
- "newValue": {
- "index": "not_analyzed",
- "type": "string"
- },
- "attributeName": {
- "index": "not_analyzed",
- "type": "string"
- },
- "counter": {
- "index": "not_analyzed",
- "type": "string"
- },
- "objectId": {
- "index": "not_analyzed",
- "type": "string"
- }
- }
- }
- }
- },
-
- "inventorytoplevel": {
- "properties": {
- "uuidList": {
- "index": "not_analyzed",
- "type": "string"
- },
- "mountpoint": {
- "index": "not_analyzed",
- "type": "string"
- }
- }
- },
- "inventoryequipment": {
- "properties": {
- "date": {
- "index": "not_analyzed",
- "type": "string"
- },
- "modelIdentifier": {
- "index": "not_analyzed",
- "type": "string"
- },
- "partTypeId": {
- "index": "not_analyzed",
- "type": "string"
- },
- "serial": {
- "index": "not_analyzed",
- "type": "string"
- },
- "typeName": {
- "index": "not_analyzed",
- "type": "string"
- },
- "description": {
- "index": "not_analyzed",
- "type": "string"
- },
- "uuid": {
- "index": "not_analyzed",
- "type": "string"
- },
- "version": {
- "index": "not_analyzed",
- "type": "string"
- },
- "containedHolder": {
- "index": "not_analyzed",
- "type": "string"
- },
- "mountpoint": {
- "index": "not_analyzed",
- "type": "string"
- }
- }
- }
- }
-}
+{
+ "mappings": {
+ "faultlog": {
+ "properties": {
+ "fault": {
+ "properties": {
+ "nodeName": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "severity": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "timeStamp": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "problem": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "counter": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "objectId": {
+ "index": "not_analyzed",
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "faultcurrent": {
+ "properties": {
+ "faultCurrent": {
+ "properties": {
+ "nodeName": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "severity": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "timeStamp": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "problem": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "counter": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "objectId": {
+ "index": "not_analyzed",
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+ "eventlog": {
+ "properties": {
+ "event": {
+ "properties": {
+ "nodeName": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "timeStamp": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "newValue": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "attributeName": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "counter": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "objectId": {
+ "index": "not_analyzed",
+ "type": "string"
+ }
+ }
+ }
+ }
+ },
+
+ "inventorytoplevel": {
+ "properties": {
+ "uuidList": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "mountpoint": {
+ "index": "not_analyzed",
+ "type": "string"
+ }
+ }
+ },
+ "inventoryequipment": {
+ "properties": {
+ "date": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "modelIdentifier": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "manufacturerIdentifier": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "typeName": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "description": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "uuid": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "version": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "parentUuid": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "containedHolder": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "mountpoint": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "treeLevel": {
+ "type": "long"
+ },
+ "partTypeId": {
+ "index": "not_analyzed",
+ "type": "string"
+ },
+ "serial": {
+ "index": "not_analyzed",
+ "type": "string"
+ }
+ }
+ }
+ }
+}