Bump versions to 2.0.0-SNAPSHOT
[netconf.git] / netconf / messagebus-netconf / src / main / java / org / opendaylight / netconf / messagebus / eventsources / netconf / ConnectionNotificationTopicRegistration.java
index ba61ce67181b06622f29166e756afda3282b5800..3cdd66052a2fcee63b62d89e93a03a5c04e007b9 100644 (file)
@@ -24,10 +24,11 @@ import org.opendaylight.yang.gen.v1.urn.cisco.params.xml.ns.yang.messagebus.even
 import org.opendaylight.yangtools.util.xml.UntrustedXML;
 import org.opendaylight.yangtools.yang.common.QName;
 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeIdentifier;
-import org.opendaylight.yangtools.yang.data.api.schema.AnyXmlNode;
 import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode;
+import org.opendaylight.yangtools.yang.data.api.schema.DOMSourceAnyxmlNode;
 import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
 import org.opendaylight.yangtools.yang.model.api.SchemaPath;
+import org.opendaylight.yangtools.yang.model.api.stmt.SchemaNodeIdentifier.Absolute;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.w3c.dom.Document;
@@ -36,12 +37,12 @@ import org.w3c.dom.Element;
 /**
  * Topic registration on event-source-status-notification.
  */
+@Deprecated(forRemoval = true)
 class ConnectionNotificationTopicRegistration extends NotificationTopicRegistration {
-
     private static final Logger LOG = LoggerFactory.getLogger(ConnectionNotificationTopicRegistration.class);
 
-    public static final SchemaPath EVENT_SOURCE_STATUS_PATH = SchemaPath
-            .create(true, QName.create(EventSourceStatusNotification.QNAME, "event-source-status"));
+    public static final Absolute EVENT_SOURCE_STATUS_PATH =
+            Absolute.of(QName.create(EventSourceStatusNotification.QNAME, "event-source-status"));
     private static final NodeIdentifier EVENT_SOURCE_STATUS_ARG = NodeIdentifier.create(
             EventSourceStatusNotification.QNAME);
 
@@ -50,7 +51,7 @@ class ConnectionNotificationTopicRegistration extends NotificationTopicRegistrat
     ConnectionNotificationTopicRegistration(final String sourceName,
                                             final DOMNotificationListener domNotificationListener) {
         super(NotificationSourceType.ConnectionStatusChange, sourceName,
-                EVENT_SOURCE_STATUS_PATH.getLastComponent().getNamespace().toString());
+                EVENT_SOURCE_STATUS_PATH.lastNodeIdentifier().getNamespace().toString());
         this.domNotificationListener = requireNonNull(domNotificationListener);
         LOG.info("Connection notification source has been initialized.");
         setActive(true);
@@ -127,7 +128,7 @@ class ConnectionNotificationTopicRegistration extends NotificationTopicRegistrat
         DOMNotification dn = new DOMNotification() {
 
             @Override
-            public SchemaPath getType() {
+            public Absolute getType() {
                 return EVENT_SOURCE_STATUS_PATH;
             }
 
@@ -139,7 +140,7 @@ class ConnectionNotificationTopicRegistration extends NotificationTopicRegistrat
         return dn;
     }
 
-    private static AnyXmlNode encapsulate(final EventSourceStatusNotification notification) {
+    private static DOMSourceAnyxmlNode encapsulate(final EventSourceStatusNotification notification) {
         Document doc = UntrustedXML.newDocumentBuilder().newDocument();
 
         final Element rootElement = XmlUtil.createElement(doc, "EventSourceStatusNotification",