Click or drag to resize

IJobManagerService Interface

Job Management Service

Namespace:  SanteDB.Core.Jobs
Assembly:  SanteDB.Core.Api (in SanteDB.Core.Api.dll) Version: 2.2.1
Syntax
public interface IJobManagerService : IDaemonService, 
	IServiceImplementation

The IJobManagerService type exposes the following members.

Properties
  NameDescription
Public propertyIsRunning
Indicates whether the daemon service is running
(Inherited from IDaemonService.)
Public propertyJobs
Gets the status of all jobs
Public propertyServiceName
Gets the service name
(Inherited from IServiceImplementation.)
Top
Methods
  NameDescription
Public methodCode exampleAddJob(IJob, JobStartType)
Add a job to the execution manager
Public methodAddJob(IJob, TimeSpan, JobStartType) Obsolete.
Add a job to the job manager
Public methodGetJobInstance
Get this manager's instance of a job
Public methodGetJobSchedules
Get the schedule for the specified job
Public methodIsJobRegistered
Returns true if the job is registered
Public methodSetJobSchedule(IJob, TimeSpan)
Schedule a job to repeat on an interval
Public methodSetJobSchedule(IJob, DayOfWeek, DateTime)
Schedule a job to start at a specific time with a specific repetition
Public methodStart
Indicates the caller wishes to start the daemon service lifecycle
(Inherited from IDaemonService.)
Public methodStartJob(IJob, Object)
Starts the specified job
Public methodStartJob(Type, Object)
Start a job by registered type
Public methodStop
Indicates the caller wishes to stop the daemon service
(Inherited from IDaemonService.)
Top
Events
  NameDescription
Public eventStarted
Fired when the daemon service has completed it start procedure.
(Inherited from IDaemonService.)
Public eventStarting
Fired when the daemon service has commenced start but has not yet finished
(Inherited from IDaemonService.)
Public eventStopped
Fired when the daemon has completed its stop procedure
(Inherited from IDaemonService.)
Public eventStopping
Fired when the daemon service has commenced stop but has not yet been fully shut down.
(Inherited from IDaemonService.)
Top
Remarks

In SanteDB, developers can create IJob implementations which represent background jobs for the system. Uses of these classes involve:

  • Performing routine maintenance tasks like compression, backup, etc.
  • Performing indexing tasks or managing long-running tasks
  • Exposing packaged batch operations to users (who can run them manually from the UI)

The job manager is the service which manages the master list of IJob instances and allows other plugins to register new jobs, start jobs, and even schedule job execution based on a schedule or interval.

See Also