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 com.google.common.base.Preconditions;
12 import io.netty.channel.local.LocalAddress;
13 import java.net.InetSocketAddress;
14 import org.apache.sshd.common.KeyPairProvider;
15 import org.opendaylight.netconf.auth.AuthProvider;
17 public final class SshProxyServerConfiguration {
18 private final InetSocketAddress bindingAddress;
19 private final LocalAddress localAddress;
20 private final AuthProvider authenticator;
21 private final KeyPairProvider keyPairProvider;
22 private final int idleTimeout;
24 SshProxyServerConfiguration(final InetSocketAddress bindingAddress, final LocalAddress localAddress,
25 final AuthProvider authenticator, final KeyPairProvider keyPairProvider, final int idleTimeout) {
26 this.bindingAddress = Preconditions.checkNotNull(bindingAddress);
27 this.localAddress = Preconditions.checkNotNull(localAddress);
28 this.authenticator = Preconditions.checkNotNull(authenticator);
29 this.keyPairProvider = Preconditions.checkNotNull(keyPairProvider);
30 // Idle timeout cannot be disabled in the sshd by using =< 0 value
31 Preconditions.checkArgument(idleTimeout > 0, "Idle timeout has to be > 0");
32 this.idleTimeout = idleTimeout;
35 public InetSocketAddress getBindingAddress() {
36 return bindingAddress;
39 public LocalAddress getLocalAddress() {
43 public AuthProvider getAuthenticator() {
47 public KeyPairProvider getKeyPairProvider() {
48 return keyPairProvider;
51 public int getIdleTimeout() {