Package org.jline.builtins.ssh
Class Ssh
- java.lang.Object
-
- org.jline.builtins.ssh.Ssh
-
public class Ssh extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Ssh.ExecuteParams
private static class
Ssh.JLineUserInteraction
static class
Ssh.ShellParams
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Supplier<org.apache.sshd.client.SshClient>
clientBuilder
private static int
defaultPort
private java.util.function.Consumer<Ssh.ExecuteParams>
execute
static java.lang.String[]
functions
private java.lang.String
ip
private int
port
private org.apache.sshd.server.SshServer
server
private java.util.function.Supplier<org.apache.sshd.server.SshServer>
serverBuilder
private java.util.function.Consumer<Ssh.ShellParams>
shell
-
Constructor Summary
Constructors Constructor Description Ssh(java.util.function.Consumer<Ssh.ShellParams> shell, java.util.function.Consumer<Ssh.ExecuteParams> execute, java.util.function.Supplier<org.apache.sshd.server.SshServer> serverBuilder, java.util.function.Supplier<org.apache.sshd.client.SshClient> clientBuilder)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.apache.sshd.client.session.ClientSession
connectWithRetries(java.io.PrintWriter stdout, org.apache.sshd.client.SshClient client, java.lang.String username, java.lang.String host, int port, int maxAttempts)
private static int
getFlag(Attributes attributes, Attributes.InputFlag flag)
private static int
getFlag(Attributes attributes, Attributes.LocalFlag flag)
private static int
getFlag(Attributes attributes, Attributes.OutputFlag flag)
void
ssh(Terminal terminal, LineReader reader, java.lang.String user, java.io.InputStream stdin, java.io.PrintStream stdout, java.io.PrintStream stderr, java.lang.String[] argv)
void
sshd(java.io.PrintStream stdout, java.io.PrintStream stderr, java.lang.String[] argv)
private void
start()
private void
status(java.io.PrintStream stdout)
private void
stop()
-
-
-
Field Detail
-
functions
public static final java.lang.String[] functions
-
defaultPort
private static final int defaultPort
- See Also:
- Constant Field Values
-
shell
private final java.util.function.Consumer<Ssh.ShellParams> shell
-
execute
private final java.util.function.Consumer<Ssh.ExecuteParams> execute
-
serverBuilder
private final java.util.function.Supplier<org.apache.sshd.server.SshServer> serverBuilder
-
clientBuilder
private final java.util.function.Supplier<org.apache.sshd.client.SshClient> clientBuilder
-
server
private org.apache.sshd.server.SshServer server
-
port
private int port
-
ip
private java.lang.String ip
-
-
Constructor Detail
-
Ssh
public Ssh(java.util.function.Consumer<Ssh.ShellParams> shell, java.util.function.Consumer<Ssh.ExecuteParams> execute, java.util.function.Supplier<org.apache.sshd.server.SshServer> serverBuilder, java.util.function.Supplier<org.apache.sshd.client.SshClient> clientBuilder)
-
-
Method Detail
-
ssh
public void ssh(Terminal terminal, LineReader reader, java.lang.String user, java.io.InputStream stdin, java.io.PrintStream stdout, java.io.PrintStream stderr, java.lang.String[] argv) throws java.lang.Exception
- Throws:
java.lang.Exception
-
getFlag
private static int getFlag(Attributes attributes, Attributes.InputFlag flag)
-
getFlag
private static int getFlag(Attributes attributes, Attributes.OutputFlag flag)
-
getFlag
private static int getFlag(Attributes attributes, Attributes.LocalFlag flag)
-
connectWithRetries
private org.apache.sshd.client.session.ClientSession connectWithRetries(java.io.PrintWriter stdout, org.apache.sshd.client.SshClient client, java.lang.String username, java.lang.String host, int port, int maxAttempts) throws java.lang.Exception
- Throws:
java.lang.Exception
-
sshd
public void sshd(java.io.PrintStream stdout, java.io.PrintStream stderr, java.lang.String[] argv) throws java.lang.Exception
- Throws:
java.lang.Exception
-
status
private void status(java.io.PrintStream stdout)
-
start
private void start() throws java.io.IOException
- Throws:
java.io.IOException
-
stop
private void stop() throws java.io.IOException
- Throws:
java.io.IOException
-
-