Search in sources :

Example 1 with UpdateFirmwareResponse

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());
}
Also used : ResponseMessage(org.opensmartgridplatform.shared.infra.jms.ResponseMessage) ResponseMessageResultType(org.opensmartgridplatform.shared.infra.jms.ResponseMessageResultType) UpdateFirmwareResponse(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.UpdateFirmwareResponse)

Aggregations

UpdateFirmwareResponse (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.UpdateFirmwareResponse)1 ResponseMessage (org.opensmartgridplatform.shared.infra.jms.ResponseMessage)1 ResponseMessageResultType (org.opensmartgridplatform.shared.infra.jms.ResponseMessageResultType)1