Class SshClientCliSupport

    • Field Detail

      • SSH_CLIENT_PORT_OPTION

        public static final java.lang.String SSH_CLIENT_PORT_OPTION
        Command line option used to indicate non-default target port
        See Also:
        Constant Field Values
    • Constructor Detail

      • SshClientCliSupport

        protected SshClientCliSupport()
    • Method Detail

      • isArgumentedOption

        public static boolean isArgumentedOption​(java.lang.String portOption,
                                                 java.lang.String argName)
      • setupClientSession

        public static ClientSession setupClientSession​(java.lang.String portOption,
                                                       java.io.BufferedReader stdin,
                                                       java.util.logging.Level level,
                                                       java.io.PrintStream stdout,
                                                       java.io.PrintStream stderr,
                                                       java.lang.String... args)
                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • resolveHost

        public static HostConfigEntry resolveHost​(ClientFactoryManager client,
                                                  java.lang.String username,
                                                  java.lang.String host,
                                                  int port,
                                                  java.lang.String proxyJump)
                                           throws java.io.IOException
        Throws:
        java.io.IOException
      • resolveIdentityFile

        public static java.nio.file.Path resolveIdentityFile​(java.lang.String id)
                                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • resolveClientEnvironment

        public static java.util.Map<java.lang.String,​?> resolveClientEnvironment​(PropertyResolver resolver)
      • resolveClientEnvironment

        public static java.util.Map<java.lang.String,​?> resolveClientEnvironment​(java.util.Map<java.lang.String,​?> options)
      • resolveClientPtyOptions

        public static PtyChannelConfiguration resolveClientPtyOptions​(PropertyResolver resolver)
                                                               throws java.io.IOException,
                                                                      java.lang.InterruptedException
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • resolveClientPtyOptions

        public static PtyChannelConfiguration resolveClientPtyOptions​(java.util.Map<java.lang.String,​?> options)
                                                               throws java.io.IOException,
                                                                      java.lang.InterruptedException
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • resolveClientPtyModes

        public static java.util.Map<PtyMode,​java.lang.Integer> resolveClientPtyModes​(java.util.Map<java.lang.String,​?> options)
                                                                                    throws java.io.IOException,
                                                                                           java.lang.InterruptedException
        Throws:
        java.io.IOException
        java.lang.InterruptedException
      • setupDefaultClient

        public static SshClient setupDefaultClient​(PropertyResolver resolver,
                                                   java.util.logging.Level level,
                                                   java.io.PrintStream stdout,
                                                   java.io.PrintStream stderr,
                                                   java.lang.String... args)
      • setupClient

        public static SshClient setupClient​(PropertyResolver resolver,
                                            java.util.List<NamedFactory<Cipher>> ciphers,
                                            java.util.List<NamedFactory<Mac>> macs,
                                            java.util.List<NamedFactory<Compression>> compressions,
                                            java.util.Collection<? extends java.nio.file.Path> identities,
                                            java.io.BufferedReader stdin,
                                            java.io.PrintStream stdout,
                                            java.io.PrintStream stderr,
                                            java.util.logging.Level level,
                                            java.lang.String[] args)
                                     throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setupSessionIdentities

        public static FileKeyPairProvider setupSessionIdentities​(ClientFactoryManager client,
                                                                 java.util.Collection<? extends java.nio.file.Path> identities,
                                                                 java.io.BufferedReader stdin,
                                                                 java.io.PrintStream stdout,
                                                                 java.io.PrintStream stderr)
                                                          throws java.lang.Throwable
        Throws:
        java.lang.Throwable
      • setupSessionUserInteraction

        public static UserInteraction setupSessionUserInteraction​(ClientAuthenticationManager client,
                                                                  java.io.BufferedReader stdin,
                                                                  java.io.PrintStream stdout,
                                                                  java.io.PrintStream stderr)
      • setupSessionExtensions

        public static void setupSessionExtensions​(KexFactoryManager manager,
                                                  PropertyResolver resolver,
                                                  java.io.BufferedReader stdin,
                                                  java.io.PrintStream stdout,
                                                  java.io.PrintStream stderr)
                                           throws java.lang.Exception
        Throws:
        java.lang.Exception
      • resolveLoggingTargetStream

        public static java.io.OutputStream resolveLoggingTargetStream​(java.io.PrintStream stdout,
                                                                      java.io.PrintStream stderr,
                                                                      java.lang.String... args)
      • resolveLoggingTargetStream

        public static java.io.OutputStream resolveLoggingTargetStream​(java.io.PrintStream stdout,
                                                                      java.io.PrintStream stderr,
                                                                      java.lang.String[] args,
                                                                      int maxIndex)
      • setupLogging

        public static java.util.logging.Handler setupLogging​(java.util.logging.Level level,
                                                             java.io.PrintStream stdout,
                                                             java.io.PrintStream stderr,
                                                             java.io.OutputStream outputStream)