*/
package org.opendaylight.netconf.transport.ssh;
+import static java.util.Objects.requireNonNull;
+
import com.google.common.collect.ImmutableList;
import com.google.errorprone.annotations.DoNotCall;
+import io.netty.channel.EventLoopGroup;
import java.security.cert.Certificate;
import org.opendaylight.netconf.shaded.sshd.client.ClientBuilder;
import org.opendaylight.netconf.shaded.sshd.client.SshClient;
import org.opendaylight.netconf.shaded.sshd.client.auth.pubkey.UserAuthPublicKeyFactory;
import org.opendaylight.netconf.shaded.sshd.client.keyverifier.ServerKeyVerifier;
import org.opendaylight.netconf.shaded.sshd.common.keyprovider.KeyIdentityProvider;
+import org.opendaylight.netconf.shaded.sshd.netty.NettyIoServiceFactoryFactory;
import org.opendaylight.netconf.transport.api.UnsupportedConfigurationException;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.crypto.types.rev230417.password.grouping.password.type.CleartextPassword;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ssh.client.rev230417.ssh.client.grouping.ClientIdentity;
* {@code ietf-netconf-client.yang} configuration.
*/
static final class Builder extends ClientBuilder {
+ private final NettyIoServiceFactoryFactory ioServiceFactory;
+ private final EventLoopGroup group;
+
private Keepalives keepAlives;
private ClientIdentity clientIdentity;
+ Builder(final NettyIoServiceFactoryFactory ioServiceFactory, final EventLoopGroup group) {
+ this.ioServiceFactory = requireNonNull(ioServiceFactory);
+ this.group = requireNonNull(group);
+ }
+
Builder transportParams(final TransportParamsGrouping params) throws UnsupportedConfigurationException {
ConfigUtils.setTransportParams(this, params, TransportUtils::getClientKexFactories);
return this;
if (clientIdentity != null && clientIdentity.getNone() == null) {
setClientIdentity(ret, clientIdentity);
}
-
- // FIXME: this is the default added by checkConfig(), but we really want to use an EventLoopGroup for this
- // ret.setScheduledExecutorService(group);
+ ret.setIoServiceFactoryFactory(ioServiceFactory);
+ ret.setScheduledExecutorService(group);
try {
ret.checkConfig();