summaryrefslogtreecommitdiffstats
path: root/sdnr/wt/netconfnode-state-service/model
diff options
context:
space:
mode:
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();
+
}