Show / Hide Table of Contents

    Class BaseFileTransferFactory<T>

    The file transfer class handles uploads and downloads

    Inheritance
    System.Object
    BaseFileTransferFactory<T>
    DownloadFileTransferFactory
    UploadFileTransferFactory
    Implements
    IFileTransferFactory<T>
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Catalyst.Core.Lib.FileTransfer
    Assembly: Catalyst.Core.Lib.dll
    Syntax
    public abstract class BaseFileTransferFactory<T> : IFileTransferFactory<T> where T : IFileTransferInformation
    Type Parameters
    Name Description
    T

    Constructors

    | Improve this Doc View Source

    BaseFileTransferFactory(ILogger)

    Initializes a new instance of the BaseFileTransferFactory<T> class.

    Declaration
    protected BaseFileTransferFactory(ILogger logger)
    Parameters
    Type Name Description
    ILogger logger

    Fields

    | Improve this Doc View Source

    Logger

    The logger

    Declaration
    protected readonly ILogger Logger
    Field Value
    Type Description
    ILogger

    Properties

    | Improve this Doc View Source

    Keys

    Declaration
    public Guid[] Keys { get; }
    Property Value
    Type Description
    System.Guid[]

    Methods

    | Improve this Doc View Source

    DoTransferAsync(T)

    Does the transfer.

    Declaration
    protected abstract Task DoTransferAsync(T fileTransferInformation)
    Parameters
    Type Name Description
    T fileTransferInformation

    The file transfer information.

    Returns
    Type Description
    System.Threading.Tasks.Task
    | Improve this Doc View Source

    EnsureKeyExists(ICorrelationId)

    Ensures the key exists.

    Declaration
    protected bool EnsureKeyExists(ICorrelationId guid)
    Parameters
    Type Name Description
    ICorrelationId guid

    The unique identifier.

    Returns
    Type Description
    System.Boolean
    Exceptions
    Type Condition
    System.InvalidOperationException

    The specified key does not exist inside the factory.

    | Improve this Doc View Source

    FileTransferAsync(ICorrelationId, CancellationToken)

    Files the transfer asynchronous.

    Declaration
    public Task FileTransferAsync(ICorrelationId correlationGuid, CancellationToken cancellationToken)
    Parameters
    Type Name Description
    ICorrelationId correlationGuid

    The correlation unique identifier.

    System.Threading.CancellationToken cancellationToken

    The cancellation token.

    Returns
    Type Description
    System.Threading.Tasks.Task
    Exceptions
    Type Condition
    System.NullReferenceException

    File transfer has not been registered to factory

    System.InvalidOperationException

    File transfer has already been initialised

    | Improve this Doc View Source

    GetFileTransferInformation(ICorrelationId)

    Declaration
    public T GetFileTransferInformation(ICorrelationId key)
    Parameters
    Type Name Description
    ICorrelationId key
    Returns
    Type Description
    T
    | Improve this Doc View Source

    RegisterTransfer(T)

    Registers the transfer.

    Declaration
    public FileTransferResponseCodeTypes RegisterTransfer(T fileTransferInformation)
    Parameters
    Type Name Description
    T fileTransferInformation

    The file transfer information.

    Returns
    Type Description
    FileTransferResponseCodeTypes

    Initialization response code.

    Exceptions
    Type Condition
    System.InvalidOperationException

    This instance cannot be registered to the factory due to IsDownload flag.

    | Improve this Doc View Source

    Remove(T, Boolean)

    Declaration
    public void Remove(T fileTransferInformation, bool expiredOrCancelled)
    Parameters
    Type Name Description
    T fileTransferInformation
    System.Boolean expiredOrCancelled

    Implements

    IFileTransferFactory<T>
    • Improve this Doc
    • View Source
    Back to top Copyright © 2019 Catalyst Network