public class PerHostConfigBuilder extends ConfigBuilderImpl implements com.jcraft.jsch.ConfigRepository
ConfigRepository
that supports different configuration on a per host basis.
If a host is not configured then we build default configuration from getDefaultConfiguration()
In the adapter configuration file this class is aliased as sftp-per-host-config-builder which is the preferred alternative to the fully qualified classname when building your configuration.
Constructor and Description |
---|
PerHostConfigBuilder() |
Modifier and Type | Method and Description |
---|---|
com.jcraft.jsch.ConfigRepository |
buildConfigRepository()
Build a
ConfigRepository . |
com.jcraft.jsch.ConfigRepository.Config |
getConfig(java.lang.String host)
Return the configuration for the host.
|
KeyValuePairSet |
getDefaultConfiguration() |
java.util.List<HostConfig> |
getHosts() |
void |
setDefaultConfiguration(KeyValuePairSet kvps)
Set your default configuration options.
|
void |
setHosts(java.util.List<HostConfig> hostConfig) |
buildProxy, getProxy, setProxy
public com.jcraft.jsch.ConfigRepository.Config getConfig(java.lang.String host)
If a host is not configured then we build default configuration from getDefaultConfiguration()
getConfig
in interface com.jcraft.jsch.ConfigRepository
public java.util.List<HostConfig> getHosts()
public void setHosts(java.util.List<HostConfig> hostConfig)
hostConfig
- the hosts to setpublic com.jcraft.jsch.ConfigRepository buildConfigRepository() throws java.io.IOException
ConfigBuilder
ConfigRepository
.buildConfigRepository
in interface ConfigBuilder
ConfigRepository
java.io.IOException
public KeyValuePairSet getDefaultConfiguration()
public void setDefaultConfiguration(KeyValuePairSet kvps)
Some of the more common options you might configure are:
compression.s2c
and compression.c2s
for the compression algorithm to use : none
or zlib
compression_level
for the level of compressionserver_host_key
for enabling or disabling certain types of keys such as
ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521
StrictHostKeyChecking
to force the host to present in any configured known_hosts
filePreferredAuthentications
for preferred authentication mechanisms such as
gssapi-with-mic,publickey,keyboard-interactive,password
kex
for the key exchange algorithmsServerAliveInterval
, ConnectTimeout
, MaxAuthTries
, ClearAllForwardings
,
HashKnownHosts
Generally the defaults are quite sensible, so you don't tend to need to configure anything unless the host you are connecting to has some very specific requires
kvps
- the defaultConfiguration to set