ICorePluginContext
Interface in Oadm.Sdk.Plugins · Oadm.Sdk.dll
What the server gives a core plugin in ICorePlugin.StartAsync.
public interface ICorePluginContextGuide: Core plugins and pages
Properties
Section titled “Properties”AutoAdd
Section titled “AutoAdd”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.
DataDirectory
Section titled “DataDirectory”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).
Devices
Section titled “Devices”IDeviceRepository Devices { get; }Every managed device.
EventPublisher
Section titled “EventPublisher”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.
EventStreams
Section titled “EventStreams”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.
Events
Section titled “Events”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.
Firewall
Section titled “Firewall”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).
Logger
Section titled “Logger”ILogger Logger { get; }The server log.
PluginDirectory
Section titled “PluginDirectory”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.
Secrets
Section titled “Secrets”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.
Settings
Section titled “Settings”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.
TrustAnchors
Section titled “TrustAnchors”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.