RemoteSession based on Apache MINA sshd.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private SshClient | |
| private final CopyOnWriteArrayList | |
| private static final Logger | |
| private static final int | |
| private ClientSession | |
| private static final Pattern | |
| private final URIish |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| private void | |
| pack-priv void | |
| private ClientSession | connect(URIish target, List<URIish> jumps, SshFutureListener<CloseFuture> listener, Duration timeout, int depth)
|
| private ClientSession | |
| private List | |
| public void | disconnect()
Implements org. Disconnects the remote session. |
| private void | |
| public Process | exec(String
command to execute commandName, int timeout value, in seconds, for creating the remote process timeout)Implements org. Creates a new remote |
| public Process | |
| public FtpChannel | getFtpChannel()
Overrides default org. Obtain an |
| private HostConfigEntry | |
| private void | |
| private List | |
| public void | removeCloseListener(SessionCloseListener
to remove listener)Removes the given |
| private String |
| client | back to summary |
|---|---|
| private SshClient client | |
| listeners | back to summary |
|---|---|
| private final CopyOnWriteArrayList<SessionCloseListener> listeners | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| MAX_DEPTH | back to summary |
|---|---|
| private static final int MAX_DEPTH | |
| session | back to summary |
|---|---|
| private ClientSession session | |
| SHORT_SSH_FORMAT | back to summary |
|---|---|
| private static final Pattern SHORT_SSH_FORMAT | |
| uri | back to summary |
|---|---|
| private final URIish uri | |
| SshdSession | back to summary |
|---|---|
| pack-priv SshdSession(URIish uri, Supplier<SshClient> clientFactory) | |
| addCloseListener | back to summary |
|---|---|
| public void addCloseListener(SessionCloseListener listener) Adds a
| |
| close | back to summary |
|---|---|
| private void close(Closeable toClose, Throwable error) | |
| connect | back to summary |
|---|---|
| pack-priv void connect(Duration timeout) throws IOException | |
| connect | back to summary |
|---|---|
| private ClientSession connect(URIish target, List<URIish> jumps, SshFutureListener<CloseFuture> listener, Duration timeout, int depth) throws IOException | |
| connect | back to summary |
|---|---|
| private ClientSession connect(HostConfigEntry config, AttributeRepository context, Duration timeout) throws IOException | |
| determineHops | back to summary |
|---|---|
| private List | |
| disconnect | back to summary |
|---|---|
| public void disconnect() Implements org. Doc from org. Disconnects the remote session.
| |
| disconnect | back to summary |
|---|---|
| private void disconnect(Throwable reason) | |
| exec | back to summary |
|---|---|
| public Process exec(String commandName, int timeout) throws IOException Implements org. Doc from org. Creates a new remote
| |
| exec | back to summary |
|---|---|
| public Process exec(String commandName, Map<String, String> environment, int timeout) throws IOException Implements org. Doc from org. Creates a new remote
| |
| getFtpChannel | back to summary |
|---|---|
| public FtpChannel getFtpChannel() Overrides default org. Obtain an
| |
| getHostConfig | back to summary |
|---|---|
| private HostConfigEntry getHostConfig(String username, String host, int port) throws IOException | |
| notifyCloseListeners | back to summary |
|---|---|
| private void notifyCloseListeners() | |
| parseProxyJump | back to summary |
|---|---|
| private List | |
| removeCloseListener | back to summary |
|---|---|
| public void removeCloseListener(SessionCloseListener listener) Removes the given
| |
| withAuthLog | back to summary |
|---|---|
| private String withAuthLog(String message, AuthenticationLogger authLog) | |
| Modifier and Type | Field and Description |
|---|---|
| private final ChannelExec | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public int | |
| public InputStream | getErrorStream()
Implements abstract java. Returns the input stream connected to the error output of the process. |
| public InputStream | getInputStream()
Implements abstract java. Returns the input stream connected to the normal output of the process. |
| public OutputStream | getOutputStream()
Implements abstract java. Returns the output stream connected to the normal input of the process. |
| public int | waitFor()
Implements abstract java. Causes the current thread to wait, if necessary, until the
process represented by this |
| public boolean | waitFor(long
the maximum time to wait timeout, TimeUnit the time unit of the unit)timeout argumentOverrides java. Causes the current thread to wait, if necessary, until the
process represented by this |
| channel | back to summary |
|---|---|
| private final ChannelExec channel | |
| commandName | back to summary |
|---|---|
| private final String commandName | |
| SshdExecProcess | back to summary |
|---|---|
| public SshdExecProcess(ChannelExec channel, String commandName) | |
| destroy | back to summary |
|---|---|
| public void destroy() Implements abstract java. Doc from java. Kills the process.
Whether the process represented by this
The
| |
| exitValue | back to summary |
|---|---|
| public int exitValue() Implements abstract java. Doc from java. Returns the exit value for the process.
| |
| getErrorStream | back to summary |
|---|---|
| public InputStream getErrorStream() Implements abstract java. Doc from java. Returns the input stream connected to the error output of the
process. The stream obtains data piped from the error output
of the process represented by this If the standard error of the process has been redirected using
| |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() Implements abstract java. Doc from java. Returns the input stream connected to the normal output of the
process. The stream obtains data piped from the standard
output of the process represented by this If the standard output of the process has been redirected using
Otherwise, if the standard error of the process has been
redirected using
| |
| getOutputStream | back to summary |
|---|---|
| public OutputStream getOutputStream() Implements abstract java. Doc from java. Returns the output stream connected to the normal input of the
process. Output to the stream is piped into the standard
input of the process represented by this If the standard input of the process has been redirected using
| |
| waitFor | back to summary |
|---|---|
| public int waitFor() throws InterruptedException Implements abstract java. Doc from java. Causes the current thread to wait, if necessary, until the
process represented by this
| |
| waitFor | back to summary |
|---|---|
| public boolean waitFor(long timeout, TimeUnit unit) throws InterruptedException Overrides java. Doc from java. Causes the current thread to wait, if necessary, until the
process represented by this If the process has already terminated then this method returns
immediately with the value
| |
| Modifier and Type | Field and Description |
|---|---|
| private String | cwd
Current working directory. |
| private SftpClient |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private String | |
| public void | cd(String
target directory path)Implements org. Changes the current remote directory. |
| public void | connect(int
for establishing the FTP connection timeout, TimeUnit of the unit)timeoutImplements org. Connects the |
| public void | disconnect()
Implements org. Disconnects and |
| public InputStream | get(String
of the file to read path)Implements org. Obtain an |
| public boolean | isConnected()
Implements org. Whether the FtpChannel is connected |
| public Collection | ls(String
of the directory to list path)Implements org. Lists contents of a remote directory |
| private <T> T | |
| public void | mkdir(String
to create path)Implements org. Creates a directory on the remote file system. |
| public OutputStream | put(String
of the file to read path)Implements org. Obtain an |
| public String | |
| public void | rename(String
original name of the file from, String new name of the file to)Implements org. Renames a file on the remote file system. |
| public void | rm(String
to delete path)Implements org. Deletes a file on the remote file system. |
| public void | rmdir(String
to delete path)Implements org. Deletes a directory on the remote file system. |
| cwd | back to summary |
|---|---|
| private String cwd Current working directory. | |
| ftp | back to summary |
|---|---|
| private SftpClient ftp | |
| SshdFtpChannel | back to summary |
|---|---|
| private SshdFtpChannel() | |
| absolute | back to summary |
|---|---|
| private String absolute(String path) | |
| cd | back to summary |
|---|---|
| public void cd(String path) throws IOException Implements org. Doc from org. Changes the current remote directory.
| |
| connect | back to summary |
|---|---|
| public void connect(int timeout, TimeUnit unit) throws IOException Implements org. Doc from org. Connects the
| |
| disconnect | back to summary |
|---|---|
| public void disconnect() Implements org. Doc from org. Disconnects and
| |
| get | back to summary |
|---|---|
| public InputStream get(String path) throws IOException Implements org. Doc from org. Obtain an
| |
| isConnected | back to summary |
|---|---|
| public boolean isConnected() Implements org. Doc from org. Whether the FtpChannel is connected
| |
| ls | back to summary |
|---|---|
| public Collection Implements org. Doc from org. Lists contents of a remote directory
| |
| map | back to summary |
|---|---|
| private <T> T map(IOFunction<Void, T> op) throws IOException | |
| mkdir | back to summary |
|---|---|
| public void mkdir(String path) throws IOException Implements org. Doc from org. Creates a directory on the remote file system.
| |
| put | back to summary |
|---|---|
| public OutputStream put(String path) throws IOException Implements org. Doc from org. Obtain an
| |
| pwd | back to summary |
|---|---|
| public String pwd() throws IOException Implements org. Doc from org. Get current remote directory path
| |
| rename | back to summary |
|---|---|
| public void rename(String from, String to) throws IOException Implements org. Doc from org. Renames a file on the remote file system. If
| |
| rm | back to summary |
|---|---|
| public void rm(String path) throws IOException Implements org. Doc from org. Deletes a file on the remote file system.
| |
| rmdir | back to summary |
|---|---|
| public void rmdir(String path) throws IOException Implements org. Doc from org. Deletes a directory on the remote file system. The directory must be empty.
| |