Interface SshConfigStore

  • All Known Implementing Classes:
    OpenSshConfigFile

    public interface SshConfigStore
    An abstraction for a SSH config storage, like the OpenSSH ~/.ssh/config file.
    Since:
    5.8
    • Method Detail

      • lookup

        @NonNull
        SshConfigStore.HostConfig lookup​(@NonNull
                                         java.lang.String hostName,
                                         int port,
                                         java.lang.String userName)
        Locate the configuration for a specific host request.
        Parameters:
        hostName - to look up
        port - the user supplied; <= 0 if none
        userName - the user supplied, may be null or empty if none given
        Returns:
        the configuration for the requested name.
      • lookupDefault

        @NonNull
        SshConfigStore.HostConfig lookupDefault​(@NonNull
                                                java.lang.String hostName,
                                                int port,
                                                java.lang.String userName)
        Locate the configuration for a specific host request and if the configuration has no values for SshConstants.HOST_NAME, SshConstants.PORT, SshConstants.USER, or SshConstants.CONNECTION_ATTEMPTS, fill those values with defaults from the arguments:
        ssh config key value from argument
        HostName hostName
        Port port > 0 ? port : 22
        User userName
        ConnectionAttempts 1
        Parameters:
        hostName - host name to look up
        port - port number; <= 0 if none
        userName - the user name, may be null or empty if none given
        Returns:
        the configuration for the requested name.
        Since:
        6.0