summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/mountpoint-registrar/provider/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'sdnr/wt/mountpoint-registrar/provider/src/main')
-rw-r--r--sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPFaultVESMsgConsumer.java12
-rw-r--r--sdnr/wt/mountpoint-registrar/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/mountpointregistrar/impl/DMaaPPNFRegVESMsgConsumer.java9
2 files changed, 19 insertions, 2 deletions
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 ec5198012..6daeb493d 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 @@ public class DMaaPFaultVESMsgConsumer extends DMaaPVESMsgConsumerImpl {
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 1d70077b9..1d95ea522 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 @@ public class DMaaPPNFRegVESMsgConsumer extends DMaaPVESMsgConsumerImpl {
@Override
public void processMsg(String msg) {
LOG.debug("Message from DMaaP topic is - {} ", msg);
- @Nullable
String pnfId;
String pnfIPAddress;
@Nullable
@@ -57,10 +56,18 @@ public class DMaaPPNFRegVESMsgConsumer extends DMaaPVESMsgConsumerImpl {
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 =