X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=restconf%2Frestconf-nb%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Frestconf%2Fserver%2Fmdsal%2Fstreams%2Fdevnotif%2FDeviceNotificationSource.java;fp=restconf%2Frestconf-nb%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Frestconf%2Fnb%2Frfc8040%2Fstreams%2FDeviceNotificationSource.java;h=ca95521b68a49c3c77cc22f282da17d15a529851;hb=8616c9655db145125c23ca8e66b5f27745126458;hp=356546117ad203e70a0aa457f0ef2ae939502347;hpb=c8937e6a34ad36d1ea88b037ae14118033b1612c;p=netconf.git diff --git a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/DeviceNotificationSource.java b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/mdsal/streams/devnotif/DeviceNotificationSource.java similarity index 90% rename from restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/DeviceNotificationSource.java rename to restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/mdsal/streams/devnotif/DeviceNotificationSource.java index 356546117a..ca95521b68 100644 --- a/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/nb/rfc8040/streams/DeviceNotificationSource.java +++ b/restconf/restconf-nb/src/main/java/org/opendaylight/restconf/server/mdsal/streams/devnotif/DeviceNotificationSource.java @@ -5,7 +5,7 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ -package org.opendaylight.restconf.nb.rfc8040.streams; +package org.opendaylight.restconf.server.mdsal.streams.devnotif; import static java.util.Objects.requireNonNull; @@ -17,7 +17,9 @@ import org.opendaylight.mdsal.dom.api.DOMMountPointService; import org.opendaylight.mdsal.dom.api.DOMNotification; import org.opendaylight.mdsal.dom.api.DOMNotificationService; import org.opendaylight.mdsal.dom.api.DOMSchemaService; -import org.opendaylight.restconf.nb.rfc8040.streams.RestconfStream.Sink; +import org.opendaylight.restconf.server.mdsal.streams.notif.AbstractNotificationSource; +import org.opendaylight.restconf.server.spi.RestconfStream; +import org.opendaylight.restconf.server.spi.RestconfStream.Sink; import org.opendaylight.yangtools.concepts.Registration; import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier; import org.opendaylight.yangtools.yang.model.api.stmt.NotificationEffectiveStatement; @@ -28,7 +30,7 @@ import org.slf4j.LoggerFactory; /** * A {@link RestconfStream} reporting YANG notifications coming from a mounted device. */ -public final class DeviceNotificationSource extends AbstractNotificationSource implements DOMMountPointListener { +final class DeviceNotificationSource extends AbstractNotificationSource implements DOMMountPointListener { private static final Logger LOG = LoggerFactory.getLogger(DeviceNotificationSource.class); private final AtomicReference onRemoved = new AtomicReference<>(); @@ -85,8 +87,8 @@ public final class DeviceNotificationSource extends AbstractNotificationSource i return endOfStream(sink); } - final var notifReg = optNotification.orElseThrow().registerNotificationListener( - new Listener(sink, () -> modelContext), paths); + final var notifReg = optNotification.orElseThrow() + .registerNotificationListener(new Listener(sink, () -> modelContext), paths); // Notifications are running now. // If we get removed we need to close those. But since we are running lockless and we need to set up