Search in sources :

Example 1 with FirmwareVersionResponseDto

use of org.opensmartgridplatform.dto.valueobjects.smartmetering.FirmwareVersionResponseDto 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));
        }
    }
}
Also used : ActionResponseDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.ActionResponseDto) SetDeviceLifecycleStatusByChannelResponseDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.SetDeviceLifecycleStatusByChannelResponseDto) DecoupleMbusDeviceResponseDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.DecoupleMbusDeviceResponseDto) FirmwareVersionResponseDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.FirmwareVersionResponseDto) EventMessageDataResponseDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.EventMessageDataResponseDto) CoupleMbusDeviceByChannelResponseDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.CoupleMbusDeviceByChannelResponseDto) FirmwareVersionGasResponseDto(org.opensmartgridplatform.dto.valueobjects.smartmetering.FirmwareVersionGasResponseDto) FirmwareVersion(org.opensmartgridplatform.domain.core.valueobjects.FirmwareVersion)

Aggregations

FirmwareVersion (org.opensmartgridplatform.domain.core.valueobjects.FirmwareVersion)1 ActionResponseDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.ActionResponseDto)1 CoupleMbusDeviceByChannelResponseDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.CoupleMbusDeviceByChannelResponseDto)1 DecoupleMbusDeviceResponseDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.DecoupleMbusDeviceResponseDto)1 EventMessageDataResponseDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.EventMessageDataResponseDto)1 FirmwareVersionGasResponseDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.FirmwareVersionGasResponseDto)1 FirmwareVersionResponseDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.FirmwareVersionResponseDto)1 SetDeviceLifecycleStatusByChannelResponseDto (org.opensmartgridplatform.dto.valueobjects.smartmetering.SetDeviceLifecycleStatusByChannelResponseDto)1