import type { WebSocket } from 'ws';
+import type AbstractUIService from './ui-services/AbstractUIService';
+import UIServiceFactory from './ui-services/UIServiceFactory';
import type { ChargingStationData } from '../../types/ChargingStationWorker';
import type { UIServerConfiguration } from '../../types/ConfigurationData';
import {
AuthenticationType,
- ProcedureName,
- ProtocolRequest,
- ProtocolResponse,
- ProtocolVersion,
- RequestPayload,
- ResponsePayload,
+ type ProcedureName,
+ type ProtocolRequest,
+ type ProtocolResponse,
+ type ProtocolVersion,
+ type RequestPayload,
+ type ResponsePayload,
} from '../../types/UIProtocol';
-import type AbstractUIService from './ui-services/AbstractUIService';
-import UIServiceFactory from './ui-services/UIServiceFactory';
export abstract class AbstractUIServer {
public readonly chargingStations: Map<string, ChargingStationData>;
this.chargingStations.clear();
}
+ protected startHttpServer(): void {
+ if (this.httpServer.listening === false) {
+ this.httpServer.listen(this.uiServerConfiguration.options);
+ }
+ }
+
protected registerProtocolVersionUIService(version: ProtocolVersion): void {
if (this.uiServices.has(version) === false) {
this.uiServices.set(version, UIServiceFactory.getUIServiceImplementation(version, this));