Class SwitchableJsonSwitchPreparation
Represents one completed source-switch preparation that can later be committed or aborted.
Implements
Inherited Members
Namespace: Eigenverft.NetLib.Infrastructure.Hosting.Configuration.SwitchableJson
Assembly: Eigenverft.NetLib.Infrastructure.dll
Syntax
public sealed class SwitchableJsonSwitchPreparation : IDisposable
Remarks
A preparation is bound to the provider state that existed when it was created. Commit rejects the preparation if that state changed in the meantime. Dispose aborts an uncommitted preparation and releases any prepared watcher resources. The object is single-use: after Commit or Abort it cannot be committed again.
Properties
| Edit this page View SourceCanCommit
Gets whether this preparation completed successfully and is eligible for Commit.
Declaration
public bool CanCommit { get; }
Property Value
| Type | Description |
|---|---|
| bool |
ConfigurationChanged
Gets whether the prepared candidate differs from the effective provider snapshot it was compared against.
Declaration
public bool ConfigurationChanged { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Exception
Gets the underlying prepare exception for rejected preparations, when available.
Declaration
public Exception? Exception { get; }
Property Value
| Type | Description |
|---|---|
| Exception |
FailureKind
Gets the classified prepare failure, or None.
Declaration
public SwitchableJsonFailureKind FailureKind { get; }
Property Value
| Type | Description |
|---|---|
| SwitchableJsonFailureKind |
Name
Gets the caller-defined provider identity.
Declaration
public string Name { get; }
Property Value
| Type | Description |
|---|---|
| string |
PreviousSourcePath
Gets the source path that was active when preparation started.
Declaration
public string PreviousSourcePath { get; }
Property Value
| Type | Description |
|---|---|
| string |
RequestedSourcePath
Gets the normalized candidate source path.
Declaration
public string RequestedSourcePath { get; }
Property Value
| Type | Description |
|---|---|
| string |
Status
Gets the completed prepare outcome.
Declaration
public SwitchableJsonPreparationStatus Status { get; }
Property Value
| Type | Description |
|---|---|
| SwitchableJsonPreparationStatus |
Timestamp
Gets the UTC timestamp at which preparation completed.
Declaration
public DateTimeOffset Timestamp { get; }
Property Value
| Type | Description |
|---|---|
| DateTimeOffset |
Methods
| Edit this page View SourceAbort()
Discards this preparation without changing the active provider state.
Declaration
public void Abort()
Remarks
Abort is idempotent and emits no lifecycle or IConfiguration reload signal.
Commit()
Atomically publishes this preparation if the provider still matches the state against which it was prepared.
Declaration
public SwitchableJsonSwitchResult Commit()
Returns
| Type | Description |
|---|---|
| SwitchableJsonSwitchResult | The completed source-switch result. |
Remarks
A stale preparation returns a rejected switch result with StalePreparation. Prepared Commit is intentionally result-driven and does not apply Throw; that policy remains part of the one-step TrySwitch API.
Dispose()
Aborts an uncommitted preparation.
Declaration
public void Dispose()