Package com.sshtools.client.tasks
Class CommandTask
- All Implemented Interfaces:
RequestFuture,Closeable,AutoCloseable,Runnable
Task for executing commands.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder forCommandTask.static interfaceFunctional interface for tasks run on certain command task 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 SessionChannelNGintprotected final voidonCloseSession(SessionChannelNG session) protected final voidonOpenSession(SessionChannelNG session) protected final voidsetupSession(SessionChannelNG session) Methods 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
-
onCloseSession
- Specified by:
onCloseSessionin classAbstractSessionTask<SessionChannelNG>
-
getExitCode
public int getExitCode() -
getCommand
-
createSession
- Specified by:
createSessionin classAbstractSessionTask<SessionChannelNG>
-
onOpenSession
- Specified by:
onOpenSessionin classAbstractSessionTask<SessionChannelNG>- Throws:
IOException
-
setupSession
- Specified by:
setupSessionin classAbstractSessionTask<SessionChannelNG>
-