Serialize capabilities for notification properly 55/15555/2
authorMaros Marsalek <mmarsale@cisco.com>
Fri, 20 Feb 2015 14:13:03 +0000 (15:13 +0100)
committerMaros Marsalek <mmarsale@cisco.com>
Mon, 23 Feb 2015 10:45:08 +0000 (11:45 +0100)
Added and removed capabilities in capabilities change notification were serialized as QName.toString but should be na Uri

Change-Id: Id9783c060ecf45d3a7f506cf605051c779a6d21a
Signed-off-by: Maros Marsalek <mmarsale@cisco.com>
opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/NotificationHandler.java
opendaylight/netconf/config-netconf-connector/src/main/java/org/opendaylight/controller/netconf/confignetconfconnector/osgi/YangStoreService.java

index d340e4c1adf1b28f90600c0f320004dbede0f79c..bc3326e1ae5b58dc23dc7c14927a83d5d34d1fcf 100644 (file)
@@ -63,7 +63,7 @@ final class NotificationHandler {
 
     private CompositeNode transformNotification(final NetconfMessage cachedNotification) {
         final CompositeNode parsedNotification = messageTransformer.toNotification(cachedNotification);
-        Preconditions.checkNotNull(parsedNotification, "{}: Unable to parse received notification %s", id, cachedNotification);
+        Preconditions.checkNotNull(parsedNotification, "%s: Unable to parse received notification: %s", id, cachedNotification);
         return parsedNotification;
     }
 
@@ -91,6 +91,7 @@ final class NotificationHandler {
     }
 
     synchronized void onRemoteSchemaDown() {
+        queue.clear();
         passNotifications = false;
     }
 
index 60b8b8f468b3a42938328fd65fa3e50b534186fd..176800fb975ba2dd7dc7fe05ad0ca03ffb301a3b 100644 (file)
@@ -191,8 +191,7 @@ public class YangStoreService implements YangStoreContext {
     private static final Function<Module, Uri> MODULE_TO_URI = new Function<Module, Uri>() {
         @Override
         public Uri apply(final Module input) {
-            final QName qName = QName.cachedReference(QName.create(input.getQNameModule(), input.getName()));
-            return new Uri(qName.toString());
+            return new Uri(new NetconfOperationServiceFactoryImpl.YangStoreCapability(input, input.getSource()).getCapabilityUri());
         }
     };