Eliminate AsyncSshHandlerReader in call home
[netconf.git] / netconf / netconf-netty-util / src / main / java / org / opendaylight / netconf / nettyutil / handler / ssh / client / NetconfClientSessionImpl.java
index 411a62889d82306fde2098331a53777c3c2803e7..67f2233a6eabc70dbc2834866b031d6488791a7e 100644 (file)
@@ -9,6 +9,7 @@ package org.opendaylight.netconf.nettyutil.handler.ssh.client;
 
 import com.google.common.annotations.Beta;
 import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.ChannelPipeline;
 import java.io.IOException;
 import org.opendaylight.netconf.shaded.sshd.client.ClientFactoryManager;
 import org.opendaylight.netconf.shaded.sshd.client.session.ClientSessionImpl;
@@ -36,4 +37,16 @@ public class NetconfClientSessionImpl extends ClientSessionImpl implements Netty
         }
         return channel;
     }
+
+    @Override
+    public NettyPipelineAwareChannelSubsystem createSubsystemChannel(final String subsystem,
+            final ChannelPipeline pipeline) throws IOException {
+        final NettyPipelineAwareChannelSubsystem channel = new NettyPipelineAwareChannelSubsystem(subsystem, pipeline);
+        final ConnectionService service = getConnectionService();
+        final long id = service.registerChannel(channel);
+        if (log.isDebugEnabled()) {
+            log.debug("createSubsystemChannel({})[{}] created id={}", this, channel.getSubsystem(), id);
+        }
+        return channel;
+    }
 }