Package org.apache.sshd.client
Class ClientBuilder
- java.lang.Object
-
- org.apache.sshd.common.BaseBuilder<SshClient,ClientBuilder>
-
- org.apache.sshd.client.ClientBuilder
-
- All Implemented Interfaces:
Supplier<SshClient>
,ObjectBuilder<SshClient>
public class ClientBuilder extends BaseBuilder<SshClient,ClientBuilder>
SshClient builder
-
-
Field Summary
Fields Modifier and Type Field Description protected ClientIdentityLoader
clientIdentityLoader
static List<ChannelFactory>
DEFAULT_CHANNEL_FACTORIES
static ClientIdentityLoader
DEFAULT_CLIENT_IDENTITY_LOADER
static List<CompressionFactory>
DEFAULT_COMPRESSION_FACTORIES
static FilePasswordProvider
DEFAULT_FILE_PASSWORD_PROVIDER
static List<RequestHandler<ConnectionService>>
DEFAULT_GLOBAL_REQUEST_HANDLERS
static HostConfigEntryResolver
DEFAULT_HOST_CONFIG_ENTRY_RESOLVER
static ServerKeyVerifier
DEFAULT_SERVER_KEY_VERIFIER
static List<BuiltinSignatures>
DEFAULT_SIGNATURE_PREFERENCE
static Function<DHFactory,KeyExchangeFactory>
DH2KEX
protected FilePasswordProvider
filePasswordProvider
protected HostConfigEntryResolver
hostConfigEntryResolver
protected ServerKeyVerifier
serverKeyVerifier
-
Fields inherited from class org.apache.sshd.common.BaseBuilder
channelFactories, channelStreamPacketWriterResolver, cipherFactories, compressionFactories, DEFAULT_CIPHERS_PREFERENCE, DEFAULT_FILE_SYSTEM_FACTORY, DEFAULT_FORWARDER_FACTORY, DEFAULT_FORWARDING_FILTER, DEFAULT_KEX_PREFERENCE, DEFAULT_MAC_PREFERENCE, DEFAULT_UNKNOWN_CHANNEL_REFERENCE_HANDLER, factory, fileSystemFactory, forwarderFactory, forwardingFilter, globalRequestHandlers, keyExchangeFactories, macFactories, randomFactory, signatureFactories, unknownChannelReferenceHandler
-
-
Constructor Summary
Constructors Constructor Description ClientBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description SshClient
build(boolean isFillWithDefaultValues)
static ClientBuilder
builder()
ClientBuilder
clientIdentityLoader(ClientIdentityLoader loader)
ClientBuilder
filePasswordProvider(FilePasswordProvider provider)
protected ClientBuilder
fillWithDefaultValues()
ClientBuilder
hostConfigEntryResolver(HostConfigEntryResolver resolver)
ClientBuilder
serverKeyVerifier(ServerKeyVerifier serverKeyVerifier)
static List<NamedFactory<Compression>>
setUpDefaultCompressionFactories(boolean ignoreUnsupported)
static List<KeyExchangeFactory>
setUpDefaultKeyExchanges(boolean ignoreUnsupported)
static List<NamedFactory<Signature>>
setUpDefaultSignatureFactories(boolean ignoreUnsupported)
-
Methods inherited from class org.apache.sshd.common.BaseBuilder
build, channelFactories, channelStreamPacketWriterResolver, cipherFactories, compressionFactories, factory, fileSystemFactory, forwarderFactory, forwardingFilter, globalRequestHandlers, keyExchangeFactories, macFactories, me, randomFactory, setUpDefaultCiphers, setUpDefaultMacs, signatureFactories, unknownChannelReferenceHandler
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.common.util.ObjectBuilder
get
-
-
-
-
Field Detail
-
DEFAULT_SIGNATURE_PREFERENCE
public static final List<BuiltinSignatures> DEFAULT_SIGNATURE_PREFERENCE
-
DH2KEX
public static final Function<DHFactory,KeyExchangeFactory> DH2KEX
-
DEFAULT_COMPRESSION_FACTORIES
public static final List<CompressionFactory> DEFAULT_COMPRESSION_FACTORIES
-
DEFAULT_CHANNEL_FACTORIES
public static final List<ChannelFactory> DEFAULT_CHANNEL_FACTORIES
-
DEFAULT_GLOBAL_REQUEST_HANDLERS
public static final List<RequestHandler<ConnectionService>> DEFAULT_GLOBAL_REQUEST_HANDLERS
-
DEFAULT_SERVER_KEY_VERIFIER
public static final ServerKeyVerifier DEFAULT_SERVER_KEY_VERIFIER
-
DEFAULT_HOST_CONFIG_ENTRY_RESOLVER
public static final HostConfigEntryResolver DEFAULT_HOST_CONFIG_ENTRY_RESOLVER
-
DEFAULT_CLIENT_IDENTITY_LOADER
public static final ClientIdentityLoader DEFAULT_CLIENT_IDENTITY_LOADER
-
DEFAULT_FILE_PASSWORD_PROVIDER
public static final FilePasswordProvider DEFAULT_FILE_PASSWORD_PROVIDER
-
serverKeyVerifier
protected ServerKeyVerifier serverKeyVerifier
-
hostConfigEntryResolver
protected HostConfigEntryResolver hostConfigEntryResolver
-
clientIdentityLoader
protected ClientIdentityLoader clientIdentityLoader
-
filePasswordProvider
protected FilePasswordProvider filePasswordProvider
-
-
Method Detail
-
serverKeyVerifier
public ClientBuilder serverKeyVerifier(ServerKeyVerifier serverKeyVerifier)
-
hostConfigEntryResolver
public ClientBuilder hostConfigEntryResolver(HostConfigEntryResolver resolver)
-
clientIdentityLoader
public ClientBuilder clientIdentityLoader(ClientIdentityLoader loader)
-
filePasswordProvider
public ClientBuilder filePasswordProvider(FilePasswordProvider provider)
-
fillWithDefaultValues
protected ClientBuilder fillWithDefaultValues()
- Overrides:
fillWithDefaultValues
in classBaseBuilder<SshClient,ClientBuilder>
-
build
public SshClient build(boolean isFillWithDefaultValues)
- Overrides:
build
in classBaseBuilder<SshClient,ClientBuilder>
-
setUpDefaultSignatureFactories
public static List<NamedFactory<Signature>> setUpDefaultSignatureFactories(boolean ignoreUnsupported)
-
setUpDefaultCompressionFactories
public static List<NamedFactory<Compression>> setUpDefaultCompressionFactories(boolean ignoreUnsupported)
-
setUpDefaultKeyExchanges
public static List<KeyExchangeFactory> setUpDefaultKeyExchanges(boolean ignoreUnsupported)
- Parameters:
ignoreUnsupported
- Iftrue
then all the default key exchanges are included, regardless of whether they are currently supported by the JCE. Otherwise, only the supported ones out of the list are included- Returns:
- A
List
of the defaultNamedFactory
instances of theKeyExchange
s according to the preference order defined byBaseBuilder.DEFAULT_KEX_PREFERENCE
. Note: the list may be filtered to exclude unsupported JCE key exchanges according to the ignoreUnsupported parameter - See Also:
BuiltinDHFactories.isSupported()
-
builder
public static ClientBuilder builder()
-
-