Class CliSupport

  • Direct Known Subclasses:
    SshClientCliSupport, SshServerCliSupport

    public abstract class CliSupport
    extends java.lang.Object
    Provides common utilities for SSH client/server execution from the CLI
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories DEFAULT_IO_SERVICE_FACTORY  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected CliSupport()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.sshd.common.io.IoServiceEventListener createLoggingIoServiceEventListener​(org.slf4j.Logger logger)  
      static org.apache.sshd.common.session.SessionListener createLoggingSessionListener​(org.slf4j.Logger logger)  
      static void printFieldsValues​(java.lang.Object info, java.io.PrintStream stdout)  
      static org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories resolveBuiltinIoServiceFactory​(java.io.PrintStream stderr, java.lang.String argName, java.lang.String provider)  
      static org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories resolveIoServiceFactory​(java.io.PrintStream stderr, java.lang.String... args)
      Scans the arguments for the "-io" command line option and sets the I/O service accordingly.
      static java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.cipher.Cipher>> setupCiphers​(java.lang.String argName, java.lang.String argVal, java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.cipher.Cipher>> current, java.io.PrintStream stderr)  
      static java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.cipher.Cipher>> setupCiphers​(org.apache.sshd.common.PropertyResolver options, java.io.PrintStream stderr)  
      static java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.compression.Compression>> setupCompressions​(java.lang.String argName, java.lang.String argVal, java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.compression.Compression>> current, java.io.PrintStream stderr)  
      static java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.compression.Compression>> setupCompressions​(org.apache.sshd.common.PropertyResolver options, java.io.PrintStream stderr)  
      static <M extends org.apache.sshd.common.helpers.AbstractFactoryManager>
      M
      setupIoServiceFactory​(M manager, org.apache.sshd.common.PropertyResolver resolver, java.util.logging.Level level, java.io.PrintStream stdout, java.io.PrintStream stderr, java.lang.String... args)  
      static java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.mac.Mac>> setupMacs​(java.lang.String argName, java.lang.String argVal, java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.mac.Mac>> current, java.io.PrintStream stderr)  
      static java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.mac.Mac>> setupMacs​(org.apache.sshd.common.PropertyResolver options, java.io.PrintStream stderr)  
      static <S extends org.apache.sshd.common.session.SessionContext,​M extends org.apache.sshd.common.auth.UserAuthInstance<S>,​F extends org.apache.sshd.common.auth.UserAuthMethodFactory<S,​M>,​I extends org.apache.sshd.common.auth.UserAuthFactoriesManager<S,​M,​F>>
      void
      setupUserAuthFactories​(I manager, org.apache.sshd.common.PropertyResolver options)  
      static java.lang.String[] splitCommandLineArguments​(java.lang.String line)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_IO_SERVICE_FACTORY

        public static final org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories DEFAULT_IO_SERVICE_FACTORY
    • Constructor Detail

      • CliSupport

        protected CliSupport()
    • Method Detail

      • setupUserAuthFactories

        public static <S extends org.apache.sshd.common.session.SessionContext,​M extends org.apache.sshd.common.auth.UserAuthInstance<S>,​F extends org.apache.sshd.common.auth.UserAuthMethodFactory<S,​M>,​I extends org.apache.sshd.common.auth.UserAuthFactoriesManager<S,​M,​F>> void setupUserAuthFactories​(I manager,
                                                                                                                                                                                                                                                                                                                                                 org.apache.sshd.common.PropertyResolver options)
      • resolveIoServiceFactory

        public static org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories resolveIoServiceFactory​(java.io.PrintStream stderr,
                                                                                                         java.lang.String... args)
        Scans the arguments for the "-io" command line option and sets the I/O service accordingly. If no specific option specified then DEFAULT_IO_SERVICE_FACTORY is used.
        Parameters:
        stderr - Error stream for output of error messages
        args - The arguments to scan
        Returns:
        The resolved I/O service factory - null if errors encountered
      • resolveBuiltinIoServiceFactory

        public static org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories resolveBuiltinIoServiceFactory​(java.io.PrintStream stderr,
                                                                                                                java.lang.String argName,
                                                                                                                java.lang.String provider)
      • setupIoServiceFactory

        public static <M extends org.apache.sshd.common.helpers.AbstractFactoryManager> M setupIoServiceFactory​(M manager,
                                                                                                                org.apache.sshd.common.PropertyResolver resolver,
                                                                                                                java.util.logging.Level level,
                                                                                                                java.io.PrintStream stdout,
                                                                                                                java.io.PrintStream stderr,
                                                                                                                java.lang.String... args)
      • createLoggingIoServiceEventListener

        public static org.apache.sshd.common.io.IoServiceEventListener createLoggingIoServiceEventListener​(org.slf4j.Logger logger)
      • createLoggingSessionListener

        public static org.apache.sshd.common.session.SessionListener createLoggingSessionListener​(org.slf4j.Logger logger)
      • setupCompressions

        public static java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.compression.Compression>> setupCompressions​(org.apache.sshd.common.PropertyResolver options,
                                                                                                                                            java.io.PrintStream stderr)
      • setupCompressions

        public static java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.compression.Compression>> setupCompressions​(java.lang.String argName,
                                                                                                                                            java.lang.String argVal,
                                                                                                                                            java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.compression.Compression>> current,
                                                                                                                                            java.io.PrintStream stderr)
      • setupMacs

        public static java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.mac.Mac>> setupMacs​(org.apache.sshd.common.PropertyResolver options,
                                                                                                                    java.io.PrintStream stderr)
      • setupMacs

        public static java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.mac.Mac>> setupMacs​(java.lang.String argName,
                                                                                                                    java.lang.String argVal,
                                                                                                                    java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.mac.Mac>> current,
                                                                                                                    java.io.PrintStream stderr)
      • setupCiphers

        public static java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.cipher.Cipher>> setupCiphers​(org.apache.sshd.common.PropertyResolver options,
                                                                                                                             java.io.PrintStream stderr)
      • setupCiphers

        public static java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.cipher.Cipher>> setupCiphers​(java.lang.String argName,
                                                                                                                             java.lang.String argVal,
                                                                                                                             java.util.List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.cipher.Cipher>> current,
                                                                                                                             java.io.PrintStream stderr)
      • splitCommandLineArguments

        public static java.lang.String[] splitCommandLineArguments​(java.lang.String line)
      • printFieldsValues

        public static void printFieldsValues​(java.lang.Object info,
                                             java.io.PrintStream stdout)
                                      throws java.lang.Exception
        Throws:
        java.lang.Exception