2 * Copyright (c) 2014 Cisco Systems, Inc. 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
9 package org.opendaylight.netconf.ssh;
11 import io.netty.channel.local.LocalAddress;
12 import java.net.InetSocketAddress;
13 import org.apache.sshd.common.KeyPairProvider;
14 import org.apache.sshd.server.PublickeyAuthenticator;
15 import org.opendaylight.netconf.auth.AuthProvider;
17 public final class SshProxyServerConfigurationBuilder {
18 private InetSocketAddress bindingAddress;
19 private LocalAddress localAddress;
20 private AuthProvider authenticator;
21 private KeyPairProvider keyPairProvider;
22 private int idleTimeout;
23 private PublickeyAuthenticator publicKeyAuthenticator = null;
25 public SshProxyServerConfigurationBuilder setBindingAddress(final InetSocketAddress bindingAddress) {
26 this.bindingAddress = bindingAddress;
30 public SshProxyServerConfigurationBuilder setLocalAddress(final LocalAddress localAddress) {
31 this.localAddress = localAddress;
35 public SshProxyServerConfigurationBuilder setAuthenticator(final AuthProvider authenticator) {
36 this.authenticator = authenticator;
40 public SshProxyServerConfigurationBuilder setPublickeyAuthenticator(final PublickeyAuthenticator authenticator) {
41 this.publicKeyAuthenticator = authenticator;
45 public SshProxyServerConfigurationBuilder setKeyPairProvider(final KeyPairProvider keyPairProvider) {
46 this.keyPairProvider = keyPairProvider;
50 public SshProxyServerConfigurationBuilder setIdleTimeout(final int idleTimeout) {
51 this.idleTimeout = idleTimeout;
55 public SshProxyServerConfiguration createSshProxyServerConfiguration() {
56 return new SshProxyServerConfiguration(bindingAddress, localAddress, authenticator, publicKeyAuthenticator,
57 keyPairProvider, idleTimeout);
60 public static SshProxyServerConfigurationBuilder create() {
61 return new SshProxyServerConfigurationBuilder();