X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fnetconf%2Fnetconf-client%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fnetconf%2Fclient%2FSshClientChannelInitializer.java;h=7a14c4f4ac3507e953e4cdf595cc6575b38cd86e;hb=0c95d90e91f5a6a07d744b97dcc226c70a22c366;hp=b86349ddea777fcea7f6533575dc259539d26fbe;hpb=31b7a44c89d1057489338492fcf62a64147bea24;p=controller.git diff --git a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/SshClientChannelInitializer.java b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/SshClientChannelInitializer.java index b86349ddea..7a14c4f4ac 100644 --- a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/SshClientChannelInitializer.java +++ b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/SshClientChannelInitializer.java @@ -7,15 +7,13 @@ */ package org.opendaylight.controller.netconf.client; -import io.netty.channel.socket.SocketChannel; +import io.netty.channel.Channel; import io.netty.util.concurrent.Promise; -import org.opendaylight.controller.netconf.util.AbstractChannelInitializer; -import org.opendaylight.controller.netconf.util.handler.ssh.SshHandler; -import org.opendaylight.controller.netconf.util.handler.ssh.authentication.AuthenticationHandler; -import org.opendaylight.controller.netconf.util.handler.ssh.client.Invoker; -import org.opendaylight.protocol.framework.SessionListenerFactory; - import java.io.IOException; +import org.opendaylight.controller.netconf.nettyutil.AbstractChannelInitializer; +import org.opendaylight.controller.netconf.nettyutil.handler.ssh.authentication.AuthenticationHandler; +import org.opendaylight.controller.netconf.nettyutil.handler.ssh.client.AsyncSshHandler; +import org.opendaylight.protocol.framework.SessionListenerFactory; final class SshClientChannelInitializer extends AbstractChannelInitializer { @@ -32,10 +30,10 @@ final class SshClientChannelInitializer extends AbstractChannelInitializer promise) { + public void initialize(final Channel ch, final Promise promise) { try { - final Invoker invoker = Invoker.subsystem("netconf"); - ch.pipeline().addFirst(new SshHandler(authenticationHandler, invoker)); + // ssh handler has to be the first handler in pipeline + ch.pipeline().addFirst(AsyncSshHandler.createForNetconfSubsystem(authenticationHandler)); super.initialize(ch,promise); } catch (final IOException e) { throw new RuntimeException(e); @@ -43,7 +41,7 @@ final class SshClientChannelInitializer extends AbstractChannelInitializer promise) { ch.pipeline().addAfter(NETCONF_MESSAGE_DECODER, AbstractChannelInitializer.NETCONF_SESSION_NEGOTIATOR, negotiatorFactory.getSessionNegotiator(new SessionListenerFactory() {