Top Description Fields Constructors Methods
org.apache.sshd.client.config.hosts

public Class ConfigFileHostEntryResolver

extends ModifiableFileWatcher
implements HostConfigEntryResolver
Class Inheritance
All Implemented Interfaces
org.apache.sshd.client.config.hosts.HostConfigEntryResolver
Known Direct Subclasses
org.apache.sshd.client.config.hosts.DefaultConfigFileHostEntryResolver
Imports
java.io.IOException, java.net.SocketAddress, java.nio.file.LinkOption, .Path, java.util.Collection, .List, .Objects, java.util.concurrent.atomic.AtomicReference, org.apache.sshd.common.AttributeRepository, org.apache.sshd.common.util.GenericUtils, org.apache.sshd.common.util.io.IoUtils, .ModifiableFileWatcher

Watches for changes in a configuration file and automatically reloads any changes
Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private final AtomicReference<HostConfigEntryResolver>
Inherited from org.apache.sshd.common.util.io.ModifiableFileWatcher:
optionsSTRICTLY_PROHIBITED_FILE_PERMISSION

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
protected List<HostConfigEntry>
reloadHostConfigEntries(Path path, String host, int port, String username, String proxyJump)

public HostConfigEntry
resolveEffectiveHost(String
The requested host - never null/empty
host
,
int
The requested port
port
,
SocketAddress
Optional binding endpoint for the local peer
localAddress
,
String
The requested username
username
,
String
The requested proxyJump
proxyJump
,
AttributeRepository
An optional "context" provided during the connection request (to be attached to the established session if successfully connected)
context
)

Implements org.apache.sshd.client.config.hosts.HostConfigEntryResolver.resolveEffectiveHost.

Invoked when creating a new client session in order to allow for overriding of the original parameters

protected HostConfigEntryResolver
resolveEffectiveResolver(String host, int port, String username, String proxyJump)

Inherited from org.apache.sshd.common.util.io.ModifiableFileWatcher:
checkReloadRequiredexistsgetPathlastModifiedresetReloadAttributessizetoPathResourcetoPathResourcetoStringupdateReloadAttributesvalidateStrictConfigFilePermissions

Field Detail

delegateHolderback to summary
private final AtomicReference<HostConfigEntryResolver> delegateHolder

Constructor Detail

ConfigFileHostEntryResolverback to summary
public ConfigFileHostEntryResolver(Path file)
ConfigFileHostEntryResolverback to summary
public ConfigFileHostEntryResolver(Path file, LinkOption... options)

Method Detail

reloadHostConfigEntriesback to summary
protected List<HostConfigEntry> reloadHostConfigEntries(Path path, String host, int port, String username, String proxyJump) throws IOException
resolveEffectiveHostback to summary
public HostConfigEntry resolveEffectiveHost(String host, int port, SocketAddress localAddress, String username, String proxyJump, AttributeRepository context) throws IOException

Implements org.apache.sshd.client.config.hosts.HostConfigEntryResolver.resolveEffectiveHost.

Doc from org.apache.sshd.client.config.hosts.HostConfigEntryResolver.resolveEffectiveHost.

Invoked when creating a new client session in order to allow for overriding of the original parameters

Parameters
host:String

The requested host - never null/empty

port:int

The requested port

localAddress:SocketAddress

Optional binding endpoint for the local peer

username:String

The requested username

proxyJump:String

The requested proxyJump

context:AttributeRepository

An optional "context" provided during the connection request (to be attached to the established session if successfully connected)

Returns:HostConfigEntry

A HostConfigEntry for the actual target - null if use original parameters

Note

if any identity files are attached to the configuration then they must point to existing locations. This means that any macros such as ~, %d, %h, etc. must be resolved prior to returning the value

Annotations
@Override
Exceptions
IOException:
If failed to resolve the configuration
resolveEffectiveResolverback to summary
protected HostConfigEntryResolver resolveEffectiveResolver(String host, int port, String username, String proxyJump) throws IOException