Package org.apache.camel.component.ssh
Class SshConfiguration
java.lang.Object
org.apache.camel.component.ssh.SshConfiguration
- All Implemented Interfaces:
Cloneable
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcopy()org.apache.sshd.client.ClientBuildergetHost()getKex()org.apache.sshd.common.keyprovider.KeyPairProvidergetMacs()intgetPort()longlongbooleanvoidsetCertResource(String certResource) Sets the resource path of the certificate to use for Authentication.voidsetCertResourcePassword(String certResourcePassword) Sets the password to use in loading certResource, if certResource is an encrypted key.voidsetChannelType(String channelType) Sets the channel type to pass to the Channel as part of command execution.voidsetCiphers(String ciphers) Comma-separated list of allowed/supported ciphers in their order of preference.voidsetClientBuilder(org.apache.sshd.client.ClientBuilder clientBuilder) Instance ofClientBuilderused by the producer or consumer to create a newSshClientvoidsetCompressions(String compressions) Whether to use compression, and if so which.voidsetFailOnUnknownHost(boolean failOnUnknownHost) Specifies whether a connection to an unknown host should fail or not.voidSets the hostname of the remote SSH server.voidComma-separated list of allowed/supported key exchange algorithms in their **order** of preference.voidsetKeyPairProvider(org.apache.sshd.common.keyprovider.KeyPairProvider keyPairProvider) Sets the KeyPairProvider reference to use when connecting using Certificates to the remote SSH Server.voidsetKeyType(String keyType) Sets the key type to pass to the KeyPairProvider as part of authentication.voidsetKnownHostsResource(String knownHostsResource) Sets the resource path for a known_hosts filevoidComma-separated list of allowed/supported message authentication code algorithms in their **order** of preference.voidsetPassword(String password) Sets the password to use in connecting to remote SSH server.voidsetPollCommand(String pollCommand) Sets the command string to send to the remote SSH server during every poll cycle.voidsetPort(int port) Sets the port number for the remote SSH server.voidsetShellPrompt(String shellPrompt) Sets the shellPrompt to be dropped when response is read after command executionvoidsetSignatures(String signatures) Comma-separated list of allowed/supported signature algorithms in their order of preference.voidsetSleepForShellPrompt(long sleepForShellPrompt) Sets the sleep period in milliseconds to wait reading response from shell prompt.voidsetTimeout(long timeout) Sets the timeout in milliseconds to wait in establishing the remote SSH server connection.voidsetUsername(String username) Sets the username to use in logging into the remote SSH server.
-
Field Details
-
DEFAULT_SSH_PORT
public static final int DEFAULT_SSH_PORT- See Also:
-
-
Constructor Details
-
SshConfiguration
public SshConfiguration() -
SshConfiguration
-
-
Method Details
-
configure
-
copy
-
getUsername
-
setUsername
Sets the username to use in logging into the remote SSH server.- Parameters:
username- String representing login username.
-
getHost
-
setHost
Sets the hostname of the remote SSH server.- Parameters:
host- String representing hostname of SSH server.
-
getPort
public int getPort() -
setPort
public void setPort(int port) Sets the port number for the remote SSH server.- Parameters:
port- int representing port number on remote host. Defaults to 22.
-
getPassword
-
setPassword
Sets the password to use in connecting to remote SSH server. Requires keyPairProvider to be set to null.- Parameters:
password- String representing password for username at remote host.
-
getPollCommand
-
setPollCommand
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- Parameters:
pollCommand- String representing the command to send.
-
getKeyPairProvider
public org.apache.sshd.common.keyprovider.KeyPairProvider getKeyPairProvider() -
setKeyPairProvider
public void setKeyPairProvider(org.apache.sshd.common.keyprovider.KeyPairProvider keyPairProvider) Sets the KeyPairProvider reference to use when connecting using Certificates to the remote SSH Server.- Parameters:
keyPairProvider- KeyPairProvider reference to use in authenticating. If set to 'null', then will attempt to connect using username/password settings.- See Also:
-
getKeyType
-
setKeyType
Sets the key type to pass to the KeyPairProvider as part of authentication. KeyPairProvider.loadKey(...) will be passed this value. From Camel 3.0.0 / 2.25.0, by default Camel will select the first available KeyPair that is loaded. Prior to this, a KeyType of 'ssh-rsa' was enforced by default.- Parameters:
keyType- String defining the type of KeyPair to use for authentication.- See Also:
-
getTimeout
public long getTimeout() -
setTimeout
public void setTimeout(long timeout) Sets the timeout in milliseconds to wait in establishing the remote SSH server connection. Defaults to 30000 milliseconds.- Parameters:
timeout- long milliseconds to wait.
-
getCertResource
-
setCertResource
Sets the resource path of the certificate to use for Authentication. Will useResourceHelperKeyPairProviderto resolve file based certificate, and depends on keyType setting.- Parameters:
certResource- String file, classpath, or http url for the certificate
-
getCertResourcePassword
-
setCertResourcePassword
Sets the password to use in loading certResource, if certResource is an encrypted key.- Parameters:
certResourcePassword- String representing password use to load the certResource key
-
getKnownHostsResource
-
setKnownHostsResource
Sets the resource path for a known_hosts file- Parameters:
knownHostsResource- String file, classpath, or http url for the certificate
-
isFailOnUnknownHost
public boolean isFailOnUnknownHost() -
setFailOnUnknownHost
public void setFailOnUnknownHost(boolean failOnUnknownHost) Specifies whether a connection to an unknown host should fail or not. This value is only checked when the property knownHosts is set.- Parameters:
failOnUnknownHost- boolean flag, whether a connection to an unknown host should fail
-
getChannelType
-
setChannelType
Sets the channel type to pass to the Channel as part of command execution. Defaults to "exec".- Parameters:
channelType- String defining the type of Channel to use for command execution.- See Also:
-
getShellPrompt
-
setShellPrompt
Sets the shellPrompt to be dropped when response is read after command execution- Parameters:
shellPrompt- String defining ending string of command line which has to be dropped when response is read after command execution.
-
getSleepForShellPrompt
public long getSleepForShellPrompt() -
setSleepForShellPrompt
public void setSleepForShellPrompt(long sleepForShellPrompt) Sets the sleep period in milliseconds to wait reading response from shell prompt. Defaults to 100 milliseconds.- Parameters:
sleepForShellPrompt- long milliseconds to wait.
-
getKex
-
setKex
Comma-separated list of allowed/supported key exchange algorithms in their **order** of preference.- Parameters:
kex-
-
getCiphers
-
setCiphers
Comma-separated list of allowed/supported ciphers in their order of preference.- Parameters:
ciphers-
-
getMacs
-
setMacs
Comma-separated list of allowed/supported message authentication code algorithms in their **order** of preference. The MAC algorithm is used for data integrity protection.- Parameters:
macs-
-
getSignatures
-
setSignatures
Comma-separated list of allowed/supported signature algorithms in their order of preference.- Parameters:
signatures-
-
getCompressions
-
setCompressions
Whether to use compression, and if so which.- Parameters:
compressions-
-
getClientBuilder
public org.apache.sshd.client.ClientBuilder getClientBuilder() -
setClientBuilder
public void setClientBuilder(org.apache.sshd.client.ClientBuilder clientBuilder) Instance ofClientBuilderused by the producer or consumer to create a newSshClient- Parameters:
clientBuilder- theClientBuilderinstance
-