work on jobrunner
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
Public Class ADSyncArgs
|
||||
Inherits JobArgs
|
||||
|
||||
Public RootPath As String
|
||||
End Class
|
||||
|
||||
@@ -1,9 +1,32 @@
|
||||
Imports DigitalData.Modules.Jobs
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Interfaces
|
||||
Imports DigitalData.Modules.Jobs
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class ADSyncJob
|
||||
Inherits JobBase
|
||||
Implements IJob(Of ADSyncArgs)
|
||||
|
||||
Private _ADSync As ActiveDirectoryInterface
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Firebird As Firebird)
|
||||
MyBase.New(LogConfig, Firebird)
|
||||
End Sub
|
||||
|
||||
Public Sub Start(Arguments As ADSyncArgs) Implements IJob(Of ADSyncArgs).Start
|
||||
_ADSync = New ActiveDirectoryInterface(_LogConfig, _Firebird, Arguments.RootPath)
|
||||
|
||||
'TODO: Do AD Sync!
|
||||
|
||||
If _ADSync.Authenticate() = False Then
|
||||
_Logger.Warn("Job could not be completed! Authentication failed!")
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function ShouldStart(Arguments As ADSyncArgs) As Boolean Implements IJob(Of ADSyncArgs).ShouldStart
|
||||
Return Arguments.Enabled
|
||||
End Function
|
||||
End Class
|
||||
|
||||
4
Jobs/JobArgs.vb
Normal file
4
Jobs/JobArgs.vb
Normal file
@@ -0,0 +1,4 @@
|
||||
Public Class JobArgs
|
||||
Public Enabled As Boolean
|
||||
Public Interval As Long
|
||||
End Class
|
||||
14
Jobs/JobBase.vb
Normal file
14
Jobs/JobBase.vb
Normal file
@@ -0,0 +1,14 @@
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
|
||||
Public Class JobBase
|
||||
Protected _LogConfig As LogConfig
|
||||
Protected _Logger As Logger
|
||||
Protected _Firebird As Firebird
|
||||
|
||||
Public Sub New(LogConfig As LogConfig, Firebird As Firebird)
|
||||
_LogConfig = LogConfig
|
||||
_Logger = LogConfig.GetLogger()
|
||||
_Firebird = Firebird
|
||||
End Sub
|
||||
End Class
|
||||
@@ -4,4 +4,6 @@ End Interface
|
||||
|
||||
Public Interface IJob(Of T)
|
||||
Sub Start(Arguments As T)
|
||||
|
||||
Function ShouldStart(Arguments As T) As Boolean
|
||||
End Interface
|
||||
@@ -90,7 +90,9 @@
|
||||
<Compile Include="EDMI\ZUGFeRD\WorkerArgs.vb" />
|
||||
<Compile Include="EDMI\ZUGFeRD\XmlItemProperty.vb" />
|
||||
<Compile Include="Exceptions.vb" />
|
||||
<Compile Include="IJob.vb" />
|
||||
<Compile Include="JobInterface.vb" />
|
||||
<Compile Include="JobBase.vb" />
|
||||
<Compile Include="JobArgs.vb" />
|
||||
<Compile Include="My Project\AssemblyInfo.vb" />
|
||||
<Compile Include="My Project\Settings.Designer.vb">
|
||||
<AutoGen>True</AutoGen>
|
||||
|
||||
Reference in New Issue
Block a user