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