2 * Copyright (c) 2019 PANTHEON.tech, s.r.o. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.netconf.nettyutil.handler.ssh.client;
10 import static com.google.common.base.Verify.verify;
12 import com.google.common.annotations.Beta;
13 import org.opendaylight.netconf.shaded.sshd.client.ClientBuilder;
14 import org.opendaylight.netconf.shaded.sshd.client.SshClient;
17 * A {@link ClientBuilder} which builds {@link NetconfSshClient} instances.
20 public class NetconfClientBuilder extends ClientBuilder {
22 public NetconfSshClient build() {
23 final SshClient client = super.build();
24 verify(client instanceof NetconfSshClient, "Unexpected client %s", client);
25 return (NetconfSshClient) client;
29 protected ClientBuilder fillWithDefaultValues() {
30 if (factory == null) {
31 factory = NetconfSshClient.DEFAULT_NETCONF_SSH_CLIENT_FACTORY;
33 return super.fillWithDefaultValues();