public class SshClient extends Object implements AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_TIMEOUT_MS |
| Constructor and Description |
|---|
SshClient(InetSocketAddress addr,
String username,
String password) |
| Modifier and Type | Method and Description |
|---|---|
static Callable<Boolean> |
canConnectViaSsh(InetSocketAddress addr,
String username,
String password) |
void |
close() |
InetSocketAddress |
getAddr() |
String |
getStderr() |
String |
getStdout() |
boolean |
isShellClosed()
Checks if the shell's channel is closed.
|
Callable<Boolean> |
isShellClosedCallable() |
PrintStream |
openShell() |
void |
setTimeout(int timeoutInMs) |
public static final int DEFAULT_TIMEOUT_MS
public SshClient(InetSocketAddress addr, String username, String password)
public PrintStream openShell() throws Exception
Exceptionpublic String getStdout() throws IOException
IOExceptionpublic String getStderr() throws IOException
IOExceptionpublic void setTimeout(int timeoutInMs)
public InetSocketAddress getAddr()
public void close()
throws Exception
close in interface AutoCloseableExceptionpublic boolean isShellClosed()
public static Callable<Boolean> canConnectViaSsh(InetSocketAddress addr, String username, String password)
Copyright © 2022. All rights reserved.