Class 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 Details

  • Constructor Details

    • ConfigFileHostEntryResolver

      public ConfigFileHostEntryResolver(Path file)
    • ConfigFileHostEntryResolver

      public ConfigFileHostEntryResolver(Path file, LinkOption... options)
  • 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 interface HostConfigEntryResolver
      Parameters:
      host - The requested host - never null/empty
      port - The requested port
      localAddress - Optional binding endpoint for the local peer
      username - The requested username
      proxyJump - The requested proxyJump
      context - 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