X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fbinding%2Fimpl%2FBindingDOMNotificationServiceAdapter.java;h=684122c591316265507fcda6232a4679d9dba016;hb=b4bf55727093657662d8c16a50fa85f87978a586;hp=2a31d34d016a3e86d116b9c5e9c1f57fb775bd1f;hpb=6fdcecdc2ecc9f8489de7c72f0709d28b6a1da87;p=controller.git diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMNotificationServiceAdapter.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMNotificationServiceAdapter.java index 2a31d34d01..684122c591 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMNotificationServiceAdapter.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/BindingDOMNotificationServiceAdapter.java @@ -14,46 +14,42 @@ import org.opendaylight.controller.md.sal.binding.api.NotificationService; import org.opendaylight.controller.md.sal.binding.impl.BindingDOMAdapterBuilder.Factory; import org.opendaylight.controller.md.sal.dom.api.DOMNotificationService; import org.opendaylight.controller.md.sal.dom.api.DOMService; -import org.opendaylight.yangtools.binding.data.codec.api.BindingNormalizedNodeSerializer; +import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer; import org.opendaylight.yangtools.concepts.AbstractListenerRegistration; import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.yang.binding.NotificationListener; public class BindingDOMNotificationServiceAdapter implements NotificationService, AutoCloseable { - public static final Factory BUILDER_FACTORY = new Factory() { - - @Override - public BindingDOMAdapterBuilder newBuilder() { - return new Builder(); - } - - }; + public static final Factory BUILDER_FACTORY = Builder::new; private final BindingNormalizedNodeSerializer codec; private final DOMNotificationService domNotifService; - public BindingDOMNotificationServiceAdapter(final BindingNormalizedNodeSerializer codec, final DOMNotificationService domNotifService) { + public BindingDOMNotificationServiceAdapter(final BindingNormalizedNodeSerializer codec, + final DOMNotificationService domNotifService) { this.codec = codec; this.domNotifService = domNotifService; } @Override public ListenerRegistration registerNotificationListener(final T listener) { - final BindingDOMNotificationListenerAdapter domListener = new BindingDOMNotificationListenerAdapter(codec, listener); + final BindingDOMNotificationListenerAdapter domListener = + new BindingDOMNotificationListenerAdapter(codec, listener); final ListenerRegistration domRegistration = domNotifService.registerNotificationListener(domListener, domListener.getSupportedNotifications()); return new ListenerRegistrationImpl<>(listener, domRegistration); } @Override - public void close() throws Exception { + public void close() { } - private static class ListenerRegistrationImpl extends AbstractListenerRegistration { + private static class ListenerRegistrationImpl + extends AbstractListenerRegistration { private final ListenerRegistration listenerRegistration; - public ListenerRegistrationImpl(final T listener, final ListenerRegistration listenerRegistration) { + ListenerRegistrationImpl(final T listener, final ListenerRegistration listenerRegistration) { super(listener); this.listenerRegistration = listenerRegistration; } @@ -78,4 +74,8 @@ public class BindingDOMNotificationServiceAdapter implements NotificationService return ImmutableSet.of(DOMNotificationService.class); } } + + public DOMNotificationService getDomService() { + return domNotifService; + } }