From b903f55ad6d9742dc40af607e5b45cd816512942 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Wed, 20 Sep 2023 12:50:23 +0200 Subject: [PATCH] Clean up onUnderlayChannelEstablished Drop unneeded annotation and clean up method implementation. JIRA: NETCONF-590 Change-Id: Ib0cd36c0a41b32e380dd0e1484d0fec58895020f Signed-off-by: Robert Varga --- .../netconf/transport/ssh/SSHTransportStack.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/transport/transport-ssh/src/main/java/org/opendaylight/netconf/transport/ssh/SSHTransportStack.java b/transport/transport-ssh/src/main/java/org/opendaylight/netconf/transport/ssh/SSHTransportStack.java index 44a17cd203..6b5faf7733 100644 --- a/transport/transport-ssh/src/main/java/org/opendaylight/netconf/transport/ssh/SSHTransportStack.java +++ b/transport/transport-ssh/src/main/java/org/opendaylight/netconf/transport/ssh/SSHTransportStack.java @@ -10,7 +10,6 @@ package org.opendaylight.netconf.transport.ssh; import java.util.Collection; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; -import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.netconf.shaded.sshd.common.io.IoHandler; import org.opendaylight.netconf.shaded.sshd.common.session.Session; import org.opendaylight.netconf.shaded.sshd.netty.NettyIoService; @@ -24,7 +23,6 @@ import org.opendaylight.netconf.transport.api.TransportStack; */ public abstract sealed class SSHTransportStack extends AbstractOverlayTransportStack permits SSHClient, SSHServer { - protected final Map sessionAuthHandlers = new ConcurrentHashMap<>(); protected final Map sessions = new ConcurrentHashMap<>(); protected NettyIoService ioService; @@ -34,14 +32,16 @@ public abstract sealed class SSHTransportStack extends AbstractOverlayTransportS } @Override - protected void onUnderlayChannelEstablished(@NonNull TransportChannel underlayChannel) { - var channel = underlayChannel.channel(); - final SshIoSession ioSession = new SshIoSession(ioService, getSessionFactory(), channel.localAddress()); + protected void onUnderlayChannelEstablished(final TransportChannel underlayChannel) { + final var channel = underlayChannel.channel(); + final var ioSession = new SshIoSession(ioService, getSessionFactory(), channel.localAddress()); channel.pipeline().addLast(ioSession.getHandler()); // authentication triggering and handlers processing is performed by UserAuthSessionListener sessionAuthHandlers.put(ioSession.getId(), new UserAuthSessionListener.AuthHandler( - () -> addTransportChannel(new SSHTransportChannel(underlayChannel)), // auth success - () -> channel.close()) // auth failure + // auth success + () -> addTransportChannel(new SSHTransportChannel(underlayChannel)), + // auth failure + () -> channel.close()) ); } -- 2.36.6