X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=netconf%2Fnetconf-netty-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fnettyutil%2Fhandler%2Fssh%2Fsshd1028%2FNetconfNio2Connector.java;fp=netconf%2Fnetconf-netty-util%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fnetconf%2Fnettyutil%2Fhandler%2Fssh%2Fsshd1028%2FNetconfNio2Connector.java;h=c565ac230bf936562a0cf2dd2d1b675e6e921a62;hb=4e9c87babd30222032fb0ba3ea9eb999141a8fa3;hp=0000000000000000000000000000000000000000;hpb=afbc1e06f36172f790654d834ef55ac216bbfb40;p=netconf.git diff --git a/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/sshd1028/NetconfNio2Connector.java b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/sshd1028/NetconfNio2Connector.java new file mode 100644 index 0000000000..c565ac230b --- /dev/null +++ b/netconf/netconf-netty-util/src/main/java/org/opendaylight/netconf/nettyutil/handler/ssh/sshd1028/NetconfNio2Connector.java @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2020 PANTHEON.tech, s.r.o. 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.nettyutil.handler.ssh.sshd1028; + +import java.nio.channels.AsynchronousChannelGroup; +import java.nio.channels.AsynchronousSocketChannel; +import org.opendaylight.netconf.shaded.sshd.common.FactoryManager; +import org.opendaylight.netconf.shaded.sshd.common.io.IoHandler; +import org.opendaylight.netconf.shaded.sshd.common.io.nio2.Nio2Connector; +import org.opendaylight.netconf.shaded.sshd.common.io.nio2.Nio2Session; + +/** + * Custom Nio2Connector which uses NetconfNio2Session instead of Nio2Session. + * Should be removed when SSHD-1028 is fixed. + */ +public class NetconfNio2Connector extends Nio2Connector { + + public NetconfNio2Connector(final FactoryManager manager, final IoHandler handler, + final AsynchronousChannelGroup group) { + super(manager, handler, group); + } + + @Override + protected Nio2Session createSession(final FactoryManager manager, final IoHandler handler, + final AsynchronousSocketChannel socket) throws Throwable { + return new NetconfNio2Session(this, manager, handler, socket, null); + } +}