Compare commits
7 Commits
2f4b8afd67
...
4a4121d8e6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a4121d8e6 | ||
|
|
30cda7c3f5 | ||
|
|
0ba66f119f | ||
|
|
f4141aee40 | ||
|
|
cd2bac4d6a | ||
|
|
fdba43e3d7 | ||
|
|
975ab50e56 |
@@ -33,6 +33,8 @@ Public Class ProfileFilter
|
|||||||
Public Const ERROR_EXECUTING_COUNT_SQL_FOR_DATA_SEARCH = "ERROR_EXECUTING_COUNT_SQL_FOR_DATA_SEARCH"
|
Public Const ERROR_EXECUTING_COUNT_SQL_FOR_DATA_SEARCH = "ERROR_EXECUTING_COUNT_SQL_FOR_DATA_SEARCH"
|
||||||
Public Const ERROR_EXECUTING_COUNT_SQL_FOR_DOC_SEARCH = "ERROR_EXECUTING_COUNT_SQL_FOR_DOC_SEARCH"
|
Public Const ERROR_EXECUTING_COUNT_SQL_FOR_DOC_SEARCH = "ERROR_EXECUTING_COUNT_SQL_FOR_DOC_SEARCH"
|
||||||
|
|
||||||
|
Public Const PROCESS_NAME_CATCHALL = "_CATCHALL_"
|
||||||
|
|
||||||
Public ReadOnly Property Profiles As List(Of ProfileData)
|
Public ReadOnly Property Profiles As List(Of ProfileData)
|
||||||
Get
|
Get
|
||||||
Return _Profiles
|
Return _Profiles
|
||||||
@@ -122,6 +124,12 @@ Public Class ProfileFilter
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
Dim oIsMatch = oProcess.ProcessName.ToLower = ProcessName.ToLower
|
Dim oIsMatch = oProcess.ProcessName.ToLower = ProcessName.ToLower
|
||||||
|
|
||||||
|
' Catch-all processname
|
||||||
|
If oProcess.ProcessName.ToLower = PROCESS_NAME_CATCHALL.ToLower Then
|
||||||
|
oIsMatch = True
|
||||||
|
End If
|
||||||
|
|
||||||
Dim oParent = _ProfileMatch.FindNodeByTag(_TreeView.Nodes, oProfile.Name & "-REGEX")
|
Dim oParent = _ProfileMatch.FindNodeByTag(_TreeView.Nodes, oProfile.Name & "-REGEX")
|
||||||
If oParent IsNot Nothing Then
|
If oParent IsNot Nothing Then
|
||||||
Dim oNode = _ProfileMatch.NewProcessNode(oProfile, oProcess, oIsMatch)
|
Dim oNode = _ProfileMatch.NewProcessNode(oProfile, oProcess, oIsMatch)
|
||||||
@@ -135,7 +143,6 @@ Public Class ProfileFilter
|
|||||||
oFilteredProfiles.Add(oProfile)
|
oFilteredProfiles.Add(oProfile)
|
||||||
_Logger.Info("FilterProfilesByProcess: Profile {0} matched!", oProfile.Name)
|
_Logger.Info("FilterProfilesByProcess: Profile {0} matched!", oProfile.Name)
|
||||||
|
|
||||||
oProfile.MatchedProcessID = oProcess.Guid
|
|
||||||
oProcess.IsMatched = True
|
oProcess.IsMatched = True
|
||||||
oProcesses.Add(oProcess)
|
oProcesses.Add(oProcess)
|
||||||
oProfile.IsMatched = True
|
oProfile.IsMatched = True
|
||||||
|
|||||||
@@ -12,12 +12,21 @@ Public Class ConfigUtils
|
|||||||
_File = New Filesystem.File(LogConfig)
|
_File = New Filesystem.File(LogConfig)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Function TestMigrationNeeded(TargetDirectory As String) As Boolean
|
||||||
|
If IO.Directory.Exists(TargetDirectory) Then
|
||||||
|
Return False
|
||||||
|
Else
|
||||||
|
Return True
|
||||||
|
End If
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Sub MigrateConfig(SourceDirectory As String, TargetDirectory As String, Optional FilePattern As String = "*.*")
|
Public Sub MigrateConfig(SourceDirectory As String, TargetDirectory As String, Optional FilePattern As String = "*.*")
|
||||||
If IO.Directory.Exists(TargetDirectory) Then
|
If IO.Directory.Exists(TargetDirectory) Then
|
||||||
_Logger.Warn("Config Migration aborted because new config directory [{0}] already exists!", TargetDirectory)
|
_Logger.Warn("Config Migration aborted because new config directory [{0}] already exists!", TargetDirectory)
|
||||||
Exit Sub
|
Exit Sub
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
_Logger.Debug("Creating TargetDirectory [{0}]", TargetDirectory)
|
||||||
' Create target directory
|
' Create target directory
|
||||||
Try
|
Try
|
||||||
IO.Directory.CreateDirectory(TargetDirectory)
|
IO.Directory.CreateDirectory(TargetDirectory)
|
||||||
@@ -29,6 +38,7 @@ Public Class ConfigUtils
|
|||||||
|
|
||||||
' Create Migration directory
|
' Create Migration directory
|
||||||
Dim oMigrationDirectory = IO.Path.Combine(SourceDirectory, MIGRATE_DIRECTORY)
|
Dim oMigrationDirectory = IO.Path.Combine(SourceDirectory, MIGRATE_DIRECTORY)
|
||||||
|
_Logger.Debug("Creating MigrationDirectory [{0}]", oMigrationDirectory)
|
||||||
Try
|
Try
|
||||||
IO.Directory.CreateDirectory(oMigrationDirectory)
|
IO.Directory.CreateDirectory(oMigrationDirectory)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@@ -37,18 +47,24 @@ Public Class ConfigUtils
|
|||||||
Exit Sub
|
Exit Sub
|
||||||
End Try
|
End Try
|
||||||
|
|
||||||
|
' Copy individual files from top level directory
|
||||||
For Each oPath In IO.Directory.EnumerateFiles(SourceDirectory, FilePattern)
|
For Each oPath In IO.Directory.EnumerateFiles(SourceDirectory, FilePattern)
|
||||||
Dim oFileInfo = New IO.FileInfo(oPath)
|
Dim oFileInfo = New IO.FileInfo(oPath)
|
||||||
|
|
||||||
|
_Logger.NewBlock($"File {oFileInfo.Name}")
|
||||||
|
_Logger.Debug("Processing file [{0}]", oFileInfo.Name)
|
||||||
|
|
||||||
|
_Logger.Debug("Copying [{0}] to TargetDirectory..", oFileInfo.Name)
|
||||||
|
' Copy to target directory
|
||||||
Try
|
Try
|
||||||
IO.File.Copy(oPath, IO.Path.Combine(TargetDirectory, oFileInfo.Name))
|
IO.File.Copy(oPath, IO.Path.Combine(TargetDirectory, oFileInfo.Name))
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Warn("Could not move old config file {0} to new config location {1}", oFileInfo.Name, TargetDirectory)
|
_Logger.Warn("Could not move old config file {0} to new config location {1}", oFileInfo.Name, TargetDirectory)
|
||||||
_Logger.Error(ex)
|
_Logger.Error(ex)
|
||||||
End Try
|
End Try
|
||||||
Next
|
|
||||||
|
|
||||||
For Each oPath In IO.Directory.EnumerateFiles(SourceDirectory, FilePattern)
|
_Logger.Debug("Moving [{0}] to MigrationDirectory..", oFileInfo.Name)
|
||||||
Dim oFileInfo = New IO.FileInfo(oPath)
|
' Move to migration directory
|
||||||
Try
|
Try
|
||||||
IO.File.Move(oPath, IO.Path.Combine(oMigrationDirectory, oFileInfo.Name))
|
IO.File.Move(oPath, IO.Path.Combine(oMigrationDirectory, oFileInfo.Name))
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
@@ -60,33 +76,44 @@ Public Class ConfigUtils
|
|||||||
For Each oDirectoryPath In IO.Directory.EnumerateDirectories(SourceDirectory, "*", IO.SearchOption.TopDirectoryOnly)
|
For Each oDirectoryPath In IO.Directory.EnumerateDirectories(SourceDirectory, "*", IO.SearchOption.TopDirectoryOnly)
|
||||||
Dim oDirInfo As New IO.DirectoryInfo(oDirectoryPath)
|
Dim oDirInfo As New IO.DirectoryInfo(oDirectoryPath)
|
||||||
|
|
||||||
|
_Logger.NewBlock($"Directory {oDirInfo.Name}")
|
||||||
|
_Logger.Debug("Processing directory [{0}]", oDirInfo.Name)
|
||||||
|
|
||||||
|
' Don't copy TargetDirectory if subpath of SourceDirectory or if MigrationDirectory
|
||||||
If oDirInfo.FullName = TargetDirectory Or oDirInfo.FullName = oMigrationDirectory Then
|
If oDirInfo.FullName = TargetDirectory Or oDirInfo.FullName = oMigrationDirectory Then
|
||||||
|
_Logger.Debug("Directory [{0}] should not be copied. Skipping.", oDirInfo.Name)
|
||||||
Continue For
|
Continue For
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
' Copy directory to TargetDirectory
|
||||||
Dim oNewDirectoryPath = IO.Path.Combine(TargetDirectory, oDirInfo.Name)
|
Dim oNewDirectoryPath = IO.Path.Combine(TargetDirectory, oDirInfo.Name)
|
||||||
|
_Logger.Debug("Copying [{0}] to TargetDirectory..", oDirInfo.Name)
|
||||||
Try
|
Try
|
||||||
_File.CopyDirectory(oDirInfo.FullName, oNewDirectoryPath, True)
|
_File.CopyDirectory(oDirInfo.FullName, oNewDirectoryPath, True)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Warn("Could not move directory [{0}] to new path [{1}]", oDirInfo.FullName, oNewDirectoryPath)
|
_Logger.Warn("Could not move directory [{0}] to new path [{1}]", oDirInfo.FullName, oNewDirectoryPath)
|
||||||
_Logger.Error(ex)
|
_Logger.Error(ex)
|
||||||
End Try
|
End Try
|
||||||
Next
|
|
||||||
|
|
||||||
For Each oDirectoryPath In IO.Directory.EnumerateDirectories(SourceDirectory, "*", IO.SearchOption.TopDirectoryOnly)
|
_Logger.Debug("Copying [{0}] to MigrationDirectory..", oDirInfo.Name)
|
||||||
Dim oDirInfo As New IO.DirectoryInfo(oDirectoryPath)
|
' Copy directory to MigrationDirectory
|
||||||
|
Dim oMigrationDirectoryPath = IO.Path.Combine(oMigrationDirectory, oDirInfo.Name)
|
||||||
If oDirInfo.FullName = TargetDirectory Or oDirInfo.FullName = oMigrationDirectory Then
|
|
||||||
Continue For
|
|
||||||
End If
|
|
||||||
|
|
||||||
Dim oNewDirectoryPath = IO.Path.Combine(oMigrationDirectory, oDirInfo.Name)
|
|
||||||
Try
|
Try
|
||||||
_File.CopyDirectory(oDirInfo.FullName, oNewDirectoryPath, True)
|
_File.CopyDirectory(oDirInfo.FullName, oMigrationDirectoryPath, True)
|
||||||
Catch ex As Exception
|
Catch ex As Exception
|
||||||
_Logger.Error(ex)
|
_Logger.Error(ex)
|
||||||
_Logger.Warn("Could not move directory [{0}] to migration directory [{1}]", oDirInfo.FullName, oNewDirectoryPath)
|
_Logger.Warn("Could not move directory [{0}] to migration directory [{1}]", oDirInfo.FullName, oMigrationDirectoryPath)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
_Logger.Debug("Deleting [{0}]..", oDirInfo.Name)
|
||||||
|
' Delete directory
|
||||||
|
Try
|
||||||
|
IO.Directory.Delete(oDirInfo.FullName, True)
|
||||||
|
Catch ex As Exception
|
||||||
|
_Logger.Error(ex)
|
||||||
|
_Logger.Warn("Could not delete directory [{0}]", oDirInfo.FullName)
|
||||||
End Try
|
End Try
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("1.0.10.0")>
|
<Assembly: AssemblyVersion("1.0.11.0")>
|
||||||
<Assembly: AssemblyFileVersion("1.0.10.0")>
|
<Assembly: AssemblyFileVersion("1.0.11.0")>
|
||||||
|
|||||||
@@ -131,6 +131,16 @@ Public Class Client
|
|||||||
End Try
|
End Try
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Function GetDatatableByName(DatatableName As String, Optional FilterExpression As String = "", Optional SortByColumn As String = "") As TableResult
|
||||||
|
Try
|
||||||
|
Dim oResponse = _channel.ReturnDatatableFromCache(DatatableName, FilterExpression, SortByColumn)
|
||||||
|
Return oResponse
|
||||||
|
Catch ex As Exception
|
||||||
|
_logger.Error(ex)
|
||||||
|
Throw ex
|
||||||
|
End Try
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Async Function GetDatatableByNameAsync(DatatableName As String, Optional FilterExpression As String = "", Optional SortByColumn As String = "") As Task(Of TableResult)
|
Public Async Function GetDatatableByNameAsync(DatatableName As String, Optional FilterExpression As String = "", Optional SortByColumn As String = "") As Task(Of TableResult)
|
||||||
Try
|
Try
|
||||||
Dim oResponse = Await _channel.ReturnDatatableFromCacheAsync(DatatableName, FilterExpression, SortByColumn)
|
Dim oResponse = Await _channel.ReturnDatatableFromCacheAsync(DatatableName, FilterExpression, SortByColumn)
|
||||||
|
|||||||
@@ -12,8 +12,10 @@ Public Class Logger
|
|||||||
Public Sub NewBlock(blockId As String)
|
Public Sub NewBlock(blockId As String)
|
||||||
Dim message As String = $"-----> Start of Block {blockId}"
|
Dim message As String = $"-----> Start of Block {blockId}"
|
||||||
Dim logEventInfo As New LogEventInfo(LogLevel.Info, Name, message)
|
Dim logEventInfo As New LogEventInfo(LogLevel.Info, Name, message)
|
||||||
|
Dim logEventDebug As New LogEventInfo(LogLevel.Debug, Name, message)
|
||||||
Dim WrapperType As Type = GetType(Logger)
|
Dim WrapperType As Type = GetType(Logger)
|
||||||
|
|
||||||
|
Log(WrapperType, logEventDebug)
|
||||||
Log(WrapperType, logEventInfo)
|
Log(WrapperType, logEventInfo)
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -21,8 +23,10 @@ Public Class Logger
|
|||||||
Public Sub EndBlock()
|
Public Sub EndBlock()
|
||||||
Dim message As String = $"<----- End of Block"
|
Dim message As String = $"<----- End of Block"
|
||||||
Dim logEventInfo As New LogEventInfo(LogLevel.Info, Name, message)
|
Dim logEventInfo As New LogEventInfo(LogLevel.Info, Name, message)
|
||||||
|
Dim logEventDebug As New LogEventInfo(LogLevel.Debug, Name, message)
|
||||||
Dim WrapperType As Type = GetType(Logger)
|
Dim WrapperType As Type = GetType(Logger)
|
||||||
|
|
||||||
|
Log(WrapperType, logEventDebug)
|
||||||
Log(WrapperType, logEventInfo)
|
Log(WrapperType, logEventInfo)
|
||||||
End Sub
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
|
|||||||
' übernehmen, indem Sie "*" eingeben:
|
' übernehmen, indem Sie "*" eingeben:
|
||||||
' <Assembly: AssemblyVersion("1.0.*")>
|
' <Assembly: AssemblyVersion("1.0.*")>
|
||||||
|
|
||||||
<Assembly: AssemblyVersion("2.0.3.0")>
|
<Assembly: AssemblyVersion("2.0.4.0")>
|
||||||
<Assembly: AssemblyFileVersion("2.0.3.0")>
|
<Assembly: AssemblyFileVersion("2.0.4.0")>
|
||||||
|
|||||||
Reference in New Issue
Block a user