37 lines
1.2 KiB
VB.net
37 lines
1.2 KiB
VB.net
Imports DigitalData.Modules.Database
|
|
Imports DigitalData.Modules.Logging
|
|
Imports ECM.JobRunner.Common
|
|
Imports Quartz
|
|
|
|
Namespace Scheduler.Jobs
|
|
Public Class BaseJob
|
|
Friend LogConfig As LogConfig
|
|
Friend Logger As Logger
|
|
Friend Database As MSSQLServer
|
|
Friend State As State
|
|
|
|
Private ctx As IJobExecutionContext
|
|
|
|
Public Function InitializeJob(context As IJobExecutionContext) As Dictionary(Of String, String)
|
|
ctx = context
|
|
|
|
Dim oJobData = context.MergedJobDataMap
|
|
LogConfig = oJobData.Item(Constants.Scheduler.JOB_CONFIG_LOGCONFIG)
|
|
Database = oJobData.Item(Constants.Scheduler.JOB_CONFIG_DATABASE)
|
|
State = oJobData.Item(Constants.Scheduler.JOB_CONFIG_STATE)
|
|
Logger = LogConfig.GetLogger()
|
|
|
|
State.JobStatus.Start(ctx)
|
|
Return oJobData.Item(Constants.Scheduler.JOB_CONFIG_ARGUMENTS)
|
|
End Function
|
|
|
|
Public Sub UpdateProgress(pCurrentValue As Integer, pTotalValue As Integer)
|
|
State.JobStatus.Update(ctx, pCurrentValue, pTotalValue)
|
|
End Sub
|
|
|
|
Public Sub CompleteJob()
|
|
State.JobStatus.Complete(ctx)
|
|
End Sub
|
|
End Class
|
|
|
|
End Namespace |