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:
com.sshtools.common.ssh.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 class
AbstractSessionTask.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
clientSupplier
Fields inherited from class com.sshtools.common.ssh.ConnectionAwareTask
con, lastError
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractSessionTask
(SshClient ssh, com.sshtools.common.ssh.ChannelRequestFuture future) Deprecated.AbstractSessionTask
(com.sshtools.common.ssh.SshConnection con) AbstractSessionTask
(com.sshtools.common.ssh.SshConnection con, com.sshtools.common.ssh.ChannelRequestFuture future) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
changeTerminalDimensions
(int cols, int rows, int width, int height) final void
close()
protected void
Deprecated.protected abstract T
createSession
(com.sshtools.common.ssh.SshConnection con) void
void
doTask()
com.sshtools.common.ssh.ChannelRequestFuture
boolean
isClosed()
protected abstract void
onCloseSession
(T session) protected abstract void
onOpenSession
(T session) protected abstract void
setupSession
(T session) 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
-
AbstractSessionTask
-
AbstractSessionTask
@Deprecated public AbstractSessionTask(SshClient ssh, com.sshtools.common.ssh.ChannelRequestFuture future) Deprecated. -
AbstractSessionTask
@Deprecated public AbstractSessionTask(com.sshtools.common.ssh.SshConnection con, com.sshtools.common.ssh.ChannelRequestFuture future) Deprecated. -
AbstractSessionTask
public AbstractSessionTask(com.sshtools.common.ssh.SshConnection con)
-
-
Method Details
-
getSession
-
disconnect
public void disconnect() -
getChannelFuture
public com.sshtools.common.ssh.ChannelRequestFuture getChannelFuture() -
doTask
public void doTask()- Specified by:
doTask
in classcom.sshtools.common.ssh.ConnectionAwareTask
-
closeOnTaskComplete
Deprecated. -
createSession
-
setupSession
-
onOpenSession
protected abstract void onOpenSession(T session) throws IOException, com.sshtools.common.ssh.SshException, ShellTimeoutException - Throws:
IOException
com.sshtools.common.ssh.SshException
ShellTimeoutException
-
onCloseSession
-
close
public final void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
isClosed
public boolean isClosed() -
changeTerminalDimensions
public void changeTerminalDimensions(int cols, int rows, int width, int height)
-