- protected handleRequestClearCache(chargingStation: ChargingStation): ClearCacheResponse {
- if (chargingStation.idTagsCache.deleteIdTags(getIdTagsFile(chargingStation.stationInfo)!)) {
- return OCPPConstants.OCPP_RESPONSE_ACCEPTED;
+ protected handleRequestClearCache (chargingStation: ChargingStation): ClearCacheResponse {
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
+ if (chargingStation.idTagsCache.deleteIdTags(getIdTagsFile(chargingStation.stationInfo!)!)) {
+ return OCPPConstants.OCPP_RESPONSE_ACCEPTED
+ }
+ return OCPPConstants.OCPP_RESPONSE_REJECTED
+ }
+
+ private getJsonIncomingRequestValidateFunction<T extends JsonType>(
+ commandName: IncomingRequestCommand,
+ schema: JSONSchemaType<T>
+ ): ValidateFunction<JsonType> {
+ if (!this.jsonValidateFunctions.has(commandName)) {
+ this.jsonValidateFunctions.set(commandName, this.ajv.compile<T>(schema).bind(this))