Projektdateien hinzufügen.
This commit is contained in:
49
ECM.JobRunner.Windows/WCF/JobRunner.vb
Normal file
49
ECM.JobRunner.Windows/WCF/JobRunner.vb
Normal file
@@ -0,0 +1,49 @@
|
||||
Imports System.ServiceModel
|
||||
Imports System.ServiceModel.Description
|
||||
Imports DigitalData.Modules.Database
|
||||
Imports DigitalData.Modules.Logging
|
||||
Imports DigitalData.Modules.Messaging.WCF
|
||||
Imports ECM.JobRunner.Common
|
||||
|
||||
Namespace WCF
|
||||
|
||||
Public Class JobRunner
|
||||
Implements IJobRunner
|
||||
|
||||
Public Shared State As State
|
||||
Public Shared LogConfig As LogConfig
|
||||
Public Shared Database As MSSQLServer
|
||||
|
||||
''' <summary>
|
||||
''' See: https://stackoverflow.com/questions/42327988/addserviceendpoint-throws-key-is-null
|
||||
''' </summary>
|
||||
''' <param name="Config"></param>
|
||||
Public Shared Sub Configure(Config As ServiceConfiguration)
|
||||
Dim oBaseAddress = Config.BaseAddresses.Item(0)
|
||||
Dim oBinding = Binding.GetBinding()
|
||||
Dim oAddress = New EndpointAddress(oBaseAddress)
|
||||
Dim oDescription = ContractDescription.GetContract(GetType(IJobRunner), GetType(JobRunner))
|
||||
Dim oEndpoint As New ServiceEndpoint(oDescription, oBinding, oAddress)
|
||||
|
||||
Config.AddServiceEndpoint(oEndpoint)
|
||||
Config.Description.Behaviors.Add(New ServiceDebugBehavior With {
|
||||
.IncludeExceptionDetailInFaults = True
|
||||
})
|
||||
End Sub
|
||||
|
||||
Public Function GetHeartbeat() As Date Implements IJobRunner.GetHeartbeat
|
||||
Return Now
|
||||
End Function
|
||||
|
||||
Public Function GetJobHistory() As GetJobHistory.GetJobHistoryResponse Implements IJobRunner.GetJobHistory
|
||||
Dim oMethod As New GetJobHistory.GetJobHistoryMethod(LogConfig, Database, State)
|
||||
Return oMethod.Run()
|
||||
End Function
|
||||
|
||||
Public Function GetJobConfig() As GetJobConfig.GetJobConfigResponse Implements IJobRunner.GetJobConfig
|
||||
Dim oMethod As New GetJobConfig.GetJobConfigMethod(LogConfig, Database, State)
|
||||
Return oMethod.Run()
|
||||
End Function
|
||||
End Class
|
||||
|
||||
End Namespace
|
||||
Reference in New Issue
Block a user