Commit | Line | Data |
---|---|---|
fe94fce0 | 1 | import { Server as HttpServer } from 'http'; |
8114d10e | 2 | |
0d8140bd | 3 | import WebSocket from 'ws'; |
fe94fce0 | 4 | |
32de5a57 | 5 | import { ChargingStationData } from '../../types/ChargingStationWorker'; |
8114d10e JB |
6 | import { ProtocolVersion } from '../../types/UIProtocol'; |
7 | import AbstractUIService from './ui-services/AbstractUIService'; | |
8 | ||
fe94fce0 | 9 | export abstract class AbstractUIServer { |
32de5a57 | 10 | public readonly chargingStations: Map<string, ChargingStationData>; |
fe94fce0 | 11 | protected readonly uiServices: Map<ProtocolVersion, AbstractUIService>; |
0d8140bd | 12 | protected server: WebSocket.Server | HttpServer; |
fe94fce0 JB |
13 | |
14 | public constructor() { | |
32de5a57 | 15 | this.chargingStations = new Map<string, ChargingStationData>(); |
fe94fce0 JB |
16 | this.uiServices = new Map<ProtocolVersion, AbstractUIService>(); |
17 | } | |
18 | ||
19 | public abstract start(): void; | |
20 | public abstract stop(): void; | |
21 | public abstract sendResponse(message: string): void; | |
32de5a57 | 22 | public abstract logPrefix(modName?: string, methodName?: string): string; |
fe94fce0 | 23 | } |