public final class SshdSessionFactoryBuilder extends Object
SshdSessionFactories.| Modifier and Type | Class and Description |
|---|---|
static interface |
SshdSessionFactoryBuilder.ConfigStoreFactory
A factory interface for creating a @link SshConfigStore}.
|
| Constructor and Description |
|---|
SshdSessionFactoryBuilder() |
public SshdSessionFactoryBuilder setProxyDataFactory(ProxyDataFactory proxyDataFactory)
proxyDataFactory - to useSshdSessionFactoryBuilderpublic SshdSessionFactoryBuilder setHomeDirectory(File homeDirectory)
SshdSessionFactories created by build(KeyCache).homeDirectory - to use; may be null, in which case the home directory
as defined by FS.userHome() is assumedSshdSessionFactoryBuilderpublic SshdSessionFactoryBuilder setSshDirectory(File sshDirectory)
SshdSessionFactories created by build(KeyCache).sshDirectory - to use; may be null, in which case ".ssh" under the
home directory is assumedSshdSessionFactoryBuilderpublic SshdSessionFactoryBuilder setPreferredAuthentications(String authentications)
SshdSessionFactories created by
build(KeyCache).authentications - comma-separated list of authentication mechanism names; if
null or empty, the default as specified by
SshdSessionFactory.getDefaultPreferredAuthentications()
will be usedSshdSessionFactoryBuilderpublic SshdSessionFactoryBuilder setConfigFile(Function<File,File> supplier)
null, in which case no SSH
config file will be used. If a non-null file is returned, it will be used
when it exists. If no supplier has been set, or the supplier has been set
explicitly to null, by default a file named
SshConstants.CONFIG in the SSH directory
is used.supplier - returning a File for the SSH config file to use, or
returning null if no config file is to be usedSshdSessionFactoryBuilderpublic SshdSessionFactoryBuilder setConfigStoreFactory(SshdSessionFactoryBuilder.ConfigStoreFactory factory)
SshConfigStore to use. If not set or
explicitly set to null, the default as specified by
SshdSessionFactory.createSshConfigStore(File, File, String) is
used.factory - to setSshdSessionFactoryBuilderpublic SshdSessionFactoryBuilder setDefaultKnownHostsFiles(Function<File,List<Path>> supplier)
null, the defaults as
specified by SshdSessionFactory.getDefaultKnownHostsFiles(File)
are used.supplier - to get the default known hosts filesSshdSessionFactoryBuilderpublic SshdSessionFactoryBuilder setDefaultIdentities(Function<File,List<Path>> supplier)
null, the defaults as
specified by SshdSessionFactory.getDefaultIdentities(File) are
used.supplier - to get the default private key filesSshdSessionFactoryBuilderpublic SshdSessionFactoryBuilder setDefaultKeysProvider(Function<File,Iterable<KeyPair>> provider)
null, the defaults as
specified by SshdSessionFactory.getDefaultKeys(File) are used.provider - to get the default private key filesSshdSessionFactoryBuilderpublic SshdSessionFactoryBuilder setKeyPasswordProvider(Function<CredentialsProvider,KeyPasswordProvider> factory)
KeyPasswordProvider. If not
set or explicitly set to null, or if the factory returns
null, the default as specified by
SshdSessionFactory.createKeyPasswordProvider(CredentialsProvider)
is used.factory - to create a KeyPasswordProviderSshdSessionFactoryBuilderpublic SshdSessionFactoryBuilder setServerKeyDatabase(BiFunction<File,File,ServerKeyDatabase> factory)
ServerKeyDatabase, given the
SSH and home directory. If not set or explicitly set to null, or
if the factory returns null, the default as specified by
SshdSessionFactory.createServerKeyDatabase(File, File) is used.factory - to create a ServerKeyDatabaseSshdSessionFactoryBuilderpublic SshdSessionFactory build(KeyCache cache)
SshdSessionFactory as configured, using the given
KeyCache for caching keys.
Different SshdSessionFactories should
not share the same KeyCache since the cache is
invalidated when the factory itself or when the last SshdSession
created from the factory is closed.
cache - to use for caching ssh keys; may be null if no caching
is desired.SshdSessionFactoryCopyright © 2020 Eclipse JGit Project. All rights reserved.