Factor out some common code between OCPP 1.6 and 2.0.1 stack
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / 2.0 / OCPP20RequestService.ts
index 336327c9cfde468287e60eb9b4c579bccb83caf2..bc056bef13541e3b00f3cde9af16371ab6140765 100644 (file)
@@ -15,7 +15,6 @@ import {
 import { ErrorType } from '../../../types/ocpp/ErrorType';
 import { OCPPVersion } from '../../../types/ocpp/OCPPVersion';
 import type { RequestParams } from '../../../types/ocpp/Requests';
-import logger from '../../../utils/Logger';
 import Utils from '../../../utils/Utils';
 import type ChargingStation from '../../ChargingStation';
 import OCPPRequestService from '../OCPPRequestService';
@@ -25,7 +24,7 @@ import { OCPP20ServiceUtils } from './OCPP20ServiceUtils';
 const moduleName = 'OCPP20RequestService';
 
 export default class OCPP20RequestService extends OCPPRequestService {
-  private jsonSchemas: Map<OCPP20RequestCommand, JSONSchemaType<JsonObject>>;
+  protected jsonSchemas: Map<OCPP20RequestCommand, JSONSchemaType<JsonObject>>;
 
   public constructor(ocppResponseService: OCPPResponseService) {
     if (new.target?.name === moduleName) {
@@ -78,19 +77,6 @@ export default class OCPP20RequestService extends OCPPRequestService {
     );
   }
 
-  protected getRequestPayloadValidationSchema(
-    chargingStation: ChargingStation,
-    commandName: OCPP20RequestCommand
-  ): JSONSchemaType<JsonObject> | false {
-    if (this.jsonSchemas.has(commandName) === true) {
-      return this.jsonSchemas.get(commandName);
-    }
-    logger.warn(
-      `${chargingStation.logPrefix()} ${moduleName}.getPayloadValidationSchema: No JSON schema found for command ${commandName} PDU validation`
-    );
-    return false;
-  }
-
   private buildRequestPayload<Request extends JsonType>(
     chargingStation: ChargingStation,
     commandName: OCPP20RequestCommand,