@CommandHandler public void handle(BootChargingStationCommand command) { ChargingStationBootedEvent chargingStationBootedEvent; if (isConfigured) { chargingStationBootedEvent = new ConfiguredChargingStationBootedEvent(command.getChargingStationId(), command.getProtocol(), command.getAttributes(), command.getIdentityContext()); } else { chargingStationBootedEvent = new UnconfiguredChargingStationBootedEvent(command.getChargingStationId(), command.getProtocol(), command.getAttributes(), command.getIdentityContext()); } apply(chargingStationBootedEvent); }