build(deps-dev): apply updates
[e-mobility-charging-stations-simulator.git] / src / charging-station / ui-server / AbstractUIServer.ts
index cd6167389cf159d44c3b6118e20d3446473d01d3..a1375cea3786d131013685e39786032e7f1e4d6f 100644 (file)
@@ -21,12 +21,14 @@ import {
 
 export abstract class AbstractUIServer {
   public readonly chargingStations: Map<string, ChargingStationData>
+  public readonly chargingStationTemplates: Set<string>
   protected readonly httpServer: Server | Http2Server
   protected readonly responseHandlers: Map<string, ServerResponse | WebSocket>
   protected readonly uiServices: Map<ProtocolVersion, AbstractUIService>
 
   public constructor (protected readonly uiServerConfiguration: UIServerConfiguration) {
     this.chargingStations = new Map<string, ChargingStationData>()
+    this.chargingStationTemplates = new Set<string>()
     switch (this.uiServerConfiguration.version) {
       case ApplicationProtocolVersion.VERSION_11:
         this.httpServer = new Server()
@@ -57,7 +59,11 @@ export abstract class AbstractUIServer {
 
   public stop (): void {
     this.stopHttpServer()
+    for (const uiService of this.uiServices.values()) {
+      uiService.stop()
+    }
     this.chargingStations.clear()
+    this.chargingStationTemplates.clear()
   }
 
   public async sendInternalRequest (request: ProtocolRequest): Promise<ProtocolResponse> {