Component doc
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/525b56b7 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/525b56b7 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/525b56b7 Branch: refs/heads/master Commit: 525b56b7321004d99d18e25bce0a70da38921079 Parents: 4f283d1 Author: Claus Ibsen <davscl...@apache.org> Authored: Fri Apr 24 13:38:49 2015 +0200 Committer: Claus Ibsen <davscl...@apache.org> Committed: Fri Apr 24 13:38:49 2015 +0200 ---------------------------------------------------------------------- .../camel/component/ssh/SshComponent.java | 63 ++++++++++++++++++++ .../camel/component/ssh/SshConfiguration.java | 3 +- 2 files changed, 65 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/525b56b7/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshComponent.java ---------------------------------------------------------------------- diff --git a/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshComponent.java b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshComponent.java index 5635ff2..3f45770 100644 --- a/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshComponent.java +++ b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshComponent.java @@ -55,6 +55,9 @@ public class SshComponent extends UriEndpointComponent { return configuration; } + /** + * To use the shared SSH configuration + */ public void setConfiguration(SshConfiguration configuration) { this.configuration = configuration; } @@ -63,6 +66,11 @@ public class SshComponent extends UriEndpointComponent { return getConfiguration().getHost(); } + /** + * Sets the hostname of the remote SSH server. + * + * @param host String representing hostname of SSH server. + */ public void setHost(String host) { getConfiguration().setHost(host); } @@ -71,6 +79,11 @@ public class SshComponent extends UriEndpointComponent { return getConfiguration().getPort(); } + /** + * Sets the port number for the remote SSH server. + * + * @param port int representing port number on remote host. Defaults to 22. + */ public void setPort(int port) { getConfiguration().setPort(port); } @@ -79,6 +92,11 @@ public class SshComponent extends UriEndpointComponent { return getConfiguration().getUsername(); } + /** + * Sets the username to use in logging into the remote SSH server. + * + * @param username String representing login username. + */ public void setUsername(String username) { getConfiguration().setUsername(username); } @@ -87,6 +105,12 @@ public class SshComponent extends UriEndpointComponent { return getConfiguration().getPassword(); } + /** + * Sets the password to use in connecting to remote SSH server. + * Requires keyPairProvider to be set to null. + * + * @param password String representing password for username at remote host. + */ public void setPassword(String password) { getConfiguration().setPassword(password); } @@ -95,6 +119,13 @@ public class SshComponent extends UriEndpointComponent { return getConfiguration().getPollCommand(); } + /** + * Sets the command string to send to the remote SSH server during every poll cycle. + * Only works with camel-ssh component being used as a consumer, i.e. from("ssh://..."). + * You may need to end your command with a newline, and that must be URL encoded %0A + * + * @param pollCommand String representing the command to send. + */ public void setPollCommand(String pollCommand) { getConfiguration().setPollCommand(pollCommand); } @@ -103,6 +134,14 @@ public class SshComponent extends UriEndpointComponent { return getConfiguration().getKeyPairProvider(); } + /** + * Sets the KeyPairProvider reference to use when connecting using Certificates to the remote SSH Server. + * + * @param keyPairProvider KeyPairProvider reference to use in authenticating. If set to 'null', + * then will attempt to connect using username/password settings. + * + * @see KeyPairProvider + */ public void setKeyPairProvider(KeyPairProvider keyPairProvider) { getConfiguration().setKeyPairProvider(keyPairProvider); } @@ -111,6 +150,14 @@ public class SshComponent extends UriEndpointComponent { return getConfiguration().getKeyType(); } + /** + * Sets the key type to pass to the KeyPairProvider as part of authentication. + * KeyPairProvider.loadKey(...) will be passed this value. Defaults to "ssh-rsa". + * + * @param keyType String defining the type of KeyPair to use for authentication. + * + * @see KeyPairProvider + */ public void setKeyType(String keyType) { getConfiguration().setKeyType(keyType); } @@ -119,6 +166,12 @@ public class SshComponent extends UriEndpointComponent { return getConfiguration().getTimeout(); } + /** + * Sets the timeout in milliseconds to wait in establishing the remote SSH server connection. + * Defaults to 30000 milliseconds. + * + * @param timeout long milliseconds to wait. + */ public void setTimeout(long timeout) { getConfiguration().setTimeout(timeout); } @@ -126,13 +179,17 @@ public class SshComponent extends UriEndpointComponent { /** * @deprecated As of version 2.11, replaced by {@link #getCertResource()} */ + @Deprecated public String getCertFilename() { return getConfiguration().getCertFilename(); } /** + * Sets the resource path of the certificate to use for Authentication. + * * @deprecated As of version 2.11, replaced by {@link #setCertResource(String)} */ + @Deprecated public void setCertFilename(String certFilename) { getConfiguration().setCertFilename(certFilename); } @@ -141,6 +198,12 @@ public class SshComponent extends UriEndpointComponent { return getConfiguration().getCertResource(); } + /** + * Sets the resource path of the certificate to use for Authentication. + * Will use {@link ResourceHelperKeyPairProvider} to resolve file based certificate, and depends on keyType setting. + * + * @param certResource String file, classpath, or http url for the certificate + */ public void setCertResource(String certResource) { getConfiguration().setCertResource(certResource); } http://git-wip-us.apache.org/repos/asf/camel/blob/525b56b7/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshConfiguration.java ---------------------------------------------------------------------- diff --git a/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshConfiguration.java b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshConfiguration.java index b172519..4d2921c 100644 --- a/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshConfiguration.java +++ b/components/camel-ssh/src/main/java/org/apache/camel/component/ssh/SshConfiguration.java @@ -38,7 +38,7 @@ public class SshConfiguration implements Cloneable { private String username; @UriParam private String password; - @UriParam + @UriParam(label = "consumer") private String pollCommand; private KeyPairProvider keyPairProvider; @UriParam(defaultValue = KeyPairProvider.SSH_RSA) @@ -148,6 +148,7 @@ public class SshConfiguration implements Cloneable { /** * Sets the command string to send to the remote SSH server during every poll cycle. * Only works with camel-ssh component being used as a consumer, i.e. from("ssh://...") + * You may need to end your command with a newline, and that must be URL encoded %0A * * @param pollCommand String representing the command to send. */