Package org.apache.sshd.cli
Class CliSupport
java.lang.Object
org.apache.sshd.cli.CliSupport
- Direct Known Subclasses:
SshClientCliSupport
,SshServerCliSupport
Provides common utilities for SSH client/server execution from the CLI
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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
(Object info, PrintStream stdout) static org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories
resolveBuiltinIoServiceFactory
(PrintStream stderr, String argName, String provider) static org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories
resolveIoServiceFactory
(PrintStream stderr, String... args) Scans the arguments for the "-io" command line option and sets the I/O service accordingly.static List
<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.cipher.Cipher>> setupCiphers
(String argName, String argVal, List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.cipher.Cipher>> current, PrintStream stderr) static List
<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.cipher.Cipher>> setupCiphers
(org.apache.sshd.common.PropertyResolver options, PrintStream stderr) static List
<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.compression.Compression>> setupCompressions
(String argName, String argVal, List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.compression.Compression>> current, PrintStream stderr) static List
<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.compression.Compression>> setupCompressions
(org.apache.sshd.common.PropertyResolver options, PrintStream stderr) static <M extends org.apache.sshd.common.helpers.AbstractFactoryManager>
MsetupIoServiceFactory
(M manager, org.apache.sshd.common.PropertyResolver resolver, Level level, PrintStream stdout, PrintStream stderr, String... args) static List
<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.mac.Mac>> setupMacs
(String argName, String argVal, List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.mac.Mac>> current, PrintStream stderr) static List
<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.mac.Mac>> setupMacs
(org.apache.sshd.common.PropertyResolver options, 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>>
voidsetupUserAuthFactories
(I manager, org.apache.sshd.common.PropertyResolver options) static String[]
-
Field Details
-
DEFAULT_IO_SERVICE_FACTORY
public static final org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories DEFAULT_IO_SERVICE_FACTORY
-
-
Constructor Details
-
CliSupport
protected CliSupport()
-
-
Method Details
-
setupUserAuthFactories
public static <S extends org.apache.sshd.common.session.SessionContext,M extends org.apache.sshd.common.auth.UserAuthInstance<S>, void setupUserAuthFactoriesF extends org.apache.sshd.common.auth.UserAuthMethodFactory<S, M>, I extends org.apache.sshd.common.auth.UserAuthFactoriesManager<S, M, F>> (I manager, org.apache.sshd.common.PropertyResolver options) -
resolveIoServiceFactory
public static org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories resolveIoServiceFactory(PrintStream stderr, 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_FACTORY
is used.- Parameters:
stderr
- Error stream for output of error messagesargs
- 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(PrintStream stderr, String argName, String provider) -
setupIoServiceFactory
public static <M extends org.apache.sshd.common.helpers.AbstractFactoryManager> M setupIoServiceFactory(M manager, org.apache.sshd.common.PropertyResolver resolver, Level level, PrintStream stdout, PrintStream stderr, 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 List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.compression.Compression>> setupCompressions(org.apache.sshd.common.PropertyResolver options, PrintStream stderr) -
setupCompressions
public static List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.compression.Compression>> setupCompressions(String argName, String argVal, List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.compression.Compression>> current, PrintStream stderr) -
setupMacs
public static List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.mac.Mac>> setupMacs(org.apache.sshd.common.PropertyResolver options, PrintStream stderr) -
setupMacs
public static List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.mac.Mac>> setupMacs(String argName, String argVal, List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.mac.Mac>> current, PrintStream stderr) -
setupCiphers
public static List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.cipher.Cipher>> setupCiphers(org.apache.sshd.common.PropertyResolver options, PrintStream stderr) -
setupCiphers
public static List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.cipher.Cipher>> setupCiphers(String argName, String argVal, List<org.apache.sshd.common.NamedFactory<org.apache.sshd.common.cipher.Cipher>> current, PrintStream stderr) -
splitCommandLineArguments
-
printFieldsValues
- Throws:
Exception
-