@EventHandler public void handle(ChargingStationStatusNotificationReceivedEvent event) { LOG.info("ChargingStationStatusNotificationReceivedEvent for {} received", event.getChargingStationId()); ChargingStation chargingStation = getChargingStation(event.getChargingStationId()); if (chargingStation != null) { chargingStation.setState(ComponentStatus.fromApiComponentStatus(event.getStatusNotification().getStatus())); chargingStationRepository.createOrUpdate(chargingStation); subscriberService.updateSubscribers(chargingStation, event.getStatusNotification().getTimeStamp()); } }
@CommandHandler public void handle(ChargingStationStatusNotificationCommand command) { apply(new ChargingStationStatusNotificationReceivedEvent(command.getChargingStationId(), command.getStatusNotification(), command.getIdentityContext())); }
/** * Handles the {@link ChargingStationStatusNotificationReceivedEvent}. * * @param event the event to handle. */ @EventHandler public void handle(ChargingStationStatusNotificationReceivedEvent event) { ChargingStation chargingStation = repository.findOne(event.getChargingStationId().getId()); if (chargingStation != null) { chargingStation.setStatus(event.getStatusNotification().getStatus()); repository.createOrUpdate(chargingStation); } }