use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.UpdateFirmwareResponse in project open-smart-grid-platform by OSGP.
the class ConfigurationService method handleUpdateFirmwareResponse.
public void handleUpdateFirmwareResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final UpdateFirmwareResponseDto updateFirmwareResponseDto) {
log.info("handleUpdateFirmwareResponse for MessageType: {}", messageMetadata.getMessageType());
ResponseMessageResultType result = deviceResult;
if (exception != null) {
log.error("Update firmware response not ok. Unexpected Exception", exception);
result = ResponseMessageResultType.NOT_OK;
}
final UpdateFirmwareResponse updateFirmwareResponse = this.configurationMapper.map(updateFirmwareResponseDto, UpdateFirmwareResponse.class);
final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder().withMessageMetadata(messageMetadata).withResult(result).withOsgpException(exception).withDataObject(updateFirmwareResponse).build();
this.webServiceResponseMessageSender.send(responseMessage, messageMetadata.getMessageType());
}
Aggregations