From 1f9a2a4a5f942bd5021e9e26ba8c0e955f49c6ee Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Wed, 21 Apr 2021 01:44:16 -0500 Subject: [PATCH] Removed unused file and updated UML. Changed a few method names as well. --- .../Responses/ServiceManagerState.cs | 0 .../Module/IServiceExecuter.cs | 2 +- .../Module/ServiceManager.cs | 8 +- .../UI/IPCController.cs | 2 +- src/GameServiceWarden.Core/UMLSketch.drawio | 420 +++++++++--------- .../Modules/ServiceManagerTest.cs | 2 +- 6 files changed, 220 insertions(+), 214 deletions(-) delete mode 100644 src/GameServiceWarden.ClientAPI/Communicable/Responses/ServiceManagerState.cs diff --git a/src/GameServiceWarden.ClientAPI/Communicable/Responses/ServiceManagerState.cs b/src/GameServiceWarden.ClientAPI/Communicable/Responses/ServiceManagerState.cs deleted file mode 100644 index e69de29..0000000 diff --git a/src/GameServiceWarden.Core/Module/IServiceExecuter.cs b/src/GameServiceWarden.Core/Module/IServiceExecuter.cs index ab5d936..6ec4f7b 100644 --- a/src/GameServiceWarden.Core/Module/IServiceExecuter.cs +++ b/src/GameServiceWarden.Core/Module/IServiceExecuter.cs @@ -5,6 +5,6 @@ namespace GameServiceWarden.Core.Module public interface IServiceManagerActionExecuter { void ExecuteAction(ServiceManagerAction action); - void ViewState(); + void View(); } } \ No newline at end of file diff --git a/src/GameServiceWarden.Core/Module/ServiceManager.cs b/src/GameServiceWarden.Core/Module/ServiceManager.cs index 86ab2ed..a332d38 100644 --- a/src/GameServiceWarden.Core/Module/ServiceManager.cs +++ b/src/GameServiceWarden.Core/Module/ServiceManager.cs @@ -15,8 +15,8 @@ namespace GameServiceWarden.Core.Module private IServiceManagerMonitor managerMonitor; private readonly ConcurrentDictionary running; private readonly IPersistent> services; - private readonly LRUCache descriptorCache; private readonly IReadOnlyPersistent> modules; + private readonly LRUCache descriptorCache; public ServiceManager(IServiceManagerMonitor actionMonitor, IPersistent> services, IReadOnlyPersistent> modules) { @@ -156,7 +156,7 @@ namespace GameServiceWarden.Core.Module return service.GetLogBuffer(); } - public Dictionary GetLogBuffer() { + public IReadOnlyDictionary GetLogBuffers() { Dictionary logs = new Dictionary(); foreach (string service in running.Keys) { @@ -235,12 +235,12 @@ namespace GameServiceWarden.Core.Module } } - public void ViewState() + public void View() { GetServiceNames(); GetRunningServiceNames(); GetModuleNames(); - GetLogBuffer(); + GetLogBuffers(); GetOptions(); } } diff --git a/src/GameServiceWarden.Core/UI/IPCController.cs b/src/GameServiceWarden.Core/UI/IPCController.cs index a619488..11a0b22 100644 --- a/src/GameServiceWarden.Core/UI/IPCController.cs +++ b/src/GameServiceWarden.Core/UI/IPCController.cs @@ -32,7 +32,7 @@ namespace GameServiceWarden.Core.UI break; case CommunicableType.View: ViewRequest view = JsonSerializer.Deserialize(action.Item3); - serviceExecutioner.ViewState(); + serviceExecutioner.View(); break; } } diff --git a/src/GameServiceWarden.Core/UMLSketch.drawio b/src/GameServiceWarden.Core/UMLSketch.drawio index 753744c..29dc133 100644 --- a/src/GameServiceWarden.Core/UMLSketch.drawio +++ b/src/GameServiceWarden.Core/UMLSketch.drawio @@ -1,6 +1,6 @@ - + @@ -33,31 +33,28 @@ + + + - + - - + + - + - - + + - - - - - - @@ -66,14 +63,14 @@ - - + + - - + + @@ -105,44 +102,47 @@ + + + - + - - + + - - + + - - + + - + - + - + - - + + - + - + @@ -166,7 +166,7 @@ - + @@ -174,9 +174,6 @@ - - - @@ -189,352 +186,361 @@ + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + \ No newline at end of file diff --git a/tests/GameServiceWarden.Core.Tests/Modules/ServiceManagerTest.cs b/tests/GameServiceWarden.Core.Tests/Modules/ServiceManagerTest.cs index 2dfd7ef..e162cb4 100644 --- a/tests/GameServiceWarden.Core.Tests/Modules/ServiceManagerTest.cs +++ b/tests/GameServiceWarden.Core.Tests/Modules/ServiceManagerTest.cs @@ -217,7 +217,7 @@ namespace GameServiceWarden.Core.Tests.Modules serviceManager.StartService(FAKE_SERVICE_NAME); serviceManager.ExecuteCommand(FAKE_SERVICE_NAME, COMMAND); //Then - using (MemoryStream mem = new MemoryStream(serviceManager.GetLogBuffer()[FAKE_SERVICE_NAME])) + using (MemoryStream mem = new MemoryStream(serviceManager.GetLogBuffers()[FAKE_SERVICE_NAME])) { using (StreamReader reader = new StreamReader(mem)) {