work on jobrunner

This commit is contained in:
Jonathan Jenne
2019-04-10 11:43:15 +02:00
parent 720618f29b
commit 2855cc6208
14 changed files with 103 additions and 54 deletions

View File

@@ -1,3 +1,5 @@
Public Class ADSyncArgs
Inherits JobArgs
Public RootPath As String
End Class

View File

@@ -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