Package org.apache.sshd.cli
Class CliSupport
- java.lang.Object
-
- org.apache.sshd.cli.CliSupport
-
- Direct Known Subclasses:
SshClientCliSupport,SshServerCliSupport
public abstract class CliSupport extends java.lang.ObjectProvides common utilities for SSH client/server execution from the CLI
-
-
Field Summary
Fields Modifier and Type Field Description static BuiltinIoServiceFactoryFactoriesDEFAULT_IO_SERVICE_FACTORY
-
Constructor Summary
Constructors Modifier Constructor Description protectedCliSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static IoServiceEventListenercreateLoggingIoServiceEventListener(org.slf4j.Logger logger)static SessionListenercreateLoggingSessionListener(org.slf4j.Logger logger)static voidprintFieldsValues(java.lang.Object info, java.io.PrintStream stdout)static BuiltinIoServiceFactoryFactoriesresolveBuiltinIoServiceFactory(java.io.PrintStream stderr, java.lang.String argName, java.lang.String provider)static BuiltinIoServiceFactoryFactoriesresolveIoServiceFactory(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<NamedFactory<Cipher>>setupCiphers(java.lang.String argName, java.lang.String argVal, java.util.List<NamedFactory<Cipher>> current, java.io.PrintStream stderr)static java.util.List<NamedFactory<Cipher>>setupCiphers(PropertyResolver options, java.io.PrintStream stderr)static java.util.List<NamedFactory<Compression>>setupCompressions(java.lang.String argName, java.lang.String argVal, java.util.List<NamedFactory<Compression>> current, java.io.PrintStream stderr)static java.util.List<NamedFactory<Compression>>setupCompressions(PropertyResolver options, java.io.PrintStream stderr)static <M extends AbstractFactoryManager>
MsetupIoServiceFactory(M manager, PropertyResolver resolver, java.util.logging.Level level, java.io.PrintStream stdout, java.io.PrintStream stderr, java.lang.String... args)static java.util.List<NamedFactory<Mac>>setupMacs(java.lang.String argName, java.lang.String argVal, java.util.List<NamedFactory<Mac>> current, java.io.PrintStream stderr)static java.util.List<NamedFactory<Mac>>setupMacs(PropertyResolver options, java.io.PrintStream stderr)static <S extends SessionContext,M extends UserAuthInstance<S>,F extends UserAuthMethodFactory<S,M>,I extends UserAuthFactoriesManager<S,M,F>>
voidsetupUserAuthFactories(I manager, PropertyResolver options)static java.lang.String[]splitCommandLineArguments(java.lang.String line)
-
-
-
Field Detail
-
DEFAULT_IO_SERVICE_FACTORY
public static final BuiltinIoServiceFactoryFactories DEFAULT_IO_SERVICE_FACTORY
-
-
Method Detail
-
setupUserAuthFactories
public static <S extends SessionContext,M extends UserAuthInstance<S>,F extends UserAuthMethodFactory<S,M>,I extends UserAuthFactoriesManager<S,M,F>> void setupUserAuthFactories(I manager, PropertyResolver options)
-
resolveIoServiceFactory
public static 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 thenDEFAULT_IO_SERVICE_FACTORYis used.- Parameters:
stderr- Error stream for output of error messagesargs- The arguments to scan- Returns:
- The resolved I/O service factory -
nullif errors encountered
-
resolveBuiltinIoServiceFactory
public static BuiltinIoServiceFactoryFactories resolveBuiltinIoServiceFactory(java.io.PrintStream stderr, java.lang.String argName, java.lang.String provider)
-
setupIoServiceFactory
public static <M extends AbstractFactoryManager> M setupIoServiceFactory(M manager, PropertyResolver resolver, java.util.logging.Level level, java.io.PrintStream stdout, java.io.PrintStream stderr, java.lang.String... args)
-
createLoggingIoServiceEventListener
public static IoServiceEventListener createLoggingIoServiceEventListener(org.slf4j.Logger logger)
-
createLoggingSessionListener
public static SessionListener createLoggingSessionListener(org.slf4j.Logger logger)
-
setupCompressions
public static java.util.List<NamedFactory<Compression>> setupCompressions(PropertyResolver options, java.io.PrintStream stderr)
-
setupCompressions
public static java.util.List<NamedFactory<Compression>> setupCompressions(java.lang.String argName, java.lang.String argVal, java.util.List<NamedFactory<Compression>> current, java.io.PrintStream stderr)
-
setupMacs
public static java.util.List<NamedFactory<Mac>> setupMacs(PropertyResolver options, java.io.PrintStream stderr)
-
setupMacs
public static java.util.List<NamedFactory<Mac>> setupMacs(java.lang.String argName, java.lang.String argVal, java.util.List<NamedFactory<Mac>> current, java.io.PrintStream stderr)
-
setupCiphers
public static java.util.List<NamedFactory<Cipher>> setupCiphers(PropertyResolver options, java.io.PrintStream stderr)
-
setupCiphers
public static java.util.List<NamedFactory<Cipher>> setupCiphers(java.lang.String argName, java.lang.String argVal, java.util.List<NamedFactory<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
-
-