use of ocpp.cs._2015._10.RegistrationStatus in project steve by RWTH-i5-IDSG.
the class CentralSystemService16_Service method bootNotification.
public BootNotificationResponse bootNotification(BootNotificationRequest parameters, String chargeBoxIdentity, OcppProtocol ocppProtocol) {
DateTime now = DateTime.now();
UpdateChargeboxParams params = UpdateChargeboxParams.builder().ocppProtocol(ocppProtocol).vendor(parameters.getChargePointVendor()).model(parameters.getChargePointModel()).pointSerial(parameters.getChargePointSerialNumber()).boxSerial(parameters.getChargeBoxSerialNumber()).fwVersion(parameters.getFirmwareVersion()).iccid(parameters.getIccid()).imsi(parameters.getImsi()).meterType(parameters.getMeterType()).meterSerial(parameters.getMeterSerialNumber()).chargeBoxId(chargeBoxIdentity).heartbeatTimestamp(now).build();
boolean isRegistered = ocppServerRepository.updateChargebox(params);
notificationService.ocppStationBooted(chargeBoxIdentity, isRegistered);
RegistrationStatus status;
if (isRegistered) {
status = RegistrationStatus.ACCEPTED;
} else {
status = RegistrationStatus.REJECTED;
chargePointHelperService.rememberNewUnknown(chargeBoxIdentity);
}
return new BootNotificationResponse().withStatus(status).withCurrentTime(now).withInterval(settingsRepository.getHeartbeatIntervalInSeconds());
}
Aggregations