mirror of
https://github.com/hierynomus/sshj.git
synced 2025-12-06 15:20:54 +03:00
javadoc cleanup
This commit is contained in:
@@ -125,7 +125,7 @@ public class Future<V, T extends Throwable> {
|
||||
* Wait for {@code timeout} seconds for this future's value to be set.
|
||||
*
|
||||
* @param timeout the timeout in seconds
|
||||
* @param unit
|
||||
* @param unit time unit
|
||||
*
|
||||
* @return the value
|
||||
*
|
||||
@@ -157,7 +157,7 @@ public class Future<V, T extends Throwable> {
|
||||
}
|
||||
}
|
||||
|
||||
/** @return Whether this future has a value set, and no error waiting to pop. */
|
||||
/** @return whether this future has a value set, and no error waiting to pop. */
|
||||
public boolean isSet() {
|
||||
lock();
|
||||
try {
|
||||
@@ -167,7 +167,7 @@ public class Future<V, T extends Throwable> {
|
||||
}
|
||||
}
|
||||
|
||||
/** @return Whether this future currently has an error set. */
|
||||
/** @return whether this future currently has an error set. */
|
||||
public boolean hasError() {
|
||||
lock();
|
||||
try {
|
||||
@@ -177,7 +177,7 @@ public class Future<V, T extends Throwable> {
|
||||
}
|
||||
}
|
||||
|
||||
/** @return Whether this future has threads waiting on it. */
|
||||
/** @return whether this future has threads waiting on it. */
|
||||
public boolean hasWaiters() {
|
||||
lock();
|
||||
try {
|
||||
|
||||
@@ -154,7 +154,7 @@ public class SSHClient
|
||||
/**
|
||||
* Constructor that allows specifying a {@code config} to be used.
|
||||
*
|
||||
* @param config {@link ConfigImpl} instance
|
||||
* @param config {@link Config} instance
|
||||
*/
|
||||
public SSHClient(Config config) {
|
||||
super(DEFAULT_PORT);
|
||||
@@ -367,7 +367,7 @@ public class SSHClient
|
||||
assert !isConnected();
|
||||
}
|
||||
|
||||
/** @return associated {@link Connection} instance. */
|
||||
/** @return the associated {@link Connection} instance. */
|
||||
public Connection getConnection() {
|
||||
return conn;
|
||||
}
|
||||
@@ -575,14 +575,14 @@ public class SSHClient
|
||||
return x11f;
|
||||
}
|
||||
|
||||
/** @return instantiated {@link SCPFileTransfer} implementation. */
|
||||
/** @return Instantiated {@link SCPFileTransfer} implementation. */
|
||||
public SCPFileTransfer newSCPFileTransfer() {
|
||||
assert isConnected() && isAuthenticated();
|
||||
return new SCPFileTransfer(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return instantiated {@link SFTPClient} implementation.
|
||||
* @return Instantiated {@link SFTPClient} implementation.
|
||||
*
|
||||
* @throws IOException if there is an error starting the {@code sftp} subsystem
|
||||
* @see StatefulSFTPClient
|
||||
|
||||
@@ -20,11 +20,11 @@ import net.schmizz.sshj.common.SSHException;
|
||||
import net.schmizz.sshj.common.SSHPacketHandler;
|
||||
import net.schmizz.sshj.transport.TransportException;
|
||||
|
||||
/** Represents a service running on top of the SSH {@link net.schmizz.sshj.transport.Transport transport layer}. */
|
||||
/** Represents a service running on top of the SSH transport layer. */
|
||||
public interface Service
|
||||
extends SSHPacketHandler, ErrorNotifiable {
|
||||
|
||||
/** @return The assigned name for this SSH service. */
|
||||
/** @return the assigned name for this SSH service. */
|
||||
String getName();
|
||||
|
||||
/**
|
||||
|
||||
@@ -27,17 +27,16 @@ import net.schmizz.sshj.transport.TransportException;
|
||||
public interface Connection {
|
||||
|
||||
/**
|
||||
* Attach a {@link net.schmizz.sshj.connection.channel.Channel} to this connection. A channel must be attached to
|
||||
* the connection if it is to receive any channel-specific data that is received.
|
||||
* Attach a {@link Channel} to this connection. A channel must be attached to the connection if it is to receive any
|
||||
* channel-specific data that is received.
|
||||
*
|
||||
* @param chan
|
||||
*/
|
||||
void attach(Channel chan);
|
||||
|
||||
/**
|
||||
* Attach a {@link net.schmizz.sshj.connection.channel.forwarded.ForwardedChannelOpener} to this connection, which
|
||||
* will be delegated opening of any {@code CHANNEL_OPEN} packets {@link net.schmizz.sshj.connection.channel.forwarded.ForwardedChannelOpener#getChannelType()
|
||||
* for which it is responsible}.
|
||||
* Attach a {@link ForwardedChannelOpener} to this connection, which will be delegated opening of any {@code
|
||||
* CHANNEL_OPEN} packets {@link ForwardedChannelOpener#getChannelType() for which it is responsible}.
|
||||
*
|
||||
* @param opener
|
||||
*/
|
||||
@@ -51,7 +50,7 @@ public interface Connection {
|
||||
void forget(Channel chan);
|
||||
|
||||
/**
|
||||
* Forget an attached {@link net.schmizz.sshj.connection.channel.forwarded.ForwardedChannelOpener}.
|
||||
* Forget an attached {@link ForwardedChannelOpener}.
|
||||
*
|
||||
* @param handler
|
||||
*/
|
||||
@@ -80,7 +79,7 @@ public interface Connection {
|
||||
*/
|
||||
ForwardedChannelOpener get(String chanType);
|
||||
|
||||
/** Returns an available ID a {@link net.schmizz.sshj.connection.channel.Channel} can rightfully claim. */
|
||||
/** Returns an available ID a {@link Channel} can rightfully claim. */
|
||||
int nextID();
|
||||
|
||||
/**
|
||||
@@ -88,10 +87,10 @@ public interface Connection {
|
||||
*
|
||||
* @param name request name
|
||||
* @param wantReply whether a reply is requested
|
||||
* @param specifics {@link net.schmizz.sshj.common.SSHPacket} containing fields specific to the request
|
||||
* @param specifics {@link SSHPacket} containing fields specific to the request
|
||||
*
|
||||
* @return a {@link net.schmizz.concurrent.Future} for the reply data (in case {@code wantReply} is true) which
|
||||
* allows waiting on the reply, or {@code null} if a reply is not requested.
|
||||
* @return a {@link Future} for the reply data (in case {@code wantReply} is true) which allows waiting on the
|
||||
* reply, or {@code null} if a reply is not requested.
|
||||
*
|
||||
* @throws TransportException if there is an error sending the request
|
||||
*/
|
||||
@@ -112,8 +111,8 @@ public interface Connection {
|
||||
throws TransportException;
|
||||
|
||||
/**
|
||||
* Get the maximum packet size for the local window this connection recommends to any {@link Channel}'s that ask for
|
||||
* it.
|
||||
* @return the maximum packet size for the local window this connection recommends to any {@link Channel}'s that ask
|
||||
* for it.
|
||||
*/
|
||||
int getMaxPacketSize();
|
||||
|
||||
@@ -123,28 +122,25 @@ public interface Connection {
|
||||
*/
|
||||
void setMaxPacketSize(int maxPacketSize);
|
||||
|
||||
/**
|
||||
* Get the size for the local window this connection recommends to any {@link net.schmizz.sshj.connection.channel.Channel}'s
|
||||
* that ask for it.
|
||||
*/
|
||||
/** Get the size for the local window this connection recommends to any {@link Channel}'s that ask for it. */
|
||||
int getWindowSize();
|
||||
|
||||
/** Set the size for the local window this connection recommends to any {@link Channel}'s that ask for it. */
|
||||
void setWindowSize(int windowSize);
|
||||
|
||||
/** Get the associated {@link Transport}. */
|
||||
/** @return the associated {@link Transport}. */
|
||||
Transport getTransport();
|
||||
|
||||
/**
|
||||
* Get the {@code timeout} this connection uses for blocking operations and recommends to any {@link Channel other}
|
||||
* {@link net.schmizz.sshj.connection.channel.forwarded.ForwardedChannelOpener classes} that ask for it.
|
||||
* @return the {@code timeout} this connection uses for blocking operations and recommends to any {@link Channel
|
||||
* other} {@link net.schmizz.sshj.connection.channel.forwarded.ForwardedChannelOpener classes} that ask for
|
||||
* it.
|
||||
*/
|
||||
int getTimeout();
|
||||
|
||||
/**
|
||||
* Set the {@code timeout} this connection uses for blocking operations and recommends to any {@link
|
||||
* net.schmizz.sshj.connection.channel.Channel other} {@link net.schmizz.sshj.connection.channel.forwarded.ForwardedChannelOpener
|
||||
* classes} that ask for it.
|
||||
* Set the {@code timeout} this connection uses for blocking operations and recommends to any {@link Channel other}
|
||||
* {@link ForwardedChannelOpener classes} that ask for it.
|
||||
*/
|
||||
void setTimeout(int timeout);
|
||||
}
|
||||
@@ -26,7 +26,7 @@ import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/** Base class for {@link net.schmizz.sshj.connection.channel.forwarded.ForwardedChannelOpener}'s. */
|
||||
/** Base class for {@link ForwardedChannelOpener}'s. */
|
||||
public abstract class AbstractForwardedChannelOpener
|
||||
implements ForwardedChannelOpener {
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public interface ConnectListener {
|
||||
* Channel.Forwarded#confirm() confirm} or {@link Channel.Forwarded#reject(net.schmizz.sshj.connection.channel.OpenFailException.Reason,
|
||||
* String)} reject} that channel.
|
||||
*
|
||||
* @param chan the {@link net.schmizz.sshj.connection.channel.Channel.Forwarded forwarded channel}
|
||||
* @param chan the {@link Channel.Forwarded forwarded channel}
|
||||
*
|
||||
* @throws IOException
|
||||
*/
|
||||
|
||||
@@ -28,8 +28,7 @@ public interface ForwardedChannelOpener {
|
||||
/**
|
||||
* Delegates a {@code SSH_MSG_CHANNEL_OPEN} request for the channel type claimed by this opener.
|
||||
*
|
||||
* @param buf {@link net.schmizz.sshj.common.SSHPacket} containg the request except for the message identifier and
|
||||
* channel type field
|
||||
* @param buf {@link SSHPacket} containg the request except for the message identifier and channel type field
|
||||
*/
|
||||
void handleOpen(SSHPacket buf)
|
||||
throws ConnectionException, TransportException;
|
||||
|
||||
@@ -26,10 +26,7 @@ import java.io.IOException;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketAddress;
|
||||
|
||||
/**
|
||||
* A {@link net.schmizz.sshj.connection.channel.forwarded.ConnectListener} that forwards what is received over the
|
||||
* channel to a socket and vice-versa.
|
||||
*/
|
||||
/** A {@link ConnectListener} that forwards what is received over the channel to a socket and vice-versa. */
|
||||
public class SocketForwardingConnectListener
|
||||
implements ConnectListener {
|
||||
|
||||
|
||||
@@ -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
|
||||
* net.schmizz.sshj.connection.channel.direct.Session}.
|
||||
* Session}.
|
||||
*/
|
||||
public class X11Forwarder
|
||||
extends AbstractForwardedChannelOpener {
|
||||
|
||||
@@ -177,8 +177,7 @@ final class Decoder
|
||||
|
||||
/**
|
||||
* Adds {@code len} bytes from {@code b} to the decoder buffer. When a packet has been successfully decoded, hooks
|
||||
* in to {@link net.schmizz.sshj.common.SSHPacketHandler#handle} of the {@link net.schmizz.sshj.common.SSHPacketHandler}
|
||||
* this decoder was initialized with.
|
||||
* in to {@link SSHPacketHandler#handle} of the {@link SSHPacketHandler} this decoder was initialized with.
|
||||
* <p/>
|
||||
* Returns the number of bytes expected in the next call in order to decode the packet length, and if the packet
|
||||
* length has already been decoded; to decode the payload. This number is accurate and should be taken to heart.
|
||||
|
||||
@@ -126,12 +126,12 @@ final class KeyExchanger
|
||||
return Arrays.copyOf(sessionID, sessionID.length);
|
||||
}
|
||||
|
||||
/** @return Whether key exchange has been completed */
|
||||
/** @return whether key exchange has been completed */
|
||||
boolean isKexDone() {
|
||||
return done.isSet();
|
||||
}
|
||||
|
||||
/** @return Whether key exchange is currently ongoing */
|
||||
/** @return whether key exchange is currently ongoing */
|
||||
boolean isKexOngoing() {
|
||||
return kexOngoing.get();
|
||||
}
|
||||
|
||||
@@ -67,15 +67,14 @@ public interface Transport
|
||||
/** @return the version string used by this client to identify itself to an SSH server, e.g. "SSHJ_3_0" */
|
||||
String getClientVersion();
|
||||
|
||||
/** @return the {@link net.schmizz.sshj.ConfigImpl} associated with this transport. */
|
||||
/** @return the {@link Config} associated with this transport. */
|
||||
Config getConfig();
|
||||
|
||||
/** @return the timeout that is currently set for blocking operations. */
|
||||
int getTimeout();
|
||||
|
||||
/**
|
||||
* Set a timeout for method that may block, e.g. {@link #reqService(net.schmizz.sshj.Service)}, {@link
|
||||
* KeyExchanger#waitForDone()}.
|
||||
* Set a timeout for methods that may block.
|
||||
*
|
||||
* @param timeout the timeout in seconds
|
||||
*/
|
||||
@@ -85,10 +84,10 @@ public interface Transport
|
||||
|
||||
void setHeartbeatInterval(int interval);
|
||||
|
||||
/** Returns the hostname to which this transport is connected. */
|
||||
/** @return the hostname to which this transport is connected. */
|
||||
String getRemoteHost();
|
||||
|
||||
/** Returns the port number on the {@link #getRemoteHost() remote host} to which this transport is connected. */
|
||||
/** @return the port number on the remote host to which this transport is connected. */
|
||||
int getRemotePort();
|
||||
|
||||
/**
|
||||
@@ -102,12 +101,12 @@ public interface Transport
|
||||
|
||||
byte[] getSessionID();
|
||||
|
||||
/** Returns the currently active {@link net.schmizz.sshj.Service} instance. */
|
||||
/** @return the currently active {@link Service} instance. */
|
||||
Service getService();
|
||||
|
||||
/**
|
||||
* Request a SSH service represented by a {@link net.schmizz.sshj.Service} instance. A separate call to {@link
|
||||
* #setService} is not needed.
|
||||
* Request a SSH service represented by a {@link Service} instance. A separate call to {@link #setService} is not
|
||||
* needed.
|
||||
*
|
||||
* @param service the SSH service to be requested
|
||||
*
|
||||
@@ -117,13 +116,13 @@ public interface Transport
|
||||
throws TransportException;
|
||||
|
||||
/**
|
||||
* Sets the currently active {@link net.schmizz.sshj.Service}. Handling of non-transport-layer packets is {@link
|
||||
* net.schmizz.sshj.Service#handle delegated} to that service.
|
||||
* Sets the currently active {@link Service}. Handling of non-transport-layer packets is {@link Service#handle
|
||||
* delegated} to that service.
|
||||
* <p/>
|
||||
* For this method to be successful, at least one service request via {@link #reqService} must have been successful
|
||||
* (not necessarily for the service being set).
|
||||
*
|
||||
* @param service (null-ok) the {@link net.schmizz.sshj.Service}
|
||||
* @param service (null-ok) the {@link Service}
|
||||
*/
|
||||
void setService(Service service);
|
||||
|
||||
@@ -165,10 +164,7 @@ public interface Transport
|
||||
/** Send a disconnection packet with reason as {@link DisconnectReason#BY_APPLICATION}, and closes this transport. */
|
||||
void disconnect();
|
||||
|
||||
/**
|
||||
* Send a disconnect packet with the given {@link net.schmizz.sshj.common.DisconnectReason reason}, and closes this
|
||||
* transport.
|
||||
*/
|
||||
/** Send a disconnect packet with the given {@link DisconnectReason reason}, and closes this transport. */
|
||||
void disconnect(DisconnectReason reason);
|
||||
|
||||
/**
|
||||
@@ -183,10 +179,10 @@ public interface Transport
|
||||
/**
|
||||
* Write a packet over this transport.
|
||||
* <p/>
|
||||
* The {@code payload} {@link net.schmizz.sshj.common.SSHPacket} should have 5 bytes free at the beginning to avoid
|
||||
* a performance penalty associated with making space for header bytes (packet length, padding length).
|
||||
* The {@code payload} {@link SSHPacket} should have 5 bytes free at the beginning to avoid a performance penalty
|
||||
* associated with making space for header bytes (packet length, padding length).
|
||||
*
|
||||
* @param payload the {@link net.schmizz.sshj.common.SSHPacket} containing data to send
|
||||
* @param payload the {@link SSHPacket} containing data to send
|
||||
*
|
||||
* @return sequence number of the sent packet
|
||||
*
|
||||
|
||||
@@ -26,7 +26,7 @@ public interface UserAuth {
|
||||
|
||||
/**
|
||||
* Attempt to authenticate {@code username} using each of {@code methods} in order. {@code nextService} is the
|
||||
* {@link net.schmizz.sshj.Service} that will be enabled on successful authentication.
|
||||
* {@link Service} that will be enabled on successful authentication.
|
||||
* <p/>
|
||||
* Authentication fails if there are no method available, i.e. if all the method failed or there were method
|
||||
* available but could not be attempted because the server did not allow them. In this case, a {@code
|
||||
@@ -53,14 +53,14 @@ public interface UserAuth {
|
||||
*/
|
||||
String getBanner();
|
||||
|
||||
/** @return Saved exceptions that might have been ignored because there were more authentication method available. */
|
||||
/** @return saved exceptions that might have been ignored because there were more authentication method available. */
|
||||
Deque<UserAuthException> getSavedExceptions();
|
||||
|
||||
/** @return The {@code timeout} for a method to successfully authenticate before it is abandoned. */
|
||||
/** @return the {@code timeout} for a method to successfully authenticate before it is abandoned. */
|
||||
int getTimeout();
|
||||
|
||||
/**
|
||||
* @return Whether authentication was partially successful. Some server's may be configured to require multiple
|
||||
* @return whether authentication was partially successful. Some server's may be configured to require multiple
|
||||
* authentications; and this value will be {@code true} if at least one of the method supplied succeeded.
|
||||
*/
|
||||
boolean hadPartialSuccess();
|
||||
|
||||
@@ -32,8 +32,8 @@ public interface AuthMethod
|
||||
String getName();
|
||||
|
||||
/**
|
||||
* Initializes this {@link AuthMethod} with the {@link net.schmizz.sshj.userauth.AuthParams parameters} needed for
|
||||
* authentication. This method must be called before requesting authentication with this method.
|
||||
* Initializes this {@link AuthMethod} with the {@link AuthParams parameters} needed for authentication. This method
|
||||
* must be called before requesting authentication with this method.
|
||||
*/
|
||||
void init(AuthParams params);
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public class PasswordUtils {
|
||||
/**
|
||||
* @param password the password as a char[]
|
||||
*
|
||||
* @return the constructed {@link net.schmizz.sshj.userauth.password.PasswordFinder}
|
||||
* @return the constructed {@link PasswordFinder}
|
||||
*/
|
||||
public static PasswordFinder createOneOff(final char[] password) {
|
||||
if (password == null)
|
||||
|
||||
@@ -27,7 +27,7 @@ import java.io.IOException;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/** Support for uploading files over a connected {@link net.schmizz.sshj.SSHClient} link using SCP. */
|
||||
/** Support for uploading files over a connected link using SCP. */
|
||||
public final class SCPDownloadClient
|
||||
extends SCPEngine {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user