use of org.opensmartgridplatform.shared.infra.jms.ResponseMessage in project open-smart-grid-platform by OSGP.
the class ConfigurationService method handleSetRandomisationSettingsResponse.
public void handleSetRandomisationSettingsResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) {
log.info("handle SetRandomisationSettings response for MessageType: {}", messageMetadata.getMessageType());
ResponseMessageResultType result = deviceResult;
if (exception != null) {
log.error(DEVICE_RESPONSE_NOT_OK_LOG_MSG, exception);
result = ResponseMessageResultType.NOT_OK;
}
final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder().withMessageMetadata(messageMetadata).withResult(result).withOsgpException(exception).build();
this.webServiceResponseMessageSender.send(responseMessage, messageMetadata.getMessageType());
}
use of org.opensmartgridplatform.shared.infra.jms.ResponseMessage in project open-smart-grid-platform by OSGP.
the class ConfigurationService method handleGetFirmwareVersionGasResponse.
public void handleGetFirmwareVersionGasResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final FirmwareVersionGasDto firmwareVersionGas) {
log.info("handleGetFirmwareVersionGasResponse for MessageType: {}", messageMetadata.getMessageType());
ResponseMessageResultType result = deviceResult;
if (exception != null) {
log.error("Get firmware version response not ok. Unexpected Exception", exception);
result = ResponseMessageResultType.NOT_OK;
}
final FirmwareVersion firmwareVersion = this.configurationMapper.map(firmwareVersionGas, FirmwareVersion.class);
final FirmwareVersionGasResponse firmwareVersionGasResponse = new FirmwareVersionGasResponse(firmwareVersion);
final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder().withMessageMetadata(messageMetadata).withResult(result).withOsgpException(exception).withDataObject(firmwareVersionGasResponse).build();
this.webServiceResponseMessageSender.send(responseMessage, messageMetadata.getMessageType());
this.firmwareService.saveFirmwareVersionsReturnedFromDevice(firmwareVersionGas.getMbusDeviceIdentification(), Arrays.asList(firmwareVersion));
}
use of org.opensmartgridplatform.shared.infra.jms.ResponseMessage in project open-smart-grid-platform by OSGP.
the class ConfigurationService method handleSetActivityCalendarResponse.
public void handleSetActivityCalendarResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType responseMessageResultType, final OsgpException exception, final String resultString) {
log.info("handleSetActivityCalendarResponse for MessageType: {}", messageMetadata.getMessageType());
ResponseMessageResultType result = responseMessageResultType;
if (exception != null) {
log.error("Set Activity Calendar Response not ok. Unexpected Exception", exception);
result = ResponseMessageResultType.NOT_OK;
}
final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder().withMessageMetadata(messageMetadata).withResult(result).withOsgpException(exception).withDataObject(resultString).build();
this.webServiceResponseMessageSender.send(responseMessage, messageMetadata.getMessageType());
}
use of org.opensmartgridplatform.shared.infra.jms.ResponseMessage in project open-smart-grid-platform by OSGP.
the class ConfigurationService method handleSetClockConfigurationResponse.
public void handleSetClockConfigurationResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) {
log.info("handleSetClockConfigurationResponse for MessageType: {}", messageMetadata.getMessageType());
ResponseMessageResultType result = deviceResult;
if (exception != null) {
log.error("Set Clock Configuration Response not ok. Unexpected Exception", exception);
result = ResponseMessageResultType.NOT_OK;
}
final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder().withMessageMetadata(messageMetadata).withResult(result).withOsgpException(exception).build();
this.webServiceResponseMessageSender.send(responseMessage, messageMetadata.getMessageType());
}
use of org.opensmartgridplatform.shared.infra.jms.ResponseMessage 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