Merge "Modified APIs, user creation will use POST operation to post to 'users' collec...
[controller.git] / opendaylight / netconf / netconf-client / src / main / java / org / opendaylight / controller / netconf / client / NetconfClientDispatcher.java
index 4df8235441b582f5650edfa6dbd4aca346daf2c2..6fc4da026f38acc3add7538f3c172e2c6ee01a0f 100644 (file)
@@ -10,6 +10,7 @@ package org.opendaylight.controller.netconf.client;
 
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
+import io.netty.channel.EventLoopGroup;
 import io.netty.channel.socket.SocketChannel;
 import io.netty.util.HashedWheelTimer;
 import io.netty.util.concurrent.Future;
@@ -17,7 +18,7 @@ import io.netty.util.concurrent.Promise;
 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.AbstractSslChannelInitializer;
 import org.opendaylight.protocol.framework.AbstractDispatcher;
 import org.opendaylight.protocol.framework.ReconnectStrategy;
 import org.opendaylight.protocol.framework.SessionListener;
@@ -32,7 +33,8 @@ public class NetconfClientDispatcher extends AbstractDispatcher<NetconfClientSes
     private final Optional<SSLContext> maybeContext;
     private final NetconfClientSessionNegotiatorFactory negotatorFactory;
 
-    public NetconfClientDispatcher(final Optional<SSLContext> maybeContext) {
+    public NetconfClientDispatcher(final Optional<SSLContext> maybeContext, EventLoopGroup bossGroup, EventLoopGroup workerGroup) {
+        super(bossGroup, workerGroup);
         this.maybeContext = Preconditions.checkNotNull(maybeContext);
         this.negotatorFactory = new NetconfClientSessionNegotiatorFactory(new HashedWheelTimer());
     }
@@ -48,18 +50,18 @@ public class NetconfClientDispatcher extends AbstractDispatcher<NetconfClientSes
             }
 
             private void initialize(SocketChannel ch, Promise<NetconfClientSession> promise) {
-                new ClientChannelInitializer(maybeContext, negotatorFactory, sessionListener).initialize(ch, promise);
+                new ClientSslChannelInitializer(maybeContext, negotatorFactory, sessionListener).initialize(ch, promise);
             }
         });
     }
 
-    private static class ClientChannelInitializer extends AbstractChannelInitializer {
+    private static class ClientSslChannelInitializer extends AbstractSslChannelInitializer {
 
         private final NetconfClientSessionNegotiatorFactory negotiatorFactory;
         private final NetconfClientSessionListener sessionListener;
 
-        private ClientChannelInitializer(Optional<SSLContext> maybeContext,
-                NetconfClientSessionNegotiatorFactory negotiatorFactory, NetconfClientSessionListener sessionListener) {
+        private ClientSslChannelInitializer(Optional<SSLContext> maybeContext,
+                                            NetconfClientSessionNegotiatorFactory negotiatorFactory, NetconfClientSessionListener sessionListener) {
             super(maybeContext);
             this.negotiatorFactory = negotiatorFactory;
             this.sessionListener = sessionListener;