Class AbstractOptimisedTask.AbstractOptimisedTaskBuilder<B extends AbstractOptimisedTask.AbstractOptimisedTaskBuilder<B,T,LOCALFILE>,T extends AbstractOptimisedTask<?,?>,LOCALFILE>

Direct Known Subclasses:
PullTask.PullTaskBuilder, PushTask.PushTaskBuilder
Enclosing class:
AbstractOptimisedTask<TARGET,LOCALFILE>

public abstract static class AbstractOptimisedTask.AbstractOptimisedTaskBuilder<B extends AbstractOptimisedTask.AbstractOptimisedTaskBuilder<B,T,LOCALFILE>,T extends AbstractOptimisedTask<?,?>,LOCALFILE> extends AbstractFileTask.AbstractFileTaskBuilder<B,T>
  • Constructor Details

    • AbstractOptimisedTaskBuilder

      protected AbstractOptimisedTaskBuilder()
  • Method Details

    • withProgressMessages

      public final B withProgressMessages(AbstractOptimisedTask.ProgressMessages progressMessages)
      Set the AbstractOptimisedTask.ProgressMessages callback to receive various progress message, it does not receive the actual amount of progress. See {@link
      Parameters:
      progressMessages - progressMessages
      Returns:
      builder for chaining
    • withChunkProgress

      public final B withChunkProgress(Function<LOCALFILE,FileTransferProgress> chunkProgress)
      Set a Function that can create FileTransferProgress instances given a AbstractFile. Each FileTransferProgress monitors a Chunk, which will either be a complete file, or a portion of it. So if the function is called multiple times with the same AbstractFile, each call should create a new instance per chunk. Once created, FileTransferProgress.started(long, String) may be called multiple times if multiple paths are being transferred.
      Parameters:
      chunkProgress - chunk transfer progress monitor
      Returns:
      builder for chaining
    • withPrimarySftpClient

      public final B withPrimarySftpClient(SftpClient primarySftpClient)
      Set an SftpClient to use instead of creating a new one. Note, this is only used for the primary SFTP connection, others will always be created internally for chunked transfers.
      Parameters:
      primarySftpClient - SFTP client
      Returns:
      builder for chaining
    • withChunks

      public final B withChunks(int chunks)
      Set how many chunks to split any paths into for transfer.
      Parameters:
      chunks -
      Returns:
      builder for chaining
    • withBufferSize

      public final B withBufferSize(int buffersize)
      The size of the buffer used to pre-read the file during upload. Defaults to 1MB.
      Parameters:
      buffersize -
      Returns:
    • withVerifyIntegrity

      public final B withVerifyIntegrity()
      The integrity of any paths transferred will be verified using the configured digest (see withDigest(RemoteHash). If verification fails, an exception will be thrown during transfer.
      Returns:
      builder for chaining
    • withIntegrityVerification

      public final B withIntegrityVerification(boolean verifyIntegrity)
      Set whether to verify the integrity of any paths transferred using the configured digest (see withDigest(RemoteHash). If verification fails, an exception will be thrown during transfer.
      Parameters:
      verifyIntegrity - integrity verification
      Returns:
      builder for chaining
    • withIgnoreIntegrity

      public final B withIgnoreIntegrity()
      Only warn about integrity checks, do not fail entirely.
      Returns:
      builder for chaining
    • withIgnoreIntegrity

      public final B withIgnoreIntegrity(boolean ignoreIntegrity)
      Only warn about integrity checks, do not fail entirely.
      Parameters:
      ignoreIntegrity - ignore integrity
      Returns:
      builder for chaining
    • withDigest

      public final B withDigest(RemoteHash digest)
      The message digest algorithm to use for integrity checks (see withVerifyIntegrity()).
      Parameters:
      digest - digest
      Returns:
      builder for chaining
    • withBlocksize

      public final B withBlocksize(int blocksize)
      The SFTP block size to use in SFTP operations. The default is 32k which is generally the optimal amount but can be changed for experimentation. The API will also optimise the block size and change your value at runtime if it detects it would cause SFTP packages to be fragmented across multiple data packets causing performance issues. The minimum block size supported is 4096 bytes and the maximum size supported is 65535 bytes.
      Parameters:
      blocksize -
      Returns:
      builder for chaining
    • withAsyncRequests

      public final B withAsyncRequests(int outstandingRequest)
      The number of SFTP messages to send asynchronously before checking for server responses. Sending messages asynchronously increases performance and the API will generally configure this to it's own optimal setting based on remote window space and block size. Use this to experiment with various settings on your own network.
      Parameters:
      outstandingRequest -
      Returns:
      builder for chaining
    • withVerboseOutput

      public final B withVerboseOutput()
      Output verbose information about the operation.
      Returns:
      builder for chaining
    • withVerboseOutput

      public final B withVerboseOutput(boolean verboseOutput)
      Output verbose information about the operation.
      Returns:
      builder for chaining