Class BaseFileTransferFactory<T>
The file transfer class handles uploads and downloads
Inheritance
System.Object
BaseFileTransferFactory<T>
Implements
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 SourceBaseFileTransferFactory(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 SourceLogger
The logger
Declaration
protected readonly ILogger Logger
Field Value
Type | Description |
---|---|
ILogger |
Properties
| Improve this Doc View SourceKeys
Declaration
public Guid[] Keys { get; }
Property Value
Type | Description |
---|---|
System.Guid[] |
Methods
| Improve this Doc View SourceDoTransferAsync(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 |
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. |
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 |
GetFileTransferInformation(ICorrelationId)
Declaration
public T GetFileTransferInformation(ICorrelationId key)
Parameters
Type | Name | Description |
---|---|---|
ICorrelationId | key |
Returns
Type | Description |
---|---|
T |
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. |
Remove(T, Boolean)
Declaration
public void Remove(T fileTransferInformation, bool expiredOrCancelled)
Parameters
Type | Name | Description |
---|---|---|
T | fileTransferInformation | |
System.Boolean | expiredOrCancelled |