summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/netconfnode-state-service/model
diff options
context:
space:
mode:
authorRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2022-01-31 16:34:09 +0530
committerRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2022-01-31 16:34:30 +0530
commit3eaa42a454569639597eded0df4a181ca66f45d4 (patch)
tree7091a0179c88e29f1e33f76c09bb62e07b862ba5 /sdnr/wt/netconfnode-state-service/model
parent4d62788c11ac7e3a18e5c4b3eccf5eb5896bde70 (diff)
Enhance netconfnode-state-service bundle
Add support for new capabilities and DOM functions Issue-ID: CCSDK-3576 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> Change-Id: Ie7a4a4d5002dd846c4028457e19d00490f819a94 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/netconfnode-state-service/model')
-rw-r--r--sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/Capabilities.java24
-rw-r--r--sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfAccessor.java7
-rw-r--r--sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfDomAccessor.java11
3 files changed, 40 insertions, 2 deletions
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 133868fcf..82232b2d5 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
@@ -48,8 +48,9 @@ public class Capabilities {
private static final Logger LOG = LoggerFactory.getLogger(Capabilities.class);
private static final String UNSUPPORTED = "Unsupported";
+ private static final DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
+
private final List<String> capabilities = new ArrayList<>();
- private final DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
private Capabilities() {}
@@ -151,6 +152,25 @@ public class Capabilities {
}
/**
+ * Provide namespace and its revision as String.
+ *
+ * @param qCapability capability from the model
+ * @return String
+ */
+ public static String getNamespaceAndRevisionAsString(QName qCapability) {
+ StringBuffer res = new StringBuffer();
+ res.append(qCapability.getNamespace().toString());
+
+ String revisionString = getRevisionString(qCapability);
+ if (revisionString != null) {
+ res.append("?");
+ res.append(revisionString);
+ }
+
+ return res.toString();
+ }
+
+ /**
*
* @param namespace requested
* @param revision request or null for any revision
@@ -178,7 +198,7 @@ public class Capabilities {
* @param qCapability that specifies the revision
* @return String with revisiondate or null
*/
- private String getRevisionString(QName qCapability) {
+ private static String getRevisionString(QName qCapability) {
Object revisionObject = qCapability.getRevision();
String revision = null;
if (revisionObject instanceof Optional) {
diff --git a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfAccessor.java b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfAccessor.java
index a419b3ac3..46fbbacc0 100644
--- a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfAccessor.java
+++ b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfAccessor.java
@@ -19,6 +19,7 @@ package org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice;
import java.util.Optional;
import org.opendaylight.mdsal.binding.api.DataBroker;
+import org.opendaylight.mdsal.dom.api.DOMDataBroker;
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;
@@ -35,6 +36,12 @@ public interface NetconfAccessor {
DataBroker getControllerBindingDataBroker();
/**
+ * @return the Controller DOMDataBroker
+ */
+ DOMDataBroker getControllerDOMDataBroker();
+
+
+ /**
* @return the nodeId
*/
NodeId getNodeId();
diff --git a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfDomAccessor.java b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfDomAccessor.java
index e78579a47..1013e37c7 100644
--- a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfDomAccessor.java
+++ b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfDomAccessor.java
@@ -76,6 +76,16 @@ public interface NetconfDomAccessor extends NetconfAccessor {
Optional<NormalizedNode<?, ?>> readDataNode(LogicalDatastoreType dataStoreType, YangInstanceIdentifier path);
/**
+ * Read data from Controller node - controller-config
+ *
+ * @param dataStoreType
+ * @param path
+ * @return NormalizedNode<?, ?> with data
+ */
+ Optional<NormalizedNode<?, ?>> readControllerDataNode(LogicalDatastoreType dataStoreType,
+ YangInstanceIdentifier path);
+
+ /**
* Register netconf notification listener for related mountpoint
*
* @param <T> specific child class of DOMNotificationListener
@@ -153,4 +163,5 @@ public interface NetconfDomAccessor extends NetconfAccessor {
* @return serialization object.
*/
BindingNormalizedNodeSerializer getBindingNormalizedNodeSerializer();
+
}