public abstract class AbstractSessionTask<T extends AbstractSessionChannel> extends Task
Constructor and Description |
---|
AbstractSessionTask(SshClient ssh,
com.sshtools.common.ssh.ChannelRequestFuture future) |
AbstractSessionTask(com.sshtools.common.ssh.SshConnection con) |
AbstractSessionTask(com.sshtools.common.ssh.SshConnection con,
com.sshtools.common.ssh.ChannelRequestFuture future) |
Modifier and Type | Method and Description |
---|---|
void |
changeTerminalDimensions(int cols,
int rows,
int width,
int height) |
void |
close() |
protected abstract T |
createSession(com.sshtools.common.ssh.SshConnection con) |
void |
disconnect() |
void |
doTask() |
com.sshtools.common.ssh.ChannelRequestFuture |
getChannelFuture() |
java.lang.Throwable |
getLastError() |
T |
getSession() |
boolean |
isClosed() |
protected abstract void |
onCloseSession(T session) |
protected abstract void |
onOpenSession(T session) |
protected abstract void |
setupSession(T session) |
addFutureListener, done, isDone, isSuccess, waitFor, waitForever
public AbstractSessionTask(SshClient ssh, com.sshtools.common.ssh.ChannelRequestFuture future)
public AbstractSessionTask(com.sshtools.common.ssh.SshConnection con, com.sshtools.common.ssh.ChannelRequestFuture future)
public AbstractSessionTask(com.sshtools.common.ssh.SshConnection con)
public T getSession()
public void disconnect()
public final java.lang.Throwable getLastError()
getLastError
in class com.sshtools.common.ssh.ConnectionAwareTask
public com.sshtools.common.ssh.ChannelRequestFuture getChannelFuture()
public void doTask()
doTask
in class com.sshtools.common.ssh.ConnectionAwareTask
protected abstract T createSession(com.sshtools.common.ssh.SshConnection con)
protected abstract void setupSession(T session)
protected abstract void onOpenSession(T session) throws java.io.IOException, com.sshtools.common.ssh.SshException, ShellTimeoutException
java.io.IOException
com.sshtools.common.ssh.SshException
ShellTimeoutException
protected abstract void onCloseSession(T session)
public void close()
public boolean isClosed()
public void changeTerminalDimensions(int cols, int rows, int width, int height)
Copyright © 2024. All rights reserved.