Skip to content

IDeviceScopes

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

The device groups as a plugin sees them (ICorePluginContext.DeviceScopes, SDK 0.4.0), for objects a plugin keeps for a group (dashboards, device triggers, saved views: stored with ICallContext.DeviceScopeKey of the user who made them). Background work of such an object uses only the devices of its owner, and a deleted group’s objects are off (fail closed) until an administrator gives them another owner.

public interface IDeviceScopes

Guide: Device groups and the call context

bool Contains(string scopeKey, IDeviceInfo device)

True when device is in the devices of scopeKey (false for a deleted group).

bool Contains(string scopeKey, Guid deviceId)

Default implementation

True when the device with deviceId is managed and in the devices of scopeKey now (a few hash lookups, no request; SDK 0.4.0): for state kept per scope whose rows hold only the device id, e.g. the counts a sweep publishes. Fail closed: the default and a host that cannot tell answer false.

IDeviceRepository Devices(string scopeKey)

The devices of scopeKey (none for a deleted group).

bool Exists(string scopeKey)

True for ICallContext.AllDevicesScopeKey and for the key of a group that exists; false for a deleted group.

bool InAnyGroup(IDeviceInfo device)

Default implementation

True when any device group covers device (a user limited to a group can reach it). Fail closed: the default and a host that cannot tell answer true.

string? NameOf(string scopeKey)

The display name of a scope (“All devices” or the group’s name); null for a deleted group.

event EventHandler<string>? Changed

Raised (without a caller) with the key of a group whose rules changed or that was deleted.