Package com.sshtools.client.tasks
Class CommandTask
java.lang.Object
com.sshtools.common.ssh.AbstractRequestFuture
com.sshtools.common.ssh.ConnectionAwareTask
- All Implemented Interfaces:
com.sshtools.common.ssh.RequestFuture
,Closeable
,AutoCloseable
,Runnable
Task for executing commands.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builder forCommandTask
.static interface
Functional 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.AbstractCommandTask
EXIT_CODE_NOT_RECEIVED
Fields inherited from class com.sshtools.client.tasks.AbstractConnectionTask
clientSupplier
Fields inherited from class com.sshtools.common.ssh.ConnectionAwareTask
con, lastError
-
Method Summary
Modifier and TypeMethodDescriptionprotected final void
beforeExecuteCommand
(SessionChannelNG session) protected void
Deprecated, for removal: This API element is subject to removal in a future version.protected final SessionChannelNG
createSession
(com.sshtools.common.ssh.SshConnection con) final String
final int
protected final void
onCloseSession
(SessionChannelNG session) Deprecated, for removal: This API element is subject to removal in a future version.protected final void
onOpenSession
(SessionChannelNG session) Methods inherited from class com.sshtools.client.tasks.AbstractCommandTask
setupSession
Methods inherited from class com.sshtools.client.tasks.AbstractSessionTask
changeTerminalDimensions, close, disconnect, doTask, getChannelFuture, getSession, isClosed
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
-
Method Details
-
onCloseSession
@Deprecated(since="3.1.0", forRemoval=true) protected final void onCloseSession(SessionChannelNG session) Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
onCloseSession
in classAbstractCommandTask
-
getExitCode
public final int getExitCode()- Overrides:
getExitCode
in classAbstractCommandTask
-
getCommand
- Overrides:
getCommand
in classAbstractCommandTask
-
createSession
- Overrides:
createSession
in classAbstractCommandTask
-
closeOnTaskComplete
Deprecated, for removal: This API element is subject to removal in a future version.- Overrides:
closeOnTaskComplete
in classAbstractSessionTask<SessionChannelNG>
-
onOpenSession
- Specified by:
onOpenSession
in classAbstractSessionTask<SessionChannelNG>
- Throws:
IOException
-
beforeExecuteCommand
- Overrides:
beforeExecuteCommand
in classAbstractCommandTask
-