From 46ca5375d0d1e2117e8184208e42e6a2c0cdbcb3 Mon Sep 17 00:00:00 2001 From: Jeroen van Erp Date: Tue, 28 Sep 2021 21:56:52 +0200 Subject: [PATCH] Remove long deprecated code --- src/main/java/net/schmizz/sshj/SSHClient.java | 2 +- .../net/schmizz/sshj/transport/Transport.java | 16 ------- .../schmizz/sshj/transport/TransportImpl.java | 43 ------------------- 3 files changed, 1 insertion(+), 60 deletions(-) diff --git a/src/main/java/net/schmizz/sshj/SSHClient.java b/src/main/java/net/schmizz/sshj/SSHClient.java index 1fb3b995..6ecec30e 100644 --- a/src/main/java/net/schmizz/sshj/SSHClient.java +++ b/src/main/java/net/schmizz/sshj/SSHClient.java @@ -140,7 +140,7 @@ public class SSHClient super(DEFAULT_PORT); loggerFactory = config.getLoggerFactory(); log = loggerFactory.getLogger(getClass()); - this.trans = new TransportImpl(config, this); + this.trans = new TransportImpl(config); this.auth = new UserAuthImpl(trans); this.conn = new ConnectionImpl(trans, config.getKeepAliveProvider()); } diff --git a/src/main/java/net/schmizz/sshj/transport/Transport.java b/src/main/java/net/schmizz/sshj/transport/Transport.java index a04073af..608e369a 100644 --- a/src/main/java/net/schmizz/sshj/transport/Transport.java +++ b/src/main/java/net/schmizz/sshj/transport/Transport.java @@ -85,22 +85,6 @@ public interface Transport */ void setTimeoutMs(int timeout); - /** - * @return the interval in seconds at which a heartbeat message is sent to the server - * @deprecated Moved to {@link net.schmizz.keepalive.KeepAlive#getKeepAliveInterval()}. This is accessible through the {@link net.schmizz.sshj.connection.Connection}. - * Scheduled to be removed in 0.12.0 - */ - @Deprecated - int getHeartbeatInterval(); - - /** - * @param interval the interval in seconds, {@code 0} means no heartbeat - * @deprecated Moved to {@link net.schmizz.keepalive.KeepAlive#getKeepAliveInterval()}. This is accessible through the {@link net.schmizz.sshj.connection.Connection}. - * Scheduled to be removed in 0.12.0 - */ - @Deprecated - void setHeartbeatInterval(int interval); - /** @return the hostname to which this transport is connected. */ String getRemoteHost(); diff --git a/src/main/java/net/schmizz/sshj/transport/TransportImpl.java b/src/main/java/net/schmizz/sshj/transport/TransportImpl.java index 148feef2..57effbbd 100644 --- a/src/main/java/net/schmizz/sshj/transport/TransportImpl.java +++ b/src/main/java/net/schmizz/sshj/transport/TransportImpl.java @@ -80,12 +80,6 @@ public final class TransportImpl private final Reader reader; - /** - * @deprecated Moved to {@link net.schmizz.sshj.SSHClient} - */ - @Deprecated - private final SSHClient sshClient; - private final Encoder encoder; private final Decoder decoder; @@ -147,29 +141,6 @@ public final class TransportImpl this.decoder = new Decoder(this); this.kexer = new KeyExchanger(this); this.clientID = String.format("SSH-2.0-%s", config.getVersion()); - this.sshClient = null; - } - - /* - * Temporary constructor until we remove support for the set/get Heartbeat interval from transport. - * @deprecated To be removed in 0.12.0 - */ - @Deprecated - public TransportImpl(Config config, SSHClient sshClient) { - this.config = config; - this.loggerFactory = config.getLoggerFactory(); - this.serviceAccept = new Event("service accept", TransportException.chainer, loggerFactory); - this.close = new Event("transport close", TransportException.chainer, loggerFactory); - this.log = loggerFactory.getLogger(getClass()); - this.nullService = new NullService(this); - this.service = nullService; - this.disconnectListener = this; - this.reader = new Reader(this); - this.encoder = new Encoder(config.getRandomFactory().create(), writeLock, loggerFactory); - this.decoder = new Decoder(this); - this.kexer = new KeyExchanger(this); - this.clientID = String.format("SSH-2.0-%s", config.getVersion()); - this.sshClient = sshClient; } @Override @@ -286,20 +257,6 @@ public final class TransportImpl this.timeoutMs = timeoutMs; } - @Override - @Deprecated - public int getHeartbeatInterval() { - log.warn("**Deprecated**: Please use: sshClient.getConnection().getKeepAlive().getKeepAliveInterval()"); - return sshClient.getConnection().getKeepAlive().getKeepAliveInterval(); - } - - @Override - @Deprecated - public void setHeartbeatInterval(int interval) { - log.warn("**Deprecated**: Please use: sshClient.getConnection().getKeepAlive().setKeepAliveInterval()"); - sshClient.getConnection().getKeepAlive().setKeepAliveInterval(interval); - } - @Override public String getRemoteHost() { return connInfo.host;