Ignore SDN-R generated VES Messages

Both Fault and PNFReg VES Messages with reportingEntity=SDN-R are ignored

Issue-ID: CCSDK-3409
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Change-Id: Id6980cfa4fe79cae240b8c94cac3c4271da32671
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
diff --git a/sdnr/wt/mountpoint-registrar/installer/pom.xml b/sdnr/wt/mountpoint-registrar/installer/pom.xml
index 34a70bb..d1ee3fb 100755
--- a/sdnr/wt/mountpoint-registrar/installer/pom.xml
+++ b/sdnr/wt/mountpoint-registrar/installer/pom.xml
@@ -47,7 +47,7 @@
 
     <dependencies>
         <dependency>
-            <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
+            <groupId>${project.groupId}</groupId>
             <artifactId>${application.name}-feature</artifactId>
             <version>${project.version}</version>
             <type>xml</type>
@@ -60,7 +60,7 @@
             </exclusions>
         </dependency>
         <dependency>
-            <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
+            <groupId>${project.groupId}</groupId>
             <artifactId>${application.name}-provider</artifactId>
             <version>${project.version}</version>
         </dependency>
diff --git a/sdnr/wt/mountpoint-registrar/provider/pom.xml b/sdnr/wt/mountpoint-registrar/provider/pom.xml
index 4a6a3f0..69af460 100644
--- a/sdnr/wt/mountpoint-registrar/provider/pom.xml
+++ b/sdnr/wt/mountpoint-registrar/provider/pom.xml
@@ -30,7 +30,7 @@
         <groupId>org.onap.ccsdk.parent</groupId>
         <artifactId>binding-parent</artifactId>
         <version>2.2.0-SNAPSHOT</version>
-        <relativePath/>
+        <relativePath />
     </parent>
 
     <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
@@ -66,7 +66,7 @@
             <version>${project.version}</version>
         </dependency>
         <dependency>
-            <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
+            <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-common</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
@@ -106,13 +106,13 @@
             <artifactId>dmaapClient</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
+            <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-data-provider-model</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.onap.ccsdk.features.sdnr.wt</groupId>
+            <groupId>${project.groupId}</groupId>
             <artifactId>sdnr-wt-devicemanager-core-model</artifactId>
             <version>${project.version}</version>
             <scope>provided</scope>
diff --git a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPFaultVESMsgConsumer.java b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPFaultVESMsgConsumer.java
index ec51980..6daeb49 100644
--- a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPFaultVESMsgConsumer.java
+++ b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPFaultVESMsgConsumer.java
@@ -49,19 +49,29 @@
         String faultSeverity;
         String vesDomain;
         int faultSequence;
+        String reportingEntityName;
         ObjectMapper oMapper = new ObjectMapper();
         JsonNode dmaapMessageRootNode;
 
         LOG.info("Fault VES Message is - {}", msg);
         try {
             dmaapMessageRootNode = oMapper.readTree(msg);
+            reportingEntityName = dmaapMessageRootNode.at("/event/commonEventHeader/reportingEntityName").textValue();
+            if (reportingEntityName.equals("ONAP SDN-R")) {
+                LOG.info(
+                        "VES PNF Registration message generated by SDNR, hence no need to process any further; Ignoring the received message");
+                return;
+            }
+
             vesDomain = dmaapMessageRootNode.at("/event/commonEventHeader/domain").textValue();
             if (!vesDomain.equalsIgnoreCase("fault")) {
                 LOG.warn("Received {} domain VES Message in DMaaP Fault topic, ignoring it", vesDomain);
                 return;
             }
             faultNodeId = dmaapMessageRootNode.at("/event/commonEventHeader/sourceName").textValue();
-            faultOccurrenceTime = Instant.ofEpochMilli(dmaapMessageRootNode.at("/event/commonEventHeader/startEpochMicrosec").longValue()/1000)
+            faultOccurrenceTime = Instant
+                    .ofEpochMilli(
+                            dmaapMessageRootNode.at("/event/commonEventHeader/startEpochMicrosec").longValue() / 1000)
                     .atZone(ZoneId.of("Z")).toString();
             faultObjectId = dmaapMessageRootNode.at("/event/faultFields/alarmInterfaceA").textValue();
             faultReason = dmaapMessageRootNode.at("/event/faultFields/specificProblem").textValue();
diff --git a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPPNFRegVESMsgConsumer.java b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPPNFRegVESMsgConsumer.java
index 1d70077..1d95ea5 100644
--- a/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPPNFRegVESMsgConsumer.java
+++ b/sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPPNFRegVESMsgConsumer.java
@@ -44,7 +44,6 @@
     @Override
     public void processMsg(String msg) {
         LOG.debug("Message from DMaaP topic is - {} ", msg);
-        @Nullable
         String pnfId;
         String pnfIPAddress;
         @Nullable
@@ -57,10 +56,18 @@
         String pnfUsername;
         @Nullable
         String pnfPasswd = null;
+        String reportingEntityName;
         ObjectMapper oMapper = new ObjectMapper();
         JsonNode dmaapMessageRootNode;
         try {
             dmaapMessageRootNode = oMapper.readTree(msg);
+            reportingEntityName = dmaapMessageRootNode.at("/event/commonEventHeader/reportingEntityName").textValue();
+            if (reportingEntityName.equals("ONAP SDN-R")) {
+                LOG.info(
+                        "VES PNF Registration message generated by SDNR, hence no need to process any further; Ignoring the received message");
+                return;
+            }
+
             pnfId = dmaapMessageRootNode.at("/event/commonEventHeader/sourceName").textValue();
             pnfIPAddress = getPNFIPAddress(dmaapMessageRootNode);
             pnfCommProtocol =