IPluginJobs
Interface in Oadm.Sdk.Plugins · Oadm.Sdk.dll
Work a plugin method starts for a user (a report, a scan, an export, a monitor), owned by the user who started it (ICorePluginContext.Jobs, SDK 0.4.0). The host runs it without the caller (background), keeps the owner’s call for its devices, and answers ids of another user like unknown ids, so every id-taking method and download looks the job up through IPluginJobs.Find.
public interface IPluginJobsGuide: Device groups and the call context
Methods
Section titled “Methods”IPluginJob? Find(ICallContext caller, string jobId)The job with jobId when it belongs to caller (the user and session that started it, or any user of its device scope for a shared job), else null (also for unknown ids).
IReadOnlyList<IPluginJob> List(ICallContext caller)The jobs caller may see (see IPluginJobs.Find), newest first.
IPluginJob Start(ICallContext owner, string kind, Func<IPluginJob, CancellationToken, Task> work)Starts work for owner outside the call. The work reaches devices through IPluginJob.Owner (the owner’s view, also after the call ended) and stops when its token is cancelled (IPluginJob.Cancel, the plugin stopping). Returns the job; send its IPluginJob.Id to the page.
Parameters
owner: The call that starts the job.kind: The plugin’s name for the kind of work (“report”, “scan”, “export”).work: The work; exceptions end the job (logged), never the plugin.
StartShared
Section titled “StartShared”IPluginJob StartShared(ICallContext owner, string kind, Func<IPluginJob, CancellationToken, Task> work)Default implementation
Like IPluginJobs.Start, for work kept once per device scope (one scan of a group’s devices): every user with the owner’s ICallContext.DeviceScopeKey finds, follows and cancels the job through IPluginJobs.Find and IPluginJobs.List. It still runs with the owner’s call and ends like the owner’s other jobs (other devices, another role, the session ended). SDK 0.4.0; the default (older hosts) is IPluginJobs.Start: only the owner finds it.