Class WatsonCrashSource
Processes XML data from Watson into a crash instance.
Inheritance
Implements
Inherited Members
Namespace: CrashCABN.CrashSources
Assembly: CrashCABN.CrashSources.Watson.dll
Syntax
public class WatsonCrashSource : ICrashSource
Remarks
This class consolidates code from IngestionHelper and WatsonHelper. It assumes the V1 Core Ingestion code was run prior to execution.
Constructors
View SourceWatsonCrashSource(Uri, IAzureBlobProvider, ITitleMappingDal, ILogger<WatsonCrashSource>)
Initializes a new instance of the WatsonCrashSource class.
Declaration
public WatsonCrashSource(Uri analysisUri, IAzureBlobProvider azureBlobProvider, ITitleMappingDal titleMapping, ILogger<WatsonCrashSource> logger)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | analysisUri | The analysis URI provided by Watson. |
IAzureBlobProvider | azureBlobProvider | The azure blob provider to use. |
ITitleMappingDal | titleMapping | |
ILogger<WatsonCrashSource> | logger |
Properties
View SourceAzureAttachmentFiles
Gets an array of attachment file names which may have been uploaded to Azure already by CrashCABN's core ingestion.
Declaration
public static IEnumerable<string> AzureAttachmentFiles { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<System.String> |
Methods
View SourceCreateAttachmentsFromXML(String, Uri, IAzureBlobProvider)
Creates the Watson analysis attachments from an XML string.
Declaration
public static async ValueTask<(WatsonParser.Analysis Analysis, IReadOnlyCollection<AttachmentInfo> Attachments)> CreateAttachmentsFromXML(string analysisXml, Uri attachmentPath = null, IAzureBlobProvider azureBlobProvider = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | analysisXml | The Watson Analysis XML contents. |
System.Uri | attachmentPath | The URI to the storage path containing extracted Watson analysis files. |
IAzureBlobProvider | azureBlobProvider | The interface to access Azure blob storage paths. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.ValueTuple<WatsonParser.Analysis, System.Collections.Generic.IReadOnlyCollection<AttachmentInfo>>> | The parsed Watson analysis and an attachment collection. |
LoadCrashAsync()
Loads the specific crash instance from the source.
Declaration
public async Task<CrashInstance> LoadCrashAsync()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<CrashInstance> | A crash instance. |