Class BlobStorageFileTransferService
Implements the
Inheritance
Namespace: DNVGL.One.Compute.StorageLibrary.Azure.FileTransfer
Assembly: DNVGL.One.Compute.StorageLibrary.Azure.dll
Syntax
public class BlobStorageFileTransferService : IFileTransferService
Constructors
View SourceBlobStorageFileTransferService()
Initializes a new instance of the BlobStorageFileTransferService class.
Declaration
public BlobStorageFileTransferService()
BlobStorageFileTransferService(Boolean)
Initializes a new instance of the BlobStorageFileTransferService class.
Declaration
public BlobStorageFileTransferService(bool logToConsole)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | logToConsole | Set false to turn off default console logging. |
Remarks
The reason that the logToConsole
parameter is not specified as an optional parameter on the main constructor is that this would yield a runtime error
when trying to use that constructor in a MEF (worker host) context ("System.Composition.Hosting.CompositionFailedException : No importing constructor was found on type").
Properties
View SourceInitialRequestRetryIntervalSeconds
Gets or sets the initial retry interval in seconds.
Declaration
public int InitialRequestRetryIntervalSeconds { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The initial retry interval in seconds. |
MaxNumberOfRequestRetries
Gets or sets the maximum number of request retries.
Declaration
public int MaxNumberOfRequestRetries { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The maximum number of retries. |
MaxNumberOfUploadRetries
Gets or sets the maximum number of upload retries.
Declaration
public int MaxNumberOfUploadRetries { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The maximum number of upload retries. |
Remarks
This is used for both upload and download.
NumberOfUploadTasksPerCore
Gets or sets the number of upload tasks per core.
Declaration
public int NumberOfUploadTasksPerCore { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The number of upload tasks per core. |
ShouldOverwrite
Gets or sets a callback to control when a destination file should be overwritten. Default is to always overwrite.
Declaration
public Func<object, object, bool> ShouldOverwrite { get; set; }
Property Value
Type | Description |
---|---|
Func<System.Object, System.Object, System.Boolean> | The callback to determine whether a file should be overwritten. |
ShouldTransfer
Gets or sets a callback to control when a file should be transferred. The default is to always transfer.
Declaration
public Func<object, object, bool> ShouldTransfer { get; set; }
Property Value
Type | Description |
---|---|
Func<System.Object, System.Object, System.Boolean> | The callback to determine whether a file should be transferred. |
Remarks
This method could be used if the file selection is more complex than could be done by setting the selection and inclusion filters. The transfer logic is the following: selected and !excluded and ShouldTransfer.
Methods
View SourceDownloadFilesAsync(IEnumerable<FileTransferSpecification>)
Downloads the specified files asynchronously.
The
Declaration
public async Task<IEnumerable<FileTransferResult>> DownloadFilesAsync(IEnumerable<FileTransferSpecification> fileTransferSpecifications)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<FileTransferSpecification> | fileTransferSpecifications | The file transfer specifications. |
Returns
Type | Description |
---|---|
Task<IEnumerable<FileTransferResult>> | Results from each download. |
Remarks
If the
UploadFilesAsync(IEnumerable<FileTransferSpecification>)
Uploads the files from the local file system to BLOB storage asynchronously.
The
Declaration
public async Task<IEnumerable<FileTransferResult>> UploadFilesAsync(IEnumerable<FileTransferSpecification> fileTransferSpecifications)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<FileTransferSpecification> | fileTransferSpecifications | The file transfer specifications defining the files to be uploaded. |
Returns
Type | Description |
---|---|
Task<IEnumerable<FileTransferResult>> | A |
Remarks
If the
Events
View SourceFileFailed
Occurs when the transfer of a file fails.
Declaration
public event EventHandler<DataTransferEventArgs> FileFailed
Event Type
Type | Description |
---|---|
EventHandler<DataTransferEventArgs> |
FileSkipped
Occurs when the transfer of a file is skipped.
Declaration
public event EventHandler<DataTransferEventArgs> FileSkipped
Event Type
Type | Description |
---|---|
EventHandler<DataTransferEventArgs> |
FileTransferred
Occurs when a file has been successfully transferred.
Declaration
public event EventHandler<DataTransferEventArgs> FileTransferred
Event Type
Type | Description |
---|---|
EventHandler<DataTransferEventArgs> |