Skip to content

ICorePluginContext

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

What the server gives a core plugin in ICorePlugin.StartAsync.

public interface ICorePluginContext

Guide: Core plugins and pages

IDeviceAutoAdd? AutoAdd { get; }

Default implementation

Adds Axis devices the plugin saw on the network (DHCP leases) through the add page’s pipeline and follows managed devices to new addresses (IDeviceAutoAdd). Null when the host does not offer it.

string? DataDirectory { get; }

Default implementation

A private folder for the plugin’s working files (temporary downloads, built archives) inside the server’s data folder (<datafolder>/plugin-data/<plugin id>), created by the host on first use and protected like the data folder. The plugin cleans up what it writes. Null on hosts without one (use a folder of your own then).

IDeviceRepository Devices { get; }

Every managed device.

IEventPublisher? EventPublisher { get; }

Default implementation

Publishes the plugin’s events to the server’s event rules (the plugin implements IEventSource to declare them). Null when the host has no event rules or the plugin declares no events.

IDeviceEventStreams? EventStreams { get; }

Default implementation

Event streams of managed devices (RTSP metadata, opened by the server with the stored credentials, which never reach the plugin). Null when the host does not offer them.

IPluginEvents? Events { get; }

Default implementation

Live events for the plugin’s client page (ICorePluginClientContext.WatchEventsAsync). Null when the host cannot push events: the page then polls through InvokeAsync.

IFirewallRules? Firewall { get; }

Default implementation

The host firewall for the ports the plugin serves (NTP UDP 123, DHCP UDP 67): open the rule while the service is enabled, close it when disabled or stopped (FirewallRuleKeeper). Only offered by the Windows server running as the installed service; null elsewhere (Linux, macOS, console runs, tests).

ILogger Logger { get; }

The server log.

string? PluginDirectory { get; }

Default implementation

Folder the plugin was loaded from (plugin.json, assemblies, data files such as a command library). Null for plugins registered in code. Use it instead of Assembly.Location.

ISecretProtector? Secrets { get; }

Default implementation

Encrypts secrets the plugin stores in ICorePluginContext.Settings with the server’s master key (AES-256-GCM, like device passwords). Null when the host offers no protector: then do not store secrets.

IPluginSettings Settings { get; }

The plugin’s own settings in the server database.

ITaskRunner Tasks { get; }

Starts and cancels tasks, e.g. of a task plugin the core plugin contributes.

ITrustAnchors? TrustAnchors { get; }

Default implementation

Certificate authorities this plugin wants the server to trust when it rates device certificates (Trusted in the device grid). Null when the host does not support it.

IVapixClientFactory Vapix { get; }

Logged-in VAPIX clients for the managed devices.