diff --git a/src/main/java/net/schmizz/sshj/common/Buffer.java b/src/main/java/net/schmizz/sshj/common/Buffer.java index 16559943..7e8922a5 100644 --- a/src/main/java/net/schmizz/sshj/common/Buffer.java +++ b/src/main/java/net/schmizz/sshj/common/Buffer.java @@ -89,7 +89,7 @@ public class Buffer> { protected int rpos; protected int wpos; - /** @see {@link #DEFAULT_SIZE} */ + /** @see #DEFAULT_SIZE */ public Buffer() { this(DEFAULT_SIZE); } diff --git a/src/main/java/net/schmizz/sshj/common/SecurityUtils.java b/src/main/java/net/schmizz/sshj/common/SecurityUtils.java index 8dc77ac0..5ab96653 100644 --- a/src/main/java/net/schmizz/sshj/common/SecurityUtils.java +++ b/src/main/java/net/schmizz/sshj/common/SecurityUtils.java @@ -201,7 +201,7 @@ public class SecurityUtils { * * @param algorithm MessageDigest algorithm name * - * @return + * @return new instance * * @throws NoSuchAlgorithmException * @throws NoSuchProviderException diff --git a/src/main/java/net/schmizz/sshj/connection/channel/Channel.java b/src/main/java/net/schmizz/sshj/connection/channel/Channel.java index 4a8b0d90..6ed4508e 100644 --- a/src/main/java/net/schmizz/sshj/connection/channel/Channel.java +++ b/src/main/java/net/schmizz/sshj/connection/channel/Channel.java @@ -56,10 +56,10 @@ public interface Channel void confirm() throws TransportException; - /** Returns the IP of where the forwarded connection originates. */ + /** @return the IP of where the forwarded connection originates. */ String getOriginatorIP(); - /** Returns port from which the forwarded connection originates. */ + /** @return port from which the forwarded connection originates. */ int getOriginatorPort(); /** @@ -81,13 +81,13 @@ public interface Channel throws TransportException, ConnectionException; /** - * Returns whether auto-expansion of local window is set. + * @return whether auto-expansion of local window is set. * * @see #setAutoExpand(boolean) */ boolean getAutoExpand(); - /** Returns the channel ID */ + /** @return the channel ID */ int getID(); /** @return the {@code InputStream} for this channel. */ @@ -121,7 +121,7 @@ public interface Channel * Sends an EOF message to the server for this channel; indicating that no more data will be sent by us. The {@code * OutputStream} for this channel will be closed and no longer usable. * - * @throws TransportException + * @throws TransportException if there is an error sending the EOF message */ void sendEOF() throws TransportException; @@ -131,7 +131,7 @@ public interface Channel * read from that stream. This is useful e.g. when a remote command produces a lot of output that would fill the * local window but you are not interested in reading from its {@code InputStream}. * - * @param autoExpand + * @param autoExpand whether local windows should automatically expand */ void setAutoExpand(boolean autoExpand); diff --git a/src/main/java/net/schmizz/sshj/connection/channel/direct/SessionFactory.java b/src/main/java/net/schmizz/sshj/connection/channel/direct/SessionFactory.java index 737ff24a..8dcb6391 100644 --- a/src/main/java/net/schmizz/sshj/connection/channel/direct/SessionFactory.java +++ b/src/main/java/net/schmizz/sshj/connection/channel/direct/SessionFactory.java @@ -28,7 +28,7 @@ public interface SessionFactory { * @return the opened {@code session} channel * * @throws SSHException - * @see {@link Session} + * @see Session */ Session startSession() throws SSHException; diff --git a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/ConnectListener.java b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/ConnectListener.java index 7d047ff8..b04fac4a 100644 --- a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/ConnectListener.java +++ b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/ConnectListener.java @@ -23,13 +23,12 @@ import java.io.IOException; public interface ConnectListener { /** - * Notify this listener of a new forwarded channel. An implementation should firstly {@link - * Channel.Forwarded#confirm() confirm} or {@link Channel.Forwarded#reject(net.schmizz.sshj.connection.channel.OpenFailException.Reason, - * String)} reject} that channel. + * Notify this listener of a new forwarded channel. An implementation should firstly confirm or reject that + * channel. * - * @param chan the {@link Channel.Forwarded forwarded channel} + * @param chan the forwarded channel * - * @throws IOException + * @throws IOException if there is a problem handling the channel */ void gotConnect(Channel.Forwarded chan) throws IOException; diff --git a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/X11Forwarder.java b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/X11Forwarder.java index 07f084bd..15005a81 100644 --- a/src/main/java/net/schmizz/sshj/connection/channel/forwarded/X11Forwarder.java +++ b/src/main/java/net/schmizz/sshj/connection/channel/forwarded/X11Forwarder.java @@ -22,7 +22,7 @@ import net.schmizz.sshj.transport.TransportException; /** * Handles forwarded {@code x11} channels. The actual request to forward X11 should be made from the specific {@link - * Session}. + * net.schmizz.sshj.connection.channel.direct.Session Session}. */ public class X11Forwarder extends AbstractForwardedChannelOpener { @@ -43,8 +43,6 @@ public class X11Forwarder private final ConnectListener listener; /** - * Creates and registers itself with {@code conn}. - * * @param conn connection layer * @param listener listener which will be delegated {@link X11Channel}'s to next */ diff --git a/src/main/java/net/schmizz/sshj/transport/TransportException.java b/src/main/java/net/schmizz/sshj/transport/TransportException.java index cb4a7063..d18dc5ef 100644 --- a/src/main/java/net/schmizz/sshj/transport/TransportException.java +++ b/src/main/java/net/schmizz/sshj/transport/TransportException.java @@ -12,26 +12,6 @@ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. - * - * This file may incorporate work covered by the following copyright and - * permission notice: - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. */ package net.schmizz.sshj.transport; @@ -43,7 +23,7 @@ import net.schmizz.sshj.common.SSHException; public class TransportException extends SSHException { - /** @see {@link net.schmizz.concurrent.ExceptionChainer} */ + /** @see ExceptionChainer */ public static final ExceptionChainer chainer = new ExceptionChainer() { public TransportException chain(Throwable t) { if (t instanceof TransportException) diff --git a/src/main/java/net/schmizz/sshj/transport/kex/KeyExchange.java b/src/main/java/net/schmizz/sshj/transport/kex/KeyExchange.java index e2f38803..16546683 100644 --- a/src/main/java/net/schmizz/sshj/transport/kex/KeyExchange.java +++ b/src/main/java/net/schmizz/sshj/transport/kex/KeyExchange.java @@ -46,11 +46,7 @@ import java.security.PublicKey; /** Key exchange algorithm. */ public interface KeyExchange { - /** - * Retrieves the computed H parameter - * - * @return - */ + /** @return the computed H parameter */ byte[] getH(); /** @@ -60,18 +56,22 @@ public interface KeyExchange { */ Digest getHash(); + /** @return the host key determined from server's response packets */ PublicKey getHostKey(); - /** Retrieves the computed K parameter */ + /** @return the computed K parameter */ byte[] getK(); /** * Initialize the key exchange algorithm. * - * @param V_S the server identification string - * @param V_C the client identification string - * @param I_S the server key init packet - * @param I_C the client key init packet + * @param trans the transport + * @param V_S the server identification string + * @param V_C the client identification string + * @param I_S the server key init packet + * @param I_C the client key init packet + * + * @throws TransportException if there is an error sending a packet */ void init(Transport trans, byte[] V_S, byte[] V_C, byte[] I_S, byte[] I_C) throws TransportException; @@ -79,9 +79,12 @@ public interface KeyExchange { /** * Process the next packet * + * @param msg message identifier * @param buffer the packet * * @return a boolean indicating if the processing is complete or if more packets are to be received + * + * @throws TransportException if there is an error sending a packet */ boolean next(Message msg, SSHPacket buffer) throws TransportException;