Table of Contents

Class SnapshotStorage

Namespace
JD.Domain.Snapshot
Assembly
JD.Domain.Snapshot.dll

Handles file system operations for domain snapshots.

public sealed class SnapshotStorage
Inheritance
SnapshotStorage
Inherited Members

Constructors

SnapshotStorage(SnapshotOptions?)

Initializes a new instance of the SnapshotStorage class.

public SnapshotStorage(SnapshotOptions? options = null)

Parameters

options SnapshotOptions

The snapshot options.

Methods

Delete(string, Version)

Deletes a snapshot.

public bool Delete(string name, Version version)

Parameters

name string

The domain name.

version Version

The domain version.

Returns

bool

True if the snapshot was deleted.

Exists(string, Version)

Checks if a snapshot exists.

public bool Exists(string name, Version version)

Parameters

name string

The domain name.

version Version

The domain version.

Returns

bool

True if the snapshot exists.

GetLatest(string)

Gets the latest snapshot for a domain.

public DomainSnapshot? GetLatest(string name)

Parameters

name string

The domain name.

Returns

DomainSnapshot

The latest snapshot, or null if none exist.

ListVersions(string)

Lists all snapshots for a domain.

public IReadOnlyList<Version> ListVersions(string name)

Parameters

name string

The domain name.

Returns

IReadOnlyList<Version>

The list of snapshot versions.

Load(string)

Loads a snapshot from a file.

public DomainSnapshot Load(string filePath)

Parameters

filePath string

The file path.

Returns

DomainSnapshot

The loaded snapshot.

Load(string, Version)

Loads a snapshot by domain name and version.

public DomainSnapshot Load(string name, Version version)

Parameters

name string

The domain name.

version Version

The domain version.

Returns

DomainSnapshot

The loaded snapshot.

Save(DomainManifest)

Saves a manifest as a snapshot.

public DomainSnapshot Save(DomainManifest manifest)

Parameters

manifest DomainManifest

The manifest to save.

Returns

DomainSnapshot

The created snapshot.

SaveSnapshot(DomainSnapshot)

Saves a snapshot to disk.

public string SaveSnapshot(DomainSnapshot snapshot)

Parameters

snapshot DomainSnapshot

The snapshot to save.

Returns

string

The file path where the snapshot was saved.