Northbound Netconf servers moved to new transport implementation
[netconf.git] / apps / netconf-nb / src / main / java / org / opendaylight / netconf / northbound / ssh / SshProxyServerConfigurationBuilder.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.netconf.northbound.ssh;
9
10 import io.netty.channel.local.LocalAddress;
11 import java.net.InetSocketAddress;
12 import org.opendaylight.netconf.auth.AuthProvider;
13 import org.opendaylight.netconf.shaded.sshd.common.keyprovider.KeyPairProvider;
14 import org.opendaylight.netconf.shaded.sshd.server.auth.pubkey.PublickeyAuthenticator;
15
16 @Deprecated(since = "7.0.0", forRemoval = true)
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;
24
25     public SshProxyServerConfigurationBuilder setBindingAddress(final InetSocketAddress bindingAddress) {
26         this.bindingAddress = bindingAddress;
27         return this;
28     }
29
30     public SshProxyServerConfigurationBuilder setLocalAddress(final LocalAddress localAddress) {
31         this.localAddress = localAddress;
32         return this;
33     }
34
35     public SshProxyServerConfigurationBuilder setAuthenticator(final AuthProvider authenticator) {
36         this.authenticator = authenticator;
37         return this;
38     }
39
40     public SshProxyServerConfigurationBuilder setPublickeyAuthenticator(
41             final PublickeyAuthenticator publickeyAuthenticator) {
42         this.publickeyAuthenticator = publickeyAuthenticator;
43         return this;
44     }
45
46     public SshProxyServerConfigurationBuilder setKeyPairProvider(final KeyPairProvider keyPairProvider) {
47         this.keyPairProvider = keyPairProvider;
48         return this;
49     }
50
51     public SshProxyServerConfigurationBuilder setIdleTimeout(final int idleTimeout) {
52         this.idleTimeout = idleTimeout;
53         return this;
54     }
55
56     public SshProxyServerConfiguration createSshProxyServerConfiguration() {
57         return new SshProxyServerConfiguration(bindingAddress, localAddress, authenticator, publickeyAuthenticator,
58                 keyPairProvider, idleTimeout);
59     }
60
61     public static SshProxyServerConfigurationBuilder create() {
62         return new SshProxyServerConfigurationBuilder();
63     }
64 }