Class RemoteFileProducer<TOptions>

Assembly: redb.Route.GenericFile.dll

Base class for remote file producers (SFTP, FTP). Extends
with connection lifecycle management: auto-connect before write, reconnect on failure,
disconnect after write if configured.

public abstract class RemoteFileProducer<TOptions> : GenericFileProducer<TOptions>, IProducer, IProcessor where TOptions : RemoteFileEndpointOptions

Inheritance

Object→GenericFileProducer<TOptions>→RemoteFileProducer<TOptions>

Implements

Properties

RemoteOperations

Remote file operations with connection lifecycle.

protected IRemoteFileOperations RemoteOperations { get; }

Methods

BeforeWriteAsync(string, CancellationToken)

Connects to the remote server and auto-creates the target directory if configured.

protected override Task BeforeWriteAsync(string targetDir, CancellationToken ct)

DisconnectClient()

Safely disconnects from the remote server.

protected void DisconnectClient()

EnsureConnectedAsync(CancellationToken)

Ensures a connection is active, reconnecting with retry if necessary.

protected Task EnsureConnectedAsync(CancellationToken ct)

OnWriteCompletedAsync(IExchange, string, CancellationToken)

Disconnects from the remote server if the Disconnect option is set.

protected override Task OnWriteCompletedAsync(IExchange exchange, string targetPath, CancellationToken ct)

Stop(CancellationToken)

Stops the producer.

public override Task Stop(CancellationToken ct = default)

Constructors