Show / Hide Table of Contents

Class WatsonCrashSource

Processes XML data from Watson into a crash instance.

Inheritance
System.Object
WatsonCrashSource
Implements
ICrashSource
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: 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 Source

WatsonCrashSource(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 Source

AzureAttachmentFiles

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 Source

CreateAttachmentsFromXML(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.

View Source

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.

Implements

ICrashSource
  • View Source
In This Article
Back to top Generated by DocFX