Class AbstractSessionTask<T extends AbstractSessionChannel>

java.lang.Object
com.sshtools.common.ssh.AbstractRequestFuture
com.sshtools.common.ssh.ConnectionAwareTask
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
  • Constructor Details

    • AbstractSessionTask

      public AbstractSessionTask(AbstractSessionTask.AbstractSessionTaskBuilder<?,T,?> builder)
    • 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

      public T getSession()
    • disconnect

      public void disconnect()
    • getChannelFuture

      public com.sshtools.common.ssh.ChannelRequestFuture getChannelFuture()
    • doTask

      public void doTask()
      Specified by:
      doTask in class com.sshtools.common.ssh.ConnectionAwareTask
    • closeOnTaskComplete

      @Deprecated(since="3.1.0") protected void closeOnTaskComplete()
      Deprecated.
    • createSession

      protected abstract T createSession(com.sshtools.common.ssh.SshConnection con)
    • setupSession

      protected abstract void setupSession(T session)
    • onOpenSession

      protected abstract void onOpenSession(T session) throws IOException, com.sshtools.common.ssh.SshException, ShellTimeoutException
      Throws:
      IOException
      com.sshtools.common.ssh.SshException
      ShellTimeoutException
    • onCloseSession

      protected abstract void onCloseSession(T session)
    • close

      public final void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • isClosed

      public boolean isClosed()
    • changeTerminalDimensions

      public void changeTerminalDimensions(int cols, int rows, int width, int height)