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 -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidbeforeStartShell(SessionChannelNG session) protected final SessionChannelNGprotected final voidonCloseSession(SessionChannelNG session) protected final voidonOpenSession(SessionChannelNG session) 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
-
Method Details
-
onOpenSession
protected final void onOpenSession(SessionChannelNG session) throws IOException, SshException, ShellTimeoutException - Specified by:
onOpenSessionin classAbstractSessionTask<SessionChannelNG>- Throws:
IOExceptionSshExceptionShellTimeoutException
-
beforeStartShell
- Overrides:
beforeStartShellin classAbstractShellTask<SessionChannelNG>
-
onCloseSession
- Specified by:
onCloseSessionin classAbstractSessionTask<SessionChannelNG>
-
createSession
- Specified by:
createSessionin classAbstractSessionTask<SessionChannelNG>
-