Author: gnodet
Date: Tue Mar 31 09:31:38 2009
New Revision: 760378
URL: http://svn.apache.org/viewvc?rev=760378&view=rev
Log:
Add some javadoc
Modified:
mina/sshd/trunk/src/main/java/org/apache/sshd/SshClient.java
mina/sshd/trunk/src/main/java/org/apache/sshd/client/SessionFactory.java
mina/sshd/trunk/src/main/java/org/apache/sshd/common/Compression.java
mina/sshd/trunk/src/main/java/org/apache/sshd/common/Digest.java
mina/sshd/trunk/src/main/java/org/apache/sshd/common/FactoryManager.java
mina/sshd/trunk/src/main/java/org/apache/sshd/common/Random.java
mina/sshd/trunk/src/main/java/org/apache/sshd/common/RuntimeSshException.java
mina/sshd/trunk/src/main/java/org/apache/sshd/common/SshConstants.java
mina/sshd/trunk/src/main/java/org/apache/sshd/server/PasswordAuthenticator.java
mina/sshd/trunk/src/main/java/org/apache/sshd/server/PublickeyAuthenticator.java
mina/sshd/trunk/src/main/java/org/apache/sshd/server/ServerFactoryManager.java
mina/sshd/trunk/src/main/java/org/apache/sshd/server/SessionFactory.java
mina/sshd/trunk/src/main/java/org/apache/sshd/server/ShellFactory.java
mina/sshd/trunk/src/main/java/org/apache/sshd/server/command/ScpCommand.java
mina/sshd/trunk/src/main/java/org/apache/sshd/server/command/ScpCommandFactory.java
Modified: mina/sshd/trunk/src/main/java/org/apache/sshd/SshClient.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/SshClient.java?rev=760378&r1=760377&r2=760378&view=diff
==============================================================================
--- mina/sshd/trunk/src/main/java/org/apache/sshd/SshClient.java (original)
+++ mina/sshd/trunk/src/main/java/org/apache/sshd/SshClient.java Tue Mar 31
09:31:38 2009
@@ -197,7 +197,7 @@
new AES192CBC.Factory(),
new AES256CBC.Factory()));
// Compression is not enabled by default
- //
sshd.setCompressionFactories(Arrays.<NamedFactory<Compression>>asList(
+ //
client.setCompressionFactories(Arrays.<NamedFactory<Compression>>asList(
// new CompressionNone.Factory(),
// new CompressionZlib.Factory(),
// new CompressionDelayedZlib.Factory()));
Modified:
mina/sshd/trunk/src/main/java/org/apache/sshd/client/SessionFactory.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/client/SessionFactory.java?rev=760378&r1=760377&r2=760378&view=diff
==============================================================================
--- mina/sshd/trunk/src/main/java/org/apache/sshd/client/SessionFactory.java
(original)
+++ mina/sshd/trunk/src/main/java/org/apache/sshd/client/SessionFactory.java
Tue Mar 31 09:31:38 2009
@@ -25,7 +25,10 @@
import org.apache.sshd.common.session.AbstractSession;
/**
- * A factory of sessions.
+ * A factory of client sessions.
+ * This class can be used as a way to customize the creation of client
sessions.
+ *
+ * @see SshClient#setSessionFactory(SessionFactory)
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
*/
Modified: mina/sshd/trunk/src/main/java/org/apache/sshd/common/Compression.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/common/Compression.java?rev=760378&r1=760377&r2=760378&view=diff
==============================================================================
--- mina/sshd/trunk/src/main/java/org/apache/sshd/common/Compression.java
(original)
+++ mina/sshd/trunk/src/main/java/org/apache/sshd/common/Compression.java Tue
Mar 31 09:31:38 2009
@@ -23,24 +23,60 @@
import org.apache.sshd.common.util.Buffer;
/**
- * TODO Add javadoc
+ * Interface used to compress the stream of data between the
+ * SSH server and clients.
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
* @version $Rev$, $Date$
*/
public interface Compression {
+ /**
+ * Enum identifying if this object will be used to compress
+ * or uncompress data.
+ */
enum Type {
Inflater,
Deflater
}
+ /**
+ * Delayed compression is an Open-SSH specific feature which
+ * informs both the client and server to not compress data before
+ * the session has been authenticated.
+ *
+ * @return if the compression is delayed after authentication or not
+ */
boolean isDelayed();
+ /**
+ * Initialize this object to either compress or uncompress data.
+ * This method must be called prior to any calls to either
+ * <code>compress</code> or <code>uncompress</code>.
+ * Once the object has been initialized, only one of
+ * <code>compress</code> or <code>uncompress</code> methods can be
+ * called.
+ *
+ * @param type
+ * @param level
+ */
void init(Type type, int level);
+ /**
+ * Compress the given buffer in place.
+ *
+ * @param buffer the buffer containing the data to compress
+ * @throws IOException if an error occurs
+ */
void compress(Buffer buffer) throws IOException;
+ /**
+ * Uncompress the data in a buffer into another buffer.
+ *
+ * @param from the buffer containing the data to uncompress
+ * @param to the buffer receiving the uncompressed data
+ * @throws IOException if an error occurs
+ */
void uncompress(Buffer from, Buffer to) throws IOException;
}
Modified: mina/sshd/trunk/src/main/java/org/apache/sshd/common/Digest.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/common/Digest.java?rev=760378&r1=760377&r2=760378&view=diff
==============================================================================
--- mina/sshd/trunk/src/main/java/org/apache/sshd/common/Digest.java (original)
+++ mina/sshd/trunk/src/main/java/org/apache/sshd/common/Digest.java Tue Mar 31
09:31:38 2009
@@ -19,7 +19,7 @@
package org.apache.sshd.common;
/**
- * TODO Add javadoc
+ * Interface used to compute digests, based on algorithms such as MD5 or SHA1.
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
* @version $Rev$, $Date$
Modified:
mina/sshd/trunk/src/main/java/org/apache/sshd/common/FactoryManager.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/common/FactoryManager.java?rev=760378&r1=760377&r2=760378&view=diff
==============================================================================
--- mina/sshd/trunk/src/main/java/org/apache/sshd/common/FactoryManager.java
(original)
+++ mina/sshd/trunk/src/main/java/org/apache/sshd/common/FactoryManager.java
Tue Mar 31 09:31:38 2009
@@ -22,34 +22,110 @@
import java.util.Map;
/**
- * TODO Add javadoc
+ * This interface allows retrieving all the <code>NamedFactory</code> used
+ * in the SSH protocol.
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
* @version $Rev$, $Date$
*/
public interface FactoryManager {
+ /**
+ * Key used to retrieve the value of the window size in the
+ * configuration properties map.
+ */
public static final String WINDOW_SIZE = "window-size";
+
+ /**
+ * Key used to retrieve the value of the maximum packet size
+ * in the configuration properties map.
+ */
public static final String MAX_PACKET_SIZE = "packet-size";
+
+ /**
+ * Key used to retrieve the value in the configuration properties map
+ * of the maximum number of failed authentication requests before the
+ * server closes the connection.
+ */
public static final String MAX_AUTH_REQUESTS = "max-auth-requests";
+
+ /**
+ * Key used to retrieve the value of the timeout after which
+ * the server will close the connection if the client has not been
+ * authenticated.
+ */
public static final String AUTH_TIMEOUT = "auth-timeout";
+ /**
+ * A map of properties that can be used to configure the SSH server
+ * or client. This map will never be changed by either the server or
+ * client and is not supposed to be changed at runtime (changes are not
+ * bound to have any effect on a running client or server), though it may
+ * affect the creation of sessions later as these values are usually not
+ * cached.
+ *
+ * @return a valid <code>Map</code> containing configuration values, never
<code>null</code>
+ */
Map<String,String> getProperties();
+ /**
+ * An upper case string identifying the version of the
+ * software used on client or server side.
+ * This version includes the name of the software and usually
+ * looks like: <code>SSHD-1.0</code>
+ *
+ * @return the version of the software
+ */
String getVersion();
+ /**
+ * Retrieve the list of named factories for <code>KeyExchange</code>.
+ *
+ * @return a list of named <code>KeyExchange</code> factories, never
<code>null</code>
+ */
List<NamedFactory<KeyExchange>> getKeyExchangeFactories();
+ /**
+ * Retrieve the list of named factories for <code>Cipher</code>.
+ *
+ * @return a list of named <code>Cipher</code> factories, never
<code>null</code>
+ */
List<NamedFactory<Cipher>> getCipherFactories();
+ /**
+ * Retrieve the list of named factories for <code>Compression</code>.
+ *
+ * @return a list of named <code>Compression</code> factories, never
<code>null</code>
+ */
List<NamedFactory<Compression>> getCompressionFactories();
+ /**
+ * Retrieve the list of named factories for <code>Mac</code>.
+ *
+ * @return a list of named <code>Mac</code> factories, never
<code>null</code>
+ */
List<NamedFactory<Mac>> getMacFactories();
+ /**
+ * Retrieve the list of named factories for <code>Signature</code>.
+ *
+ * @return a list of named <code>Signature</code> factories, never
<code>null</code>
+ */
List<NamedFactory<Signature>> getSignatureFactories();
+ /**
+ * Retrieve the <code>KeyPairProvider</code> that will be used to find
+ * the host key to use on the server side or the user key on the client
side.
+ *
+ * @return the <code>KeyPairProvider</code>, never <code>null</code>
+ */
KeyPairProvider getKeyPairProvider();
+ /**
+ * Retrieve the <code>Random</code> factory to be used.
+ *
+ * @return the <code>Random</code> factory, never <code>null</code>
+ */
NamedFactory<Random> getRandomFactory();
}
Modified: mina/sshd/trunk/src/main/java/org/apache/sshd/common/Random.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/common/Random.java?rev=760378&r1=760377&r2=760378&view=diff
==============================================================================
--- mina/sshd/trunk/src/main/java/org/apache/sshd/common/Random.java (original)
+++ mina/sshd/trunk/src/main/java/org/apache/sshd/common/Random.java Tue Mar 31
09:31:38 2009
@@ -19,7 +19,7 @@
package org.apache.sshd.common;
/**
- * A pseudo random number generator
+ * A pseudo random number generator.
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
* @version $Rev$, $Date$
Modified:
mina/sshd/trunk/src/main/java/org/apache/sshd/common/RuntimeSshException.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/common/RuntimeSshException.java?rev=760378&r1=760377&r2=760378&view=diff
==============================================================================
---
mina/sshd/trunk/src/main/java/org/apache/sshd/common/RuntimeSshException.java
(original)
+++
mina/sshd/trunk/src/main/java/org/apache/sshd/common/RuntimeSshException.java
Tue Mar 31 09:31:38 2009
@@ -19,7 +19,7 @@
package org.apache.sshd.common;
/**
- * TODO Add javadoc
+ * Exception used in the SSH client or server.
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
* @version $Rev$, $Date$
Modified: mina/sshd/trunk/src/main/java/org/apache/sshd/common/SshConstants.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/common/SshConstants.java?rev=760378&r1=760377&r2=760378&view=diff
==============================================================================
--- mina/sshd/trunk/src/main/java/org/apache/sshd/common/SshConstants.java
(original)
+++ mina/sshd/trunk/src/main/java/org/apache/sshd/common/SshConstants.java Tue
Mar 31 09:31:38 2009
@@ -19,13 +19,16 @@
package org.apache.sshd.common;
/**
- * TODO Add javadoc
+ * This interface defines constants for the SSH protocol.
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
* @version $Rev$, $Date$
*/
public interface SshConstants {
+ /**
+ * SSH message identifiers
+ */
public enum Message {
SSH_MSG_DISCONNECT(1),
@@ -93,6 +96,10 @@
}
}
+ //
+ // Values for the algorithms negociation
+ //
+
static final int PROPOSAL_KEX_ALGS = 0;
static final int PROPOSAL_SERVER_HOST_KEY_ALGS = 1;
static final int PROPOSAL_ENC_ALGS_CTOS = 2;
@@ -105,6 +112,10 @@
static final int PROPOSAL_LANG_STOC = 9;
static final int PROPOSAL_MAX = 10;
+
+ //
+ // Disconnect error codes
+ //
static final int SSH2_DISCONNECT_HOST_NOT_ALLOWED_TO_CONNECT = 1;
static final int SSH2_DISCONNECT_PROTOCOL_ERROR = 2;
static final int SSH2_DISCONNECT_KEY_EXCHANGE_FAILED = 3;
@@ -122,6 +133,10 @@
static final int SSH2_DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE = 14;
static final int SSH2_DISCONNECT_ILLEGAL_USER_NAME = 15;
+ //
+ // Open error codes
+ //
+
static final int SSH_OPEN_ADMINISTRATIVELY_PROHIBITED= 1;
static final int SSH_OPEN_CONNECT_FAILED= 2;
static final int SSH_OPEN_UNKNOWN_CHANNEL_TYPE= 3;
Modified:
mina/sshd/trunk/src/main/java/org/apache/sshd/server/PasswordAuthenticator.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/server/PasswordAuthenticator.java?rev=760378&r1=760377&r2=760378&view=diff
==============================================================================
---
mina/sshd/trunk/src/main/java/org/apache/sshd/server/PasswordAuthenticator.java
(original)
+++
mina/sshd/trunk/src/main/java/org/apache/sshd/server/PasswordAuthenticator.java
Tue Mar 31 09:31:38 2009
@@ -19,7 +19,8 @@
package org.apache.sshd.server;
/**
- * TODO Add javadoc
+ * The <code>PasswordAuthenticator</code> is used to authenticate
+ * users based on a password.
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
* @version $Rev$, $Date$
Modified:
mina/sshd/trunk/src/main/java/org/apache/sshd/server/PublickeyAuthenticator.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/server/PublickeyAuthenticator.java?rev=760378&r1=760377&r2=760378&view=diff
==============================================================================
---
mina/sshd/trunk/src/main/java/org/apache/sshd/server/PublickeyAuthenticator.java
(original)
+++
mina/sshd/trunk/src/main/java/org/apache/sshd/server/PublickeyAuthenticator.java
Tue Mar 31 09:31:38 2009
@@ -23,7 +23,8 @@
import org.apache.sshd.server.session.ServerSession;
/**
- * TODO Add javadoc
+ * The <code>PublickeyAuthenticator</code> is used on the server side
+ * to authenticate user public keys.
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
* @version $Rev$, $Date$
Modified:
mina/sshd/trunk/src/main/java/org/apache/sshd/server/ServerFactoryManager.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/server/ServerFactoryManager.java?rev=760378&r1=760377&r2=760378&view=diff
==============================================================================
---
mina/sshd/trunk/src/main/java/org/apache/sshd/server/ServerFactoryManager.java
(original)
+++
mina/sshd/trunk/src/main/java/org/apache/sshd/server/ServerFactoryManager.java
Tue Mar 31 09:31:38 2009
@@ -24,22 +24,62 @@
import org.apache.sshd.common.NamedFactory;
/**
- * TODO Add javadoc
+ * The <code>ServerFactoryManager</code> enable the retrieval of additional
+ * configuration needed specifically for the server side.
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
* @version $Rev$, $Date$
*/
public interface ServerFactoryManager extends FactoryManager {
+ /**
+ * Retrieve the list of named factories for <code>UserAuth<code> objects.
+ *
+ * @return a list of named <code>UserAuth</code> factories, never
<code>null</code>
+ */
+ List<NamedFactory<UserAuth>> getUserAuthFactories();
+
+ /**
+ * Retrieve the <code>PublickeyAuthenticator</code> to be used by SSH
server.
+ * If no authenticator has been configured (i.e. this method returns
+ * <code>null</code>), then client authentication requests based on keys
will be
+ * rejected.
+ *
+ * @return the <code>PublickeyAuthenticato</code> or <code>null</code>
+ */
PublickeyAuthenticator getPublickeyAuthenticator();
- List<NamedFactory<UserAuth>> getUserAuthFactories();
+ /**
+ * Retrieve the <code>PasswordAuthenticator</code> to be used by the SSH
server.
+ * If no authenticator has been configured (i.e. this method returns
+ * <code>null</code>), then client authentication requests based on
passwords
+ * will be rejected.
+ *
+ * @return the <code>PasswordAuthenticator</code> or <code>null</code>
+ */
+ PasswordAuthenticator getPasswordAuthenticator();
+ /**
+ * Retrieve the list of named factories for <code>ServerChannel</code>
objects.
+ *
+ * @return a list of named <code>ServerChannel</code> factories, never
<code>null</code>
+ */
List<NamedFactory<ServerChannel>> getChannelFactories();
+ /**
+ * Retrieve the <code>ShellFactory</code> object to be used to create
shells.
+ *
+ * @return a valid <code>ShellFactory</code> object or <code>null</code>
if shells
+ * are not supported on this server
+ */
ShellFactory getShellFactory();
+ /**
+ * Retrieve the <code>CommandFactory</code> to be used to process commands
requests.
+ *
+ * @return a valid <code>CommandFactory</code> object or <code>null</code>
if commands
+ * are not supported on this server
+ */
CommandFactory getCommandFactory();
- PasswordAuthenticator getPasswordAuthenticator();
}
Modified:
mina/sshd/trunk/src/main/java/org/apache/sshd/server/SessionFactory.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/server/SessionFactory.java?rev=760378&r1=760377&r2=760378&view=diff
==============================================================================
--- mina/sshd/trunk/src/main/java/org/apache/sshd/server/SessionFactory.java
(original)
+++ mina/sshd/trunk/src/main/java/org/apache/sshd/server/SessionFactory.java
Tue Mar 31 09:31:38 2009
@@ -25,7 +25,10 @@
import org.apache.sshd.server.session.ServerSession;
/**
- * A factory of sessions.
+ * A factory of server sessions.
+ * This class can be used as a way to customize the creation of server
sessions.
+ *
+ * @see SshServer#setSessionFactory(SessionFactory)
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
*/
Modified: mina/sshd/trunk/src/main/java/org/apache/sshd/server/ShellFactory.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/server/ShellFactory.java?rev=760378&r1=760377&r2=760378&view=diff
==============================================================================
--- mina/sshd/trunk/src/main/java/org/apache/sshd/server/ShellFactory.java
(original)
+++ mina/sshd/trunk/src/main/java/org/apache/sshd/server/ShellFactory.java Tue
Mar 31 09:31:38 2009
@@ -24,8 +24,9 @@
import java.util.Map;
/**
+ * This factory is used by SSH server when the client connected requests the
creation
+ * of a shell.
*
- * TODO Add javadoc
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
* @version $Rev$, $Date$
@@ -34,9 +35,11 @@
/**
* Create a shell.
+ * This method is not supposed to throw any exception.
+ * Exceptions should be thrown when calling {...@link
Shell#start(java.util.Map)}
+ * method on the shell to start it.
*
- * @return
- * @throws Exception
+ * @return the newly create shell
*/
Shell createShell();
Modified:
mina/sshd/trunk/src/main/java/org/apache/sshd/server/command/ScpCommand.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/server/command/ScpCommand.java?rev=760378&r1=760377&r2=760378&view=diff
==============================================================================
---
mina/sshd/trunk/src/main/java/org/apache/sshd/server/command/ScpCommand.java
(original)
+++
mina/sshd/trunk/src/main/java/org/apache/sshd/server/command/ScpCommand.java
Tue Mar 31 09:31:38 2009
@@ -29,7 +29,9 @@
import org.apache.sshd.server.CommandFactory;
/**
- * TODO Add javadoc
+ * This commands provide SCP support on both server and client side.
+ * Permissions and preservation of access / modification times on files
+ * are not supported.
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
* @version $Rev$, $Date$
Modified:
mina/sshd/trunk/src/main/java/org/apache/sshd/server/command/ScpCommandFactory.java
URL:
http://svn.apache.org/viewvc/mina/sshd/trunk/src/main/java/org/apache/sshd/server/command/ScpCommandFactory.java?rev=760378&r1=760377&r2=760378&view=diff
==============================================================================
---
mina/sshd/trunk/src/main/java/org/apache/sshd/server/command/ScpCommandFactory.java
(original)
+++
mina/sshd/trunk/src/main/java/org/apache/sshd/server/command/ScpCommandFactory.java
Tue Mar 31 09:31:38 2009
@@ -21,7 +21,11 @@
import org.apache.sshd.server.CommandFactory;
/**
- * TODO Add javadoc
+ * This <code>CommandFactory</code> can be used as a standalone command factory
+ * or can be used to augment another <code>CommandFactory</code> and provides
+ * <code>SCP</code> support.
+ *
+ * @see ScpCommand
*
* @author <a href="mailto:[email protected]">Apache MINA SSHD Project</a>
* @version $Rev$, $Date$