Class MigrationManifestSerializer
Provides functionality to serialize and deserialize migration manifests in JSON format.
Namespace: Tableau.Migration.Engine.Manifest
Assembly: Tableau.Migration.dll
Syntax
public class MigrationManifestSerializer
Constructors
MigrationManifestSerializer(IFileSystem, ISharedResourcesLocalizer, ILoggerFactory)
Initializes a new instance of the MigrationManifestSerializer class.
Declaration
public MigrationManifestSerializer(IFileSystem fileSystem, ISharedResourcesLocalizer localizer, ILoggerFactory loggerFactory)
Parameters
Type | Name | Description |
---|---|---|
IFileSystem | fileSystem | |
ISharedResourcesLocalizer | localizer | |
ILoggerFactory | loggerFactory |
Fields
SupportedManifestVersion
This is the current MigrationManifest.ManifestVersion that this serializer supports.
Declaration
public const uint SupportedManifestVersion = 4
Field Value
Type | Description |
---|---|
uint |
Methods
LoadAsync(string, CancellationToken, JsonSerializerOptions?)
Loads a manifest from JSON format.
Declaration
public Task<MigrationManifest?> LoadAsync(string path, CancellationToken cancel, JsonSerializerOptions? jsonOptions = null)
Parameters
Type | Name | Description |
---|---|---|
string | path | The file path to load the manifest from. |
CancellationToken | cancel | The cancellation token to obey. |
JsonSerializerOptions | jsonOptions | Optional JSON options to use. |
Returns
Type | Description |
---|---|
Task<MigrationManifest> | The loaded MigrationManifest, or null if the manifest could not be loaded. |
SaveAsync(IMigrationManifest, string, JsonSerializerOptions?)
Saves a manifest in JSON format.
Declaration
public Task SaveAsync(IMigrationManifest manifest, string path, JsonSerializerOptions? jsonOptions = null)
Parameters
Type | Name | Description |
---|---|---|
IMigrationManifest | manifest | The manifest to save. |
string | path | The file path to save the manifest to. |
JsonSerializerOptions | jsonOptions | Optional JSON options to use. |
Returns
Type | Description |
---|---|
Task |
Remarks
This async function does not take a cancellation token. This is because the saving should happen, no matter what the status of the cancellation token is. Otherwise the manifest is not saved if the migration is cancelled.