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 classSsh.ExecuteParamsprivate static classSsh.JLineUserInteractionstatic classSsh.ShellParams
-
Field Summary
Fields Modifier and Type Field Description private java.util.function.Supplier<org.apache.sshd.client.SshClient>clientBuilderprivate static intdefaultPortprivate java.util.function.Consumer<Ssh.ExecuteParams>executestatic java.lang.String[]functionsprivate java.lang.Stringipprivate intportprivate org.apache.sshd.server.SshServerserverprivate java.util.function.Supplier<org.apache.sshd.server.SshServer>serverBuilderprivate 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.ClientSessionconnectWithRetries(java.io.PrintWriter stdout, org.apache.sshd.client.SshClient client, java.lang.String username, java.lang.String host, int port, int maxAttempts)private static intgetFlag(Attributes attributes, Attributes.InputFlag flag)private static intgetFlag(Attributes attributes, Attributes.LocalFlag flag)private static intgetFlag(Attributes attributes, Attributes.OutputFlag flag)voidssh(Terminal terminal, LineReader reader, java.lang.String user, java.io.InputStream stdin, java.io.PrintStream stdout, java.io.PrintStream stderr, java.lang.String[] argv)voidsshd(java.io.PrintStream stdout, java.io.PrintStream stderr, java.lang.String[] argv)private voidstart()private voidstatus(java.io.PrintStream stdout)private voidstop()
-
-
-
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
-
-