Class VersionMigrationResult
- Namespace
- Excalibur.Compliance
- Assembly
- Excalibur.Compliance.Abstractions.dll
Represents the result of a single migration operation.
public sealed record VersionMigrationResult : IEquatable<VersionMigrationResult>
- Inheritance
-
VersionMigrationResult
- Implements
- Inherited Members
Constructors
VersionMigrationResult(byte[], byte[]?, EncryptionVersion, EncryptionVersion, bool, string?, TimeSpan)
Represents the result of a single migration operation.
public VersionMigrationResult(byte[] OriginalCiphertext, byte[]? MigratedCiphertext, EncryptionVersion SourceVersion, EncryptionVersion TargetVersion, bool Success, string? ErrorMessage, TimeSpan Duration)
Parameters
OriginalCiphertextbyte[]The original ciphertext before migration.
MigratedCiphertextbyte[]The migrated ciphertext (null if migration failed).
SourceVersionEncryptionVersionThe source encryption version.
TargetVersionEncryptionVersionThe target encryption version.
SuccessboolWhether the migration succeeded.
ErrorMessagestringThe error message if migration failed.
DurationTimeSpanThe duration of the migration operation.
Properties
Duration
The duration of the migration operation.
public TimeSpan Duration { get; init; }
Property Value
ErrorMessage
The error message if migration failed.
public string? ErrorMessage { get; init; }
Property Value
MigratedCiphertext
The migrated ciphertext (null if migration failed).
public byte[]? MigratedCiphertext { get; init; }
Property Value
- byte[]
OriginalCiphertext
The original ciphertext before migration.
public byte[] OriginalCiphertext { get; init; }
Property Value
- byte[]
SourceVersion
The source encryption version.
public EncryptionVersion SourceVersion { get; init; }
Property Value
Success
Whether the migration succeeded.
public bool Success { get; init; }
Property Value
TargetVersion
The target encryption version.
public EncryptionVersion TargetVersion { get; init; }
Property Value
Methods
Failed(byte[], EncryptionVersion, EncryptionVersion, string, TimeSpan)
Creates a failed migration result.
public static VersionMigrationResult Failed(byte[] original, EncryptionVersion source, EncryptionVersion target, string error, TimeSpan duration)
Parameters
originalbyte[]sourceEncryptionVersiontargetEncryptionVersionerrorstringdurationTimeSpan
Returns
NotRequired(byte[], EncryptionVersion)
Creates a "no migration needed" result.
public static VersionMigrationResult NotRequired(byte[] original, EncryptionVersion version)
Parameters
originalbyte[]versionEncryptionVersion
Returns
Succeeded(byte[], byte[], EncryptionVersion, EncryptionVersion, TimeSpan)
Creates a successful migration result.
public static VersionMigrationResult Succeeded(byte[] original, byte[] migrated, EncryptionVersion source, EncryptionVersion target, TimeSpan duration)
Parameters
originalbyte[]migratedbyte[]sourceEncryptionVersiontargetEncryptionVersiondurationTimeSpan