Projektdateien hinzufügen.
This commit is contained in:
21
ECM.JobRunner.Windows/Scheduler/Jobs/BaseJob.vb
Normal file
21
ECM.JobRunner.Windows/Scheduler/Jobs/BaseJob.vb
Normal file
@@ -0,0 +1,21 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports Quartz
|
||||
|
||||
Namespace Scheduler.Jobs
|
||||
Public Class BaseJob
|
||||
Friend LogConfig As LogConfig
|
||||
Friend Logger As Logger
|
||||
Friend Database As MSSQLServer
|
||||
|
||||
Public Function InitializeJob(context As IJobExecutionContext) As Dictionary(Of String, String)
|
||||
Dim oJobData = context.MergedJobDataMap
|
||||
LogConfig = oJobData.Item(Constants.Scheduler.JOB_CONFIG_LOGCONFIG)
|
||||
Database = oJobData.Item(Constants.Scheduler.JOB_CONFIG_DATABASE)
|
||||
Logger = LogConfig.GetLogger()
|
||||
|
||||
Return oJobData.Item(Constants.Scheduler.JOB_CONFIG_ARGUMENTS)
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
25
ECM.JobRunner.Windows/Scheduler/Jobs/DebugJob.vb
Normal file
25
ECM.JobRunner.Windows/Scheduler/Jobs/DebugJob.vb
Normal file
@@ -0,0 +1,25 @@
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports Quartz
|
||||
|
||||
Namespace Scheduler.Jobs
|
||||
Public Class DebugJob
|
||||
Inherits BaseJob
|
||||
Implements IJob
|
||||
|
||||
Private Function IJob_Execute(context As IJobExecutionContext) As Task Implements IJob.Execute
|
||||
Dim oArgs = MyBase.InitializeJob(context)
|
||||
Dim oArg1 = oArgs.Item("Arg1")
|
||||
|
||||
Logger.Info("I'm a debug Job!")
|
||||
Logger.Info("Arg1: [{0}]", oArg1)
|
||||
|
||||
Dim oResult = New JobResult() With {
|
||||
.Description = $"I'm a debug job and my result was [{Guid.NewGuid}]."
|
||||
}
|
||||
|
||||
context.Result = oResult
|
||||
|
||||
Return Task.FromResult(True)
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
26
ECM.JobRunner.Windows/Scheduler/Jobs/FileImportJob.vb
Normal file
26
ECM.JobRunner.Windows/Scheduler/Jobs/FileImportJob.vb
Normal file
@@ -0,0 +1,26 @@
|
||||
Imports ECM.JobRunner.Windows.Scheduler.Jobs
|
||||
Imports Quartz
|
||||
|
||||
|
||||
Namespace Scheduler.Jobs
|
||||
Public Class FileImportJob
|
||||
Inherits BaseJob
|
||||
Implements IJob
|
||||
|
||||
Public Function Execute(context As IJobExecutionContext) As Task Implements IJob.Execute
|
||||
Dim oArgs = MyBase.InitializeJob(context)
|
||||
Dim oName = oArgs.Item("Name")
|
||||
|
||||
Logger.Info("Running File Import [{0}]", oName)
|
||||
|
||||
Dim oResult = New JobResult() With {
|
||||
.Description = $"File Import Job [{oName}] completed!"
|
||||
}
|
||||
|
||||
context.Result = oResult
|
||||
|
||||
Return Task.FromResult(True)
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
24
ECM.JobRunner.Windows/Scheduler/Jobs/FileIndexJob.vb
Normal file
24
ECM.JobRunner.Windows/Scheduler/Jobs/FileIndexJob.vb
Normal file
@@ -0,0 +1,24 @@
|
||||
Imports ECM.JobRunner.Windows.Scheduler.Jobs
|
||||
Imports Quartz
|
||||
|
||||
Namespace Scheduler.Jobs
|
||||
Public Class FileIndexJob
|
||||
Inherits BaseJob
|
||||
Implements IJob
|
||||
|
||||
Public Function Execute(context As IJobExecutionContext) As Task Implements IJob.Execute
|
||||
Dim oArgs = MyBase.InitializeJob(context)
|
||||
Dim oName = oArgs.Item("Name")
|
||||
|
||||
Logger.Info("Running File Index [{0}]", oName)
|
||||
|
||||
Dim oResult = New JobResult() With {
|
||||
.Description = $"File Index Job [{oName}] completed!"
|
||||
}
|
||||
|
||||
context.Result = oResult
|
||||
|
||||
Return Task.FromResult(True)
|
||||
End Function
|
||||
End Class
|
||||
End Namespace
|
||||
Reference in New Issue
Block a user