Package com.sshtools.client.tasks
Class AbstractSessionTask<T extends AbstractSessionChannel>
java.lang.Object
com.sshtools.common.ssh.AbstractRequestFuture
com.sshtools.common.ssh.ConnectionAwareTask
com.sshtools.client.tasks.Task
com.sshtools.client.tasks.AbstractConnectionTask
com.sshtools.client.tasks.AbstractSessionTask<T>
- All Implemented Interfaces:
RequestFuture,Closeable,AutoCloseable,Runnable
- Direct Known Subclasses:
AbstractCommandTask,AbstractShellTask
public abstract class AbstractSessionTask<T extends AbstractSessionChannel>
extends AbstractConnectionTask
implements Closeable
An abstract task for using the SSH session
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classAbstractSessionTask.AbstractSessionTaskBuilder<B extends AbstractSessionTask.AbstractSessionTaskBuilder<B,SC, TT>, SC extends AbstractSessionChannel, TT extends AbstractSessionTask<SC>> Builder forAbstractSessionTask.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
ConstructorsConstructorDescriptionAbstractSessionTask(SshClient ssh, ChannelRequestFuture future) Deprecated.AbstractSessionTask(SshConnection con, ChannelRequestFuture future) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeTerminalDimensions(int cols, int rows, int width, int height) final voidclose()protected voidDeprecated.protected abstract TvoidvoiddoTask()booleanisClosed()protected abstract voidonCloseSession(T session) protected abstract voidonOpenSession(T session) protected abstract voidsetupSession(T session) Methods 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
-
AbstractSessionTask
-
AbstractSessionTask
Deprecated. -
AbstractSessionTask
Deprecated. -
AbstractSessionTask
-
-
Method Details
-
getSession
-
disconnect
public void disconnect() -
getChannelFuture
-
doTask
public void doTask()- Specified by:
doTaskin classConnectionAwareTask
-
closeOnTaskComplete
Deprecated. -
createSession
-
setupSession
-
onOpenSession
protected abstract void onOpenSession(T session) throws IOException, SshException, ShellTimeoutException -
onCloseSession
-
close
public final void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
isClosed
public boolean isClosed() -
changeTerminalDimensions
public void changeTerminalDimensions(int cols, int rows, int width, int height)
-