X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2Fui-server%2FAbstractUIServer.ts;h=e0b1207106e34ab1755a68cf9d3974d27a8d3088;hb=6812b4e11d45a0d6179a266687c7ad9aa6e3b538;hp=2608e83443a8bfcfd43a68a93c6074f50f0f0272;hpb=fe94fce08a020e0c35e354c2282ec0587a605f4e;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/ui-server/AbstractUIServer.ts b/src/charging-station/ui-server/AbstractUIServer.ts index 2608e834..e0b12071 100644 --- a/src/charging-station/ui-server/AbstractUIServer.ts +++ b/src/charging-station/ui-server/AbstractUIServer.ts @@ -1,20 +1,24 @@ -import AbstractUIService from './ui-services/AbstractUIService'; import { Server as HttpServer } from 'http'; + +import WebSocket from 'ws'; + +import { ChargingStationData } from '../../types/ChargingStationWorker'; import { ProtocolVersion } from '../../types/UIProtocol'; -import { Server as WSServer } from 'ws'; +import AbstractUIService from './ui-services/AbstractUIService'; export abstract class AbstractUIServer { - public readonly chargingStations: Set; + public readonly chargingStations: Map; protected readonly uiServices: Map; - protected uiServer: WSServer | HttpServer; + protected server: WebSocket.Server | HttpServer; public constructor() { - this.chargingStations = new Set(); + this.chargingStations = new Map(); this.uiServices = new Map(); } public abstract start(): void; public abstract stop(): void; - public abstract sendResponse(message: string): void; - public abstract logPrefix(): string; + public abstract sendRequest(request: string): void; + public abstract sendResponse(response: string): void; + public abstract logPrefix(modName?: string, methodName?: string): string; }