Do not use ListenerRegistration in mdsal-dom-api
[mdsal.git] / replicate / mdsal-replicate-netty / src / main / java / org / opendaylight / mdsal / replicate / netty / SourceRequestHandler.java
index d2f8fd503d44faa99d1c7ee1a412c7c245f4c3a7..f0dfe0f6c5949fd1382719ea7f9fd82d1ac90fe2 100644 (file)
@@ -21,7 +21,7 @@ import org.opendaylight.mdsal.common.api.LogicalDatastoreType;
 import org.opendaylight.mdsal.dom.api.ClusteredDOMDataTreeChangeListener;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeChangeService;
 import org.opendaylight.mdsal.dom.api.DOMDataTreeIdentifier;
-import org.opendaylight.yangtools.concepts.ListenerRegistration;
+import org.opendaylight.yangtools.concepts.Registration;
 import org.opendaylight.yangtools.yang.data.codec.binfmt.NormalizedNodeDataInput;
 import org.opendaylight.yangtools.yang.data.tree.api.DataTreeCandidate;
 import org.slf4j.Logger;
@@ -35,7 +35,7 @@ final class SourceRequestHandler extends SimpleChannelInboundHandler<ByteBuf> {
 
     private final DOMDataTreeChangeService dtcs;
 
-    private ListenerRegistration<?> reg;
+    private Registration reg;
 
     SourceRequestHandler(final DOMDataTreeChangeService dtcs) {
         this.dtcs = requireNonNull(dtcs);
@@ -77,8 +77,8 @@ final class SourceRequestHandler extends SimpleChannelInboundHandler<ByteBuf> {
         verify(reg == null, "Unexpected subscription when already subscribed");
 
         final DOMDataTreeIdentifier dataTree;
-        try (ByteBufInputStream input = new ByteBufInputStream(msg)) {
-            final NormalizedNodeDataInput normalizedInput = NormalizedNodeDataInput.newDataInput(input);
+        try (var input = new ByteBufInputStream(msg)) {
+            final var normalizedInput = NormalizedNodeDataInput.newDataInput(input);
 
             dataTree = new DOMDataTreeIdentifier(LogicalDatastoreType.readFrom(normalizedInput),
                 normalizedInput.readYangInstanceIdentifier());