Bug 3135 - Fixed support for InterestListener
[controller.git] / opendaylight / md-sal / sal-binding-broker / src / main / java / org / opendaylight / controller / md / sal / binding / impl / BindingDOMNotificationPublishServiceAdapter.java
index 6c54553..084f423 100644 (file)
@@ -17,7 +17,6 @@ import org.opendaylight.controller.md.sal.binding.impl.BindingDOMAdapterBuilder.
 import org.opendaylight.controller.md.sal.dom.api.DOMNotification;
 import org.opendaylight.controller.md.sal.dom.api.DOMNotificationPublishService;
 import org.opendaylight.controller.md.sal.dom.api.DOMService;
-import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer;
 import org.opendaylight.yangtools.yang.binding.Notification;
 
 public class BindingDOMNotificationPublishServiceAdapter implements NotificationPublishService, AutoCloseable {
@@ -31,14 +30,22 @@ public class BindingDOMNotificationPublishServiceAdapter implements Notification
 
     };
 
-    private final BindingNormalizedNodeSerializer codecRegistry;
+    private final BindingToNormalizedNodeCodec codecRegistry;
     private final DOMNotificationPublishService domPublishService;
 
-    public BindingDOMNotificationPublishServiceAdapter(final BindingNormalizedNodeSerializer codecRegistry, final DOMNotificationPublishService domPublishService) {
-        this.codecRegistry = codecRegistry;
+    public BindingDOMNotificationPublishServiceAdapter(final BindingToNormalizedNodeCodec codec, final DOMNotificationPublishService domPublishService) {
+        this.codecRegistry = codec;
         this.domPublishService = domPublishService;
     }
 
+    public BindingToNormalizedNodeCodec getCodecRegistry() {
+        return codecRegistry;
+    }
+
+    public DOMNotificationPublishService getDomPublishService() {
+        return domPublishService;
+    }
+
     @Override
     public void putNotification(final Notification notification) throws InterruptedException {
         domPublishService.putNotification(toDomNotification(notification));
@@ -76,9 +83,8 @@ public class BindingDOMNotificationPublishServiceAdapter implements Notification
         @Override
         protected NotificationPublishService createInstance(final BindingToNormalizedNodeCodec codec,
                 final ClassToInstanceMap<DOMService> delegates) {
-            final BindingNormalizedNodeSerializer codecReg = codec.getCodecRegistry();
             final DOMNotificationPublishService domPublish = delegates.getInstance(DOMNotificationPublishService.class);
-            return new BindingDOMNotificationPublishServiceAdapter(codecReg, domPublish);
+            return new BindingDOMNotificationPublishServiceAdapter(codec, domPublish);
         }
 
     }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.