Package com.sshtools.client.tasks
Class ShellTask
- All Implemented Interfaces:
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 classBuilder forShellTask.static interfaceFunctional 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
clientSupplierFields inherited from class com.sshtools.common.ssh.ConnectionAwareTask
con, lastError -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbeforeStartShell(SessionChannelNG session) Deprecated.protected voidDeprecated, for removal: This API element is subject to removal in a future version.protected SessionChannelNGDeprecated.protected voidonCloseSession(SessionChannelNG session) Deprecated.protected voidonOpenSession(SessionChannelNG session) Deprecated.Methods inherited from class com.sshtools.client.tasks.AbstractShellTask
setupSessionMethods inherited from class com.sshtools.client.tasks.AbstractSessionTask
changeTerminalDimensions, close, disconnect, doTask, getChannelFuture, getSession, isClosedMethods inherited from class com.sshtools.client.tasks.Task
ofRunnableMethods inherited from class com.sshtools.common.ssh.ConnectionAwareTask
getLastError, runMethods inherited from class com.sshtools.common.ssh.AbstractRequestFuture
addFutureListener, done, isDone, isSuccess, waitFor, waitForeverMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.sshtools.common.ssh.RequestFuture
isDoneAndSuccess
-
Constructor Details
-
ShellTask
Deprecated.Construct a shell task. Deprecated since 3.1.0. Use aShellTask.ShellTaskBuilderinstead.- Parameters:
con- connection- See Also:
-
ShellTask
Deprecated.Construct a shell task. Deprecated since 3.1.0. Use aShellTask.ShellTaskBuilderinstead.- Parameters:
ssh- client- See Also:
-
-
Method Details
-
onOpenSession
@Deprecated(since="3.1.0") protected void onOpenSession(SessionChannelNG session) throws IOException, SshException, ShellTimeoutException Deprecated.Deprecated for overriding, will be made final at 3.2.0.- Specified by:
onOpenSessionin classAbstractSessionTask<SessionChannelNG>- Throws:
IOExceptionSshExceptionShellTimeoutException
-
closeOnTaskComplete
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
closeOnTaskCompletein classAbstractSessionTask<SessionChannelNG>
-
beforeStartShell
Deprecated.Deprecated for overriding, will be made final at 3.2.0.- Overrides:
beforeStartShellin classAbstractShellTask<SessionChannelNG>
-
onCloseSession
Deprecated.Deprecated for overriding, will be made final at 3.2.0.- Specified by:
onCloseSessionin classAbstractSessionTask<SessionChannelNG>
-
createSession
Deprecated.Deprecated for overriding, will be made final at 3.2.0.- Specified by:
createSessionin classAbstractSessionTask<SessionChannelNG>
-