Package com.sshtools.client.tasks
Class AbstractOptimisedTask<TARGET,LOCALFILE>
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.AbstractFileTask
com.sshtools.client.tasks.AbstractOptimisedTask<TARGET,LOCALFILE>
- All Implemented Interfaces:
com.sshtools.common.ssh.RequestFuture
,Runnable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
AbstractOptimisedTask.AbstractOptimisedTaskBuilder<B extends AbstractOptimisedTask.AbstractOptimisedTaskBuilder<B,
T, LOCALFILE>, T extends AbstractOptimisedTask<?, ?>, LOCALFILE> protected static class
static interface
Interface to be implemented by classes that monitor the progress of file transfers and output feedback.Nested classes/interfaces inherited from class com.sshtools.client.tasks.AbstractFileTask
AbstractFileTask.AbstractFileTaskBuilder<B extends AbstractFileTask.AbstractFileTaskBuilder<B,
T>, T extends AbstractConnectionTask> 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
FieldsModifier and TypeFieldDescriptionprotected final int
protected final int
protected final Function<LOCALFILE,
FileTransferProgress> protected final int
protected final LinkedList<SshClient>
protected final RemoteHash
protected final boolean
protected final int
protected final SftpClient
protected final Optional<AbstractOptimisedTask.ProgressMessages>
protected final boolean
protected final boolean
Fields inherited from class com.sshtools.client.tasks.AbstractFileTask
progress
Fields inherited from class com.sshtools.client.tasks.AbstractConnectionTask
clientSupplier
Fields inherited from class com.sshtools.common.ssh.ConnectionAwareTask
con, lastError
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
-
Method Summary
Modifier and TypeMethodDescriptionprotected final void
checkErrors
(Collection<Throwable> errors) protected final void
protected abstract TARGET
protected final void
displayMessage
(String message, Object... args) final void
doTask()
protected final void
printChunkMessages
(long chunkLength) protected abstract void
transferFiles
(TARGET targetFolder) protected final void
verboseMessage
(String message, Object... args) protected final void
verifyIntegrity
(Path localPath, String remotePath) Methods inherited from class com.sshtools.client.tasks.AbstractFileTask
doTaskUntilDone
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
-
Field Details
-
chunks
protected final int chunks -
blocksize
protected final int blocksize -
buffersize
protected final int buffersize -
outstandingRequests
protected final int outstandingRequests -
verifyIntegrity
protected final boolean verifyIntegrity -
digest
-
ignoreIntegrity
protected final boolean ignoreIntegrity -
-
progressMessages
-
chunkProgress
-
clients
-
verboseOutput
protected final boolean verboseOutput
-
-
Constructor Details
-
AbstractOptimisedTask
protected AbstractOptimisedTask(AbstractOptimisedTask.AbstractOptimisedTaskBuilder<?, ?, LOCALFILE> builder)
-
-
Method Details
-
doTask
public final void doTask()- Specified by:
doTask
in classcom.sshtools.common.ssh.ConnectionAwareTask
-
transferFiles
protected abstract void transferFiles(TARGET targetFolder) throws com.sshtools.common.sftp.SftpStatusException, com.sshtools.common.ssh.SshException, TransferCancelledException, IOException, com.sshtools.common.permissions.PermissionDeniedException, com.sshtools.common.ssh.ChannelOpenException - Throws:
com.sshtools.common.sftp.SftpStatusException
com.sshtools.common.ssh.SshException
TransferCancelledException
IOException
com.sshtools.common.permissions.PermissionDeniedException
com.sshtools.common.ssh.ChannelOpenException
-
displayMessage
-
verboseMessage
-
configureConnections
protected final void configureConnections() throws IOException, com.sshtools.common.ssh.SshException- Throws:
IOException
com.sshtools.common.ssh.SshException
-
configureTargetFolder
protected abstract TARGET configureTargetFolder() throws IOException, com.sshtools.common.ssh.SshException, com.sshtools.common.permissions.PermissionDeniedException, com.sshtools.common.sftp.SftpStatusException- Throws:
IOException
com.sshtools.common.ssh.SshException
com.sshtools.common.permissions.PermissionDeniedException
com.sshtools.common.sftp.SftpStatusException
-
checkErrors
protected final void checkErrors(Collection<Throwable> errors) throws IOException, TransferCancelledException -
printChunkMessages
protected final void printChunkMessages(long chunkLength) -
verifyIntegrity
protected final void verifyIntegrity(Path localPath, String remotePath) throws com.sshtools.common.ssh.SshException, com.sshtools.common.sftp.SftpStatusException, IOException, com.sshtools.common.permissions.PermissionDeniedException - Throws:
com.sshtools.common.ssh.SshException
com.sshtools.common.sftp.SftpStatusException
IOException
com.sshtools.common.permissions.PermissionDeniedException
-