Class SshServerCliSupport

    • Field Detail

      • SHELL_FACTORY_OPTION

        public static final java.lang.String SHELL_FACTORY_OPTION
        See Also:
        Constant Field Values
      • DEFAULT_SHELL_FACTORY

        public static final ShellFactory DEFAULT_SHELL_FACTORY
    • Constructor Detail

      • SshServerCliSupport

        protected SshServerCliSupport()
    • Method Detail

      • resolveServerKeys

        public static KeyPairProvider resolveServerKeys​(java.io.PrintStream stderr,
                                                        java.lang.String hostKeyType,
                                                        int hostKeySize,
                                                        java.util.Collection<java.lang.String> keyFiles)
                                                 throws java.lang.Exception
        Throws:
        java.lang.Exception
      • setupServerForwarding

        public static ForwardingFilter setupServerForwarding​(SshServer server,
                                                             java.util.logging.Level level,
                                                             java.io.PrintStream stdout,
                                                             java.io.PrintStream stderr,
                                                             PropertyResolver options)
      • resolveServerSubsystems

        public static java.util.List<SubsystemFactory> resolveServerSubsystems​(ServerFactoryManager server,
                                                                               java.util.logging.Level level,
                                                                               java.io.PrintStream stdout,
                                                                               java.io.PrintStream stderr,
                                                                               PropertyResolver options)
                                                                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • registerSubsystemFactoryListeners

        public static <F extends SubsystemFactory> F registerSubsystemFactoryListeners​(ServerFactoryManager server,
                                                                                       java.util.logging.Level level,
                                                                                       java.io.PrintStream stdout,
                                                                                       java.io.PrintStream stderr,
                                                                                       PropertyResolver options,
                                                                                       F factory)
                                                                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • resolveShellFactory

        public static ShellFactory resolveShellFactory​(java.util.logging.Level level,
                                                       java.io.PrintStream stdout,
                                                       java.io.PrintStream stderr,
                                                       PropertyResolver options)
                                                throws java.lang.Exception
        Attempts to examine the SHELL_FACTORY_OPTION configuration.
        • If missing/empty then returns the DEFAULT_SHELL_FACTORY.
        • If NONE then returns null
        • If SCP then returns a ScpCommandFactory
        • Otherwise, assumes this is a fully qualified class path of a ShellFactory implementation and attempts to load and instantiate it using a public no-args constructor
        Parameters:
        level - The verbosity Level
        stdout - The STDOUT stream for logging
        stderr - The STDERR stream for errors
        options - The available options - assuming defaults if null
        Returns:
        The resolved ShellFactory
        Throws:
        java.lang.Exception - If failed to resolve
      • createScpCommandFactory

        public static ScpCommandFactory createScpCommandFactory​(java.util.logging.Level level,
                                                                java.io.PrintStream stdout,
                                                                java.io.PrintStream stderr,
                                                                ShellFactory delegateShellFactory)