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
-
Field Summary
FieldsFields 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 -
Method Summary
Modifier and TypeMethodDescriptionprotected List
<HostConfigEntry> reloadHostConfigEntries
(Path path, String host, int port, String username, String proxyJump) 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
-
Field Details
-
delegateHolder
-
-
Constructor Details
-
ConfigFileHostEntryResolver
-
ConfigFileHostEntryResolver
-
-
Method Details
-
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
-