import com.google.common.util.concurrent.ListenableFuture;
import org.opendaylight.netconf.server.api.NetconfServerFactory;
-import org.opendaylight.netconf.transport.api.TransportChannelListener;
import org.opendaylight.netconf.transport.api.UnsupportedConfigurationException;
import org.opendaylight.netconf.transport.ssh.SSHServer;
import org.opendaylight.netconf.transport.ssh.SSHTransportStackFactory;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.tcp.server.rev230417.TcpServerGrouping;
public final class NetconfServerFactoryImpl implements NetconfServerFactory {
- private static final TransportChannelListener EMPTY_LISTENER = new BaseTransportChannelListener();
-
private final SSHTransportStackFactory factory;
private final ServerChannelInitializer channelInitializer;
@Override
public ListenableFuture<TCPServer> createTcpServer(final TcpServerGrouping params)
throws UnsupportedConfigurationException {
- return TCPServer.listen(new BaseServerTransport(channelInitializer), factory.newServerBootstrap(), params);
+ return TCPServer.listen(new ServerTransportInitializer(channelInitializer), factory.newServerBootstrap(),
+ params);
}
@Override
public ListenableFuture<SSHServer> createSshServer(final TcpServerGrouping tcpParams,
final SshServerGrouping sshParams, final ServerFactoryManagerConfigurator configurator)
throws UnsupportedConfigurationException {
- return factory.listenServer(EMPTY_LISTENER, new NetconfSubsystemFactory(channelInitializer), tcpParams,
- sshParams, configurator);
+ return factory.listenServer("netconf", new ServerTransportInitializer(channelInitializer), tcpParams, sshParams,
+ configurator);
}
}