Commit | Line | Data |
---|---|---|
c0560973 JB |
1 | import ChargingStation from '../ChargingStation'; |
2 | import { IncomingRequestCommand } from '../../types/ocpp/Requests'; | |
47e22477 | 3 | import logger from '../../utils/Logger'; |
c0560973 JB |
4 | |
5 | export default abstract class OCPPIncomingRequestService { | |
6 | protected chargingStation: ChargingStation; | |
7 | ||
8 | constructor(chargingStation: ChargingStation) { | |
9 | this.chargingStation = chargingStation; | |
10 | } | |
11 | ||
47e22477 JB |
12 | public handleIncomingRequestError(commandName: IncomingRequestCommand, error: Error): void { |
13 | logger.error(this.chargingStation.logPrefix() + ' Incoming request command ' + commandName + ' error: %j', error); | |
14 | throw error; | |
15 | } | |
16 | ||
c0560973 JB |
17 | public abstract handleRequest(messageId: string, commandName: IncomingRequestCommand, commandPayload: Record<string, unknown>): Promise<void>; |
18 | } |