Skip to content

IPluginRecords

Interface in Oadm.Sdk.Plugins · Oadm.Sdk.dll

Records of a plugin in the server database (ICorePluginContext.Records): named collections of JSON values by key, one table row per record. For data that grows with the devices (a record per device or certificate), where one IPluginSettings value would be rewritten whole on every change. A plugin sees only its own records.

public interface IPluginRecords

Extended or implemented by MemoryPluginRecords

Task ClearAsync(string collection, CancellationToken ct)

Deletes every record of collection.

Task<string?> GetAsync(string collection, string key, CancellationToken ct)

Default implementation

One record of collection: its JSON, or null when there is none of key. Reads only that record (default for other implementations: through IPluginRecords.ListAsync).

Task<IReadOnlyDictionary<string, string>> ListAsync(string collection, CancellationToken ct)

Every record of collection: key and JSON.

Task SetManyAsync(string collection, IReadOnlyCollection<KeyValuePair<string, string?>> records, CancellationToken ct)

Writes several records of collection in one transaction; a null value deletes its key. Keys: 1 to 255 characters; values: valid JSON.