X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-netconf-connector%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fsal%2Fconnect%2Fnetconf%2Fsal%2FNetconfDeviceNotificationService.java;h=b27430f5e3a5483ed02951787c33ddfeb2df42d7;hp=bfcb4caddb9754c89b9ee1fa9f9bd13aa108dff4;hb=e433e0aa67cc6d144cd3d8d6117de864eb7ebf97;hpb=5273304e9f607a15c1c17aca1c05d7aac2c0260e;ds=sidebyside diff --git a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/sal/NetconfDeviceNotificationService.java b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/sal/NetconfDeviceNotificationService.java index bfcb4caddb..b27430f5e3 100644 --- a/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/sal/NetconfDeviceNotificationService.java +++ b/opendaylight/md-sal/sal-netconf-connector/src/main/java/org/opendaylight/controller/sal/connect/netconf/sal/NetconfDeviceNotificationService.java @@ -8,8 +8,6 @@ package org.opendaylight.controller.sal.connect.netconf.sal; -import static org.opendaylight.controller.sal.connect.netconf.util.NetconfMessageTransformUtil.toPath; - import com.google.common.collect.HashMultimap; import com.google.common.collect.Lists; import com.google.common.collect.Multimap; @@ -19,7 +17,6 @@ import org.opendaylight.controller.md.sal.dom.api.DOMNotification; import org.opendaylight.controller.md.sal.dom.api.DOMNotificationListener; import org.opendaylight.controller.md.sal.dom.api.DOMNotificationService; import org.opendaylight.yangtools.concepts.ListenerRegistration; -import org.opendaylight.yangtools.yang.data.api.schema.ContainerNode; import org.opendaylight.yangtools.yang.model.api.SchemaPath; class NetconfDeviceNotificationService implements DOMNotificationService { @@ -28,22 +25,9 @@ class NetconfDeviceNotificationService implements DOMNotificationService { // Notification publish is very simple and hijacks the thread of the caller // TODO shouldnt we reuse the implementation for notification router from sal-broker-impl ? - public synchronized void publishNotification(final ContainerNode notification) { - final SchemaPath schemaPath = toPath(notification.getNodeType()); - for (final DOMNotificationListener domNotificationListener : listeners.get(schemaPath)) { - domNotificationListener.onNotification(new DOMNotification() { - @Nonnull - @Override - public SchemaPath getType() { - return schemaPath; - } - - @Nonnull - @Override - public ContainerNode getBody() { - return notification; - } - }); + public synchronized void publishNotification(final DOMNotification notification) { + for (final DOMNotificationListener domNotificationListener : listeners.get(notification.getType())) { + domNotificationListener.onNotification(notification); } }