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