Package com.sshtools.client.tasks
Class ShellTask
java.lang.Object
com.sshtools.common.ssh.AbstractRequestFuture
com.sshtools.common.ssh.ConnectionAwareTask
- All Implemented Interfaces:
com.sshtools.common.ssh.RequestFuture
,Closeable
,AutoCloseable
,Runnable
A
Task
that starts a remote shell with an allocated PTY.
You cannot directly create a ShellTask
, instead use ShellTask.ShellTaskBuilder
.
client.addTask(ShellTaskBuilder.create(). withTermType("vt320"). withColumns(132). withRows(48). onClose((task, session) -> System.out.println("Closed!")). build());
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builder forShellTask
.static interface
Functional interface for tasks run on certain shell events.Nested classes/interfaces inherited from class com.sshtools.client.tasks.AbstractSessionTask
AbstractSessionTask.AbstractSessionTaskBuilder<B extends AbstractSessionTask.AbstractSessionTaskBuilder<B,
SC, TT>, SC extends AbstractSessionChannel, TT extends AbstractSessionTask<SC>> Nested classes/interfaces inherited from class com.sshtools.client.tasks.AbstractConnectionTask
AbstractConnectionTask.AbstractConnectionTaskBuilder<B extends AbstractConnectionTask.AbstractConnectionTaskBuilder<B,
T>, T extends AbstractConnectionTask> Nested classes/interfaces inherited from class com.sshtools.client.tasks.Task
Task.TaskRunnable<T>
-
Field Summary
Fields inherited from class com.sshtools.client.tasks.AbstractConnectionTask
clientSupplier
Fields inherited from class com.sshtools.common.ssh.ConnectionAwareTask
con, lastError
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
beforeStartShell
(SessionChannelNG session) Deprecated.protected void
Deprecated, for removal: This API element is subject to removal in a future version.protected SessionChannelNG
createSession
(com.sshtools.common.ssh.SshConnection con) Deprecated.protected void
onCloseSession
(SessionChannelNG session) Deprecated.protected void
onOpenSession
(SessionChannelNG session) Deprecated.Methods inherited from class com.sshtools.client.tasks.AbstractShellTask
setupSession
Methods inherited from class com.sshtools.client.tasks.AbstractSessionTask
changeTerminalDimensions, close, disconnect, doTask, getChannelFuture, getSession, isClosed
Methods inherited from class com.sshtools.client.tasks.Task
ofRunnable
Methods inherited from class com.sshtools.common.ssh.ConnectionAwareTask
getLastError, run
Methods inherited from class com.sshtools.common.ssh.AbstractRequestFuture
addFutureListener, done, isDone, isSuccess, waitFor, waitForever
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sshtools.common.ssh.RequestFuture
isDoneAndSuccess
-
Constructor Details
-
ShellTask
Deprecated.Construct a shell task. Deprecated since 3.1.0. Use aShellTask.ShellTaskBuilder
instead.- Parameters:
con
- connection- See Also:
-
ShellTask
Deprecated.Construct a shell task. Deprecated since 3.1.0. Use aShellTask.ShellTaskBuilder
instead.- Parameters:
ssh
- client- See Also:
-
-
Method Details
-
onOpenSession
@Deprecated(since="3.1.0") protected void onOpenSession(SessionChannelNG session) throws IOException, com.sshtools.common.ssh.SshException, ShellTimeoutException Deprecated.Deprecated for overriding, will be made final at 3.2.0.- Specified by:
onOpenSession
in classAbstractSessionTask<SessionChannelNG>
- Throws:
IOException
com.sshtools.common.ssh.SshException
ShellTimeoutException
-
closeOnTaskComplete
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
closeOnTaskComplete
in classAbstractSessionTask<SessionChannelNG>
-
beforeStartShell
Deprecated.Deprecated for overriding, will be made final at 3.2.0.- Overrides:
beforeStartShell
in classAbstractShellTask<SessionChannelNG>
-
onCloseSession
Deprecated.Deprecated for overriding, will be made final at 3.2.0.- Specified by:
onCloseSession
in classAbstractSessionTask<SessionChannelNG>
-
createSession
@Deprecated(since="3.1.0") protected SessionChannelNG createSession(com.sshtools.common.ssh.SshConnection con) Deprecated.Deprecated for overriding, will be made final at 3.2.0.- Specified by:
createSession
in classAbstractSessionTask<SessionChannelNG>
-