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 | 6 | import { ProtocolVersion } from '../../types/UIProtocol'; |
db2336d9 | 7 | import type AbstractUIService from './ui-services/AbstractUIService'; |
8114d10e | 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; | |
02a6943a JB |
21 | public abstract sendRequest(request: string): void; |
22 | public abstract sendResponse(response: string): void; | |
32de5a57 | 23 | public abstract logPrefix(modName?: string, methodName?: string): string; |
fe94fce0 | 24 | } |