Class ConfigFileHostEntryResolver
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.common.util.io.ModifiableFileWatcher
-
- org.apache.sshd.client.config.hosts.ConfigFileHostEntryResolver
-
- All Implemented Interfaces:
HostConfigEntryResolver
- Direct Known Subclasses:
DefaultConfigFileHostEntryResolver
public class ConfigFileHostEntryResolver extends ModifiableFileWatcher implements HostConfigEntryResolver
Watches for changes in a configuration file and automatically reloads any changes- Author:
- Apache MINA SSHD Project
-
-
Field Summary
-
Fields inherited from class org.apache.sshd.common.util.io.ModifiableFileWatcher
options, STRICTLY_PROHIBITED_FILE_PERMISSION
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Fields inherited from interface org.apache.sshd.client.config.hosts.HostConfigEntryResolver
EMPTY
-
-
Constructor Summary
Constructors Constructor Description ConfigFileHostEntryResolver(Path file)
ConfigFileHostEntryResolver(Path file, LinkOption... options)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<HostConfigEntry>
reloadHostConfigEntries(Path path, String host, int port, String username, String proxyJump)
HostConfigEntry
resolveEffectiveHost(String host, int port, SocketAddress localAddress, String username, String proxyJump, AttributeRepository context)
Invoked when creating a new client session in order to allow for overriding of the original parametersprotected HostConfigEntryResolver
resolveEffectiveResolver(String host, int port, String username, String proxyJump)
-
Methods inherited from class org.apache.sshd.common.util.io.ModifiableFileWatcher
checkReloadRequired, exists, getPath, lastModified, resetReloadAttributes, size, toPathResource, toPathResource, toString, updateReloadAttributes, validateStrictConfigFilePermissions
-
-
-
-
Constructor Detail
-
ConfigFileHostEntryResolver
public ConfigFileHostEntryResolver(Path file)
-
ConfigFileHostEntryResolver
public ConfigFileHostEntryResolver(Path file, LinkOption... options)
-
-
Method Detail
-
resolveEffectiveHost
public HostConfigEntry resolveEffectiveHost(String host, int port, SocketAddress localAddress, String username, String proxyJump, AttributeRepository context) throws IOException
Description copied from interface:HostConfigEntryResolver
Invoked when creating a new client session in order to allow for overriding of the original parameters- Specified by:
resolveEffectiveHost
in interfaceHostConfigEntryResolver
- Parameters:
host
- The requested host - nevernull
/emptyport
- The requested portlocalAddress
- Optional binding endpoint for the local peerusername
- The requested usernameproxyJump
- The requested proxyJumpcontext
- An optional "context" provided during the connection request (to be attached to the established session if successfully connected)- Returns:
- 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 - Throws:
IOException
- If failed to resolve the configuration
-
resolveEffectiveResolver
protected HostConfigEntryResolver resolveEffectiveResolver(String host, int port, String username, String proxyJump) throws IOException
- Throws:
IOException
-
reloadHostConfigEntries
protected List<HostConfigEntry> reloadHostConfigEntries(Path path, String host, int port, String username, String proxyJump) throws IOException
- Throws:
IOException
-
-