summaryrefslogtreecommitdiffstats
path: root/sdnr
diff options
context:
space:
mode:
Diffstat (limited to 'sdnr')
-rwxr-xr-xsdnr/wt/mountpoint-registrar/installer/pom.xml4
-rw-r--r--sdnr/wt/mountpoint-registrar/provider/pom.xml8
-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
-rwxr-xr-xsdnr/wt/netconfnode-state-service/installer/pom.xml4
-rw-r--r--sdnr/wt/netconfnode-state-service/model/pom.xml2
-rw-r--r--sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/Capabilities.java57
7 files changed, 52 insertions, 44 deletions
diff --git a/sdnr/wt/mountpoint-registrar/installer/pom.xml b/sdnr/wt/mountpoint-registrar/installer/pom.xml
index 34a70bb77..d1ee3fbb0 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 4a6a3f021..69af460f8 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 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 =
diff --git a/sdnr/wt/netconfnode-state-service/installer/pom.xml b/sdnr/wt/netconfnode-state-service/installer/pom.xml
index 5a066fdd6..f2ed1ce23 100755
--- a/sdnr/wt/netconfnode-state-service/installer/pom.xml
+++ b/sdnr/wt/netconfnode-state-service/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/netconfnode-state-service/model/pom.xml b/sdnr/wt/netconfnode-state-service/model/pom.xml
index 69f38ed9f..731578d67 100644
--- a/sdnr/wt/netconfnode-state-service/model/pom.xml
+++ b/sdnr/wt/netconfnode-state-service/model/pom.xml
@@ -62,7 +62,7 @@
<scope>provided</scope>
</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>
</dependency>
diff --git a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/Capabilities.java b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/Capabilities.java
index 9c24b8b4b..f12c53a4d 100644
--- a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/Capabilities.java
+++ b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/Capabilities.java
@@ -21,20 +21,18 @@
*/
package org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import javax.annotation.Nullable;
-import org.eclipse.jdt.annotation.NonNull;
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.netconf.node.connection.status.AvailableCapabilities;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.status.UnavailableCapabilities;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.status.available.capabilities.AvailableCapability;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.netconf.node.connection.status.unavailable.capabilities.UnavailableCapability;
import org.opendaylight.yangtools.yang.common.QName;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -48,14 +46,12 @@ public class Capabilities {
private static final Logger LOG = LoggerFactory.getLogger(Capabilities.class);
- private static final String METHODNAME = "getCapability";
private static final String UNSUPPORTED = "Unsupported";
private final List<String> capabilities = new ArrayList<>();
private final DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
private Capabilities() {}
- @SuppressWarnings("null")
public static Capabilities getAvailableCapabilities(@Nullable NetconfNode nnode) {
LOG.info("GetAvailableCapabilities for node");
Capabilities capabilities = new Capabilities();
@@ -72,14 +68,13 @@ public class Capabilities {
return capabilities;
}
- @SuppressWarnings("null")
public static Capabilities getUnavailableCapabilities(NetconfNode nnode) {
LOG.info("GetUnavailableCapabilities for node");
Capabilities capabilities = new Capabilities();
if (nnode != null) {
UnavailableCapabilities availableCapabilites = nnode.getUnavailableCapabilities();
if (availableCapabilites != null) {
- capabilities.constructor(availableCapabilites.getUnavailableCapability());
+ capabilities.constructor2(availableCapabilites.getUnavailableCapability());
} else {
LOG.debug("empty capabilites");
}
@@ -93,30 +88,20 @@ public class Capabilities {
/**
* Does all construction steps
*
- * @param pcapabilities with a list of capabilities. <br>
- * Type could be <br>
- * - Boron: List<code><String></code> <br>
- * - Carbon: List<AvailableCapability>
+ * @param pcapabilities with a list of capabilities.
*/
- private void constructor(List<@NonNull ?> pcapabilities) {
+ private void constructor(List<AvailableCapability> pcapabilities) {
if (pcapabilities != null) {
- Method methodGetCapability;
-
- for (Object capability : pcapabilities) {
- if (capability instanceof String) { // ODL Boron specific
- this.capabilities.add((String) capability);
- } else { // Carbon specific part .. handled via generics
- try {
- methodGetCapability = capability.getClass().getDeclaredMethod(METHODNAME);
- methodGetCapability.setAccessible(true);
- this.capabilities.add(methodGetCapability.invoke(capability).toString());
- } catch (NoSuchMethodException | SecurityException | IllegalAccessException
- | IllegalArgumentException | InvocationTargetException e) {
- LOG.warn("Capability class with missing interface method {}: {} {} {}", METHODNAME,
- e.getMessage(), capability.getClass(),
- Arrays.toString(capability.getClass().getInterfaces()));
- }
- }
+ for (AvailableCapability capability : pcapabilities) {
+ this.capabilities.add(capability.getCapability());
+ }
+ }
+ }
+
+ private void constructor2(List<UnavailableCapability> pcapabilities) {
+ if (pcapabilities != null) {
+ for (UnavailableCapability capability : pcapabilities) {
+ this.capabilities.add(capability.getCapability());
}
}
}
@@ -132,6 +117,7 @@ public class Capabilities {
/**
* Verify if the namespace is supported
+ *
* @param qCapability from model
* @return true if namespace is supported
*/
@@ -142,6 +128,7 @@ public class Capabilities {
/**
* Verify if the namespace is supported
+ *
* @param namespace
* @return
*/
@@ -151,12 +138,12 @@ public class Capabilities {
/**
* check if the namespace and its revision are supported by the given capabilities
+ *
* @param qCapability capability from the model
* @return true if supporting the model AND revision<br>
* false if revision not available or both not found.
*/
public boolean isSupportingNamespaceAndRevision(QName qCapability) {
-
String namespace = qCapability.getNamespace().toString();
String revision = getRevisionString(qCapability);
return revision == null ? false : isSupportingNamespaceAndRevision(namespace, revision);
@@ -170,8 +157,11 @@ public class Capabilities {
*/
public boolean isSupportingNamespaceAndRevision(String namespace, @Nullable String revision) {
LOG.trace("isSupportingNamespaceAndRevision: Model namespace {}?[revision {}]", namespace, revision);
+
+ final String nsAndRev = String.format("%s?revision=%s", namespace, revision);
for (String capability : capabilities) {
- if (capability.contains(namespace) && (revision == null || capability.contains(revision))) {
+ //if (capability.contains(namespace) && (revision == null || capability.contains(revision))) {
+ if (capability.contains(revision != null ? nsAndRev : namespace)) {
LOG.trace("Verify true with: {}", capability);
return true;
} else {
@@ -228,11 +218,12 @@ public class Capabilities {
/**
* Verify if QName namespace is supported by capabilities
+ *
* @param revision result of getRevisionForNamespace()
* @return true if namespace is supported.
*/
static public boolean isNamespaceSupported(String revision) {
- return revision != UNSUPPORTED;
+ return revision != UNSUPPORTED;
}
@Override