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%2FNetconfSshClientDispatcher.java;h=4de6cc35c0dad3f00afe949821a1dab59f4bc3da;hb=28ef055f38762a2f9679eb765fa44528b56791a8;hp=b19c09263b9fa481c76307da0bb2dbebc310bb85;hpb=dfedfab4f26c8a1c1d77b242c375d73260df57b7;p=controller.git diff --git a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfSshClientDispatcher.java b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfSshClientDispatcher.java index b19c09263b..4de6cc35c0 100644 --- a/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfSshClientDispatcher.java +++ b/opendaylight/netconf/netconf-client/src/main/java/org/opendaylight/controller/netconf/client/NetconfSshClientDispatcher.java @@ -8,21 +8,21 @@ package org.opendaylight.controller.netconf.client; +import io.netty.channel.ChannelHandler; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.socket.SocketChannel; +import io.netty.util.HashedWheelTimer; +import io.netty.util.concurrent.Future; +import io.netty.util.concurrent.Promise; import java.io.IOException; import java.net.InetSocketAddress; - -import javax.net.ssl.SSLContext; - import org.opendaylight.controller.netconf.api.NetconfMessage; import org.opendaylight.controller.netconf.api.NetconfSession; import org.opendaylight.controller.netconf.api.NetconfTerminationReason; import org.opendaylight.controller.netconf.util.AbstractChannelInitializer; -import org.opendaylight.controller.netconf.util.handler.FramingMechanismHandlerFactory; -import org.opendaylight.controller.netconf.util.handler.NetconfMessageAggregator; 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.controller.netconf.util.messages.FramingMechanism; import org.opendaylight.controller.netconf.util.messages.NetconfMessageFactory; import org.opendaylight.protocol.framework.ProtocolHandlerFactory; import org.opendaylight.protocol.framework.ProtocolMessageDecoder; @@ -31,15 +31,6 @@ import org.opendaylight.protocol.framework.ReconnectStrategy; import org.opendaylight.protocol.framework.SessionListener; import org.opendaylight.protocol.framework.SessionListenerFactory; -import com.google.common.base.Optional; - -import io.netty.channel.ChannelHandler; -import io.netty.channel.EventLoopGroup; -import io.netty.channel.socket.SocketChannel; -import io.netty.util.HashedWheelTimer; -import io.netty.util.concurrent.Future; -import io.netty.util.concurrent.Promise; - public class NetconfSshClientDispatcher extends NetconfClientDispatcher { private AuthenticationHandler authHandler; @@ -48,13 +39,12 @@ public class NetconfSshClientDispatcher extends NetconfClientDispatcher { public NetconfSshClientDispatcher(AuthenticationHandler authHandler, EventLoopGroup bossGroup, EventLoopGroup workerGroup) { - super(Optional. absent(), bossGroup, workerGroup); + super(bossGroup, workerGroup); this.authHandler = authHandler; this.timer = new HashedWheelTimer(); this.negotatorFactory = new NetconfClientSessionNegotiatorFactory(timer); } - @Override public Future createClient(InetSocketAddress address, final NetconfClientSessionListener sessionListener, ReconnectStrategy strat) { return super.createClient(address, strat, new PipelineInitializer() { @@ -88,12 +78,7 @@ public class NetconfSshClientDispatcher extends NetconfClientDispatcher { try { Invoker invoker = Invoker.subsystem("netconf"); ch.pipeline().addFirst(new SshHandler(authenticationHandler, invoker)); - ch.pipeline().addLast("aggregator", new NetconfMessageAggregator(FramingMechanism.EOM)); - ch.pipeline().addLast(handlerFactory.getDecoders()); - initializeAfterDecoder(ch, promise); - ch.pipeline().addLast("frameEncoder", - FramingMechanismHandlerFactory.createHandler(FramingMechanism.EOM)); - ch.pipeline().addLast(handlerFactory.getEncoders()); + super.initialize(ch,promise); } catch (IOException e) { throw new RuntimeException(e); }