Remove NetconfServerSessionPreferences 46/101446/4
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 2 Jun 2022 19:22:31 +0000 (21:22 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 2 Jun 2022 19:54:30 +0000 (21:54 +0200)
This class is a pure DTO used only internally in netconf-impl. Remove it
and adjust users accordingly.

JIRA: NETCONF-590
Change-Id: I1f99fbea705ce4a6128413ff7f68d782744bd68a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/NetconfServerSessionPreferences.java [deleted file]
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSessionNegotiator.java
netconf/netconf-impl/src/main/java/org/opendaylight/netconf/impl/NetconfServerSessionNegotiatorFactory.java

diff --git a/netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/NetconfServerSessionPreferences.java b/netconf/netconf-api/src/main/java/org/opendaylight/netconf/api/NetconfServerSessionPreferences.java
deleted file mode 100644 (file)
index 72f9813..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Copyright (c) 2013 Cisco Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * 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.netconf.api;
-
-import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
-
-/**
- * The only input for the start of a NETCONF session is hello-message.
- */
-public final class NetconfServerSessionPreferences extends NetconfSessionPreferences {
-
-    private final long sessionId;
-
-    public NetconfServerSessionPreferences(final NetconfHelloMessage helloMessage, long sessionId) {
-        super(helloMessage);
-        this.sessionId = sessionId;
-    }
-
-    public long getSessionId() {
-        return sessionId;
-    }
-}
index 071c75f51c2d9954ab0094baa74be41961b40c3e..4af12fe78dad387b68207121602530bab13cc2bc 100644 (file)
@@ -16,7 +16,6 @@ import java.net.SocketAddress;
 import java.util.AbstractMap.SimpleImmutableEntry;
 import java.util.Map;
 import org.opendaylight.netconf.api.NetconfDocumentedException;
-import org.opendaylight.netconf.api.NetconfServerSessionPreferences;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessageAdditionalHeader;
 import org.opendaylight.netconf.nettyutil.AbstractNetconfSessionNegotiator;
@@ -30,11 +29,11 @@ public final class NetconfServerSessionNegotiator
 
     private final long sessionId;
 
-    protected NetconfServerSessionNegotiator(final NetconfServerSessionPreferences sessionPreferences,
+    protected NetconfServerSessionNegotiator(final NetconfHelloMessage hello, final long sessionId,
             final Promise<NetconfServerSession> promise, final Channel channel, final Timer timer,
             final NetconfServerSessionListener sessionListener, final long connectionTimeoutMillis) {
-        super(sessionPreferences.getHelloMessage(), promise, channel, timer, sessionListener, connectionTimeoutMillis);
-        sessionId = sessionPreferences.getSessionId();
+        super(hello, promise, channel, timer, sessionListener, connectionTimeoutMillis);
+        this.sessionId = sessionId;
     }
 
     @Override
index 0aefb841eb40c00b63f65a7cf384debc2735b305..38df10178b641fb0991ed93833fbdedf728f9263 100644 (file)
@@ -16,7 +16,6 @@ import io.netty.util.Timer;
 import io.netty.util.concurrent.Promise;
 import java.net.SocketAddress;
 import java.util.Set;
-import org.opendaylight.netconf.api.NetconfServerSessionPreferences;
 import org.opendaylight.netconf.api.NetconfSessionListenerFactory;
 import org.opendaylight.netconf.api.messages.NetconfHelloMessage;
 import org.opendaylight.netconf.api.monitoring.NetconfMonitoringService;
@@ -60,7 +59,7 @@ public class NetconfServerSessionNegotiatorFactory
                                                  final NetconfMonitoringService monitoringService,
                                                  final Set<String> baseCapabilities) {
         this.timer = timer;
-        this.aggregatedOpService = netconfOperationProvider;
+        aggregatedOpService = netconfOperationProvider;
         this.idProvider = idProvider;
         this.connectionTimeoutMillis = connectionTimeoutMillis;
         this.monitoringService = monitoringService;
@@ -99,11 +98,9 @@ public class NetconfServerSessionNegotiatorFactory
             final Channel channel, final Promise<NetconfServerSession> promise) {
         final long sessionId = idProvider.getNextSessionId();
 
-        NetconfServerSessionPreferences proposal =
-            new NetconfServerSessionPreferences(createHelloMessage(sessionId, monitoringService), sessionId);
-
-        return new NetconfServerSessionNegotiator(proposal, promise, channel, timer,
-                getListener(Long.toString(sessionId), channel.parent().localAddress()), connectionTimeoutMillis);
+        return new NetconfServerSessionNegotiator(createHelloMessage(sessionId, monitoringService), sessionId, promise,
+            channel, timer, getListener(Long.toString(sessionId), channel.parent().localAddress()),
+            connectionTimeoutMillis);
     }
 
     private NetconfServerSessionListener getListener(final String netconfSessionIdForReporting,
@@ -117,7 +114,7 @@ public class NetconfServerSessionNegotiatorFactory
 
     protected NetconfOperationService getOperationServiceForAddress(final String netconfSessionIdForReporting,
                                                                     final SocketAddress socketAddress) {
-        return this.aggregatedOpService.createService(netconfSessionIdForReporting);
+        return aggregatedOpService.createService(netconfSessionIdForReporting);
     }
 
     protected final NetconfOperationServiceFactory getOperationServiceFactory() {