use of org.opensmartgridplatform.dto.valueobjects.smartmetering.FirmwareVersionGasResponseDto in project open-smart-grid-platform by OSGP.
the class BundleService method checkIfAdditionalActionIsNeeded.
private void checkIfAdditionalActionIsNeeded(final MessageMetadata messageMetadata, final BundleMessagesRequestDto bundleMessagesRequestDto) throws FunctionalException {
for (final ActionResponseDto action : bundleMessagesRequestDto.getAllResponses()) {
if (action instanceof CoupleMbusDeviceByChannelResponseDto) {
this.mBusGatewayService.handleCoupleMbusDeviceByChannelResponse(messageMetadata, (CoupleMbusDeviceByChannelResponseDto) action);
} else if (action instanceof DecoupleMbusDeviceResponseDto) {
this.mBusGatewayService.handleDecoupleMbusDeviceResponse(messageMetadata, (DecoupleMbusDeviceResponseDto) action);
} else if (action instanceof SetDeviceLifecycleStatusByChannelResponseDto) {
this.managementService.setDeviceLifecycleStatusByChannel((SetDeviceLifecycleStatusByChannelResponseDto) action);
} else if (action instanceof EventMessageDataResponseDto) {
this.eventService.enrichEvents(messageMetadata, (EventMessageDataResponseDto) action);
} else if (action instanceof FirmwareVersionResponseDto) {
final List<FirmwareVersion> firmwareVersions = this.configurationMapper.mapAsList(((FirmwareVersionResponseDto) action).getFirmwareVersions(), FirmwareVersion.class);
this.firmwareService.saveFirmwareVersionsReturnedFromDevice(messageMetadata.getDeviceIdentification(), firmwareVersions);
} else if (action instanceof FirmwareVersionGasResponseDto) {
final FirmwareVersionGasResponseDto firmwareVersionGasResponseDto = (FirmwareVersionGasResponseDto) action;
final FirmwareVersion firmwareVersion = this.configurationMapper.map(firmwareVersionGasResponseDto.getFirmwareVersion(), FirmwareVersion.class);
this.firmwareService.saveFirmwareVersionsReturnedFromDevice(firmwareVersionGasResponseDto.getFirmwareVersion().getMbusDeviceIdentification(), Arrays.asList(firmwareVersion));
}
}
}
Aggregations