use of org.opensmartgridplatform.shared.infra.jms.ResponseMessage in project open-smart-grid-platform by OSGP.
the class ConfigurationService method handleSetConfigurationObjectResponse.
public void handleSetConfigurationObjectResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) {
log.info("handle SetConfigurationObject 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 handleSetPushSetupAlarmResponse.
public void handleSetPushSetupAlarmResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) {
log.info("handleSetPushSetupAlarmResponse for MessageType: {}", messageMetadata.getMessageType());
ResponseMessageResultType result = deviceResult;
if (exception != null) {
log.error("Set Push Setup Alarm 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 handleSetAlarmNotificationsResponse.
public void handleSetAlarmNotificationsResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) {
log.info("handleSetAlarmNotificationsResponse for MessageType: {}", messageMetadata.getMessageType());
ResponseMessageResultType result = deviceResult;
if (exception != null) {
log.error("Set Alarm Notifications 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 InstallationService method handleCoupleMbusDeviceByChannelResponse.
@Transactional(value = "transactionManager")
public void handleCoupleMbusDeviceByChannelResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType responseMessageResultType, final OsgpException osgpException, final CoupleMbusDeviceByChannelResponseDto dataObject) throws FunctionalException {
this.mBusGatewayService.handleCoupleMbusDeviceByChannelResponse(messageMetadata, dataObject);
final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder().withMessageMetadata(messageMetadata).withResult(responseMessageResultType).withOsgpException(osgpException).withDataObject(this.commonMapper.map(dataObject, CoupleMbusDeviceByChannelResponse.class)).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 InstallationService method handleDecoupleMbusDeviceByChannelResponse.
@Transactional(value = "transactionManager")
public void handleDecoupleMbusDeviceByChannelResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType responseMessageResultType, final OsgpException osgpException, final DecoupleMbusDeviceResponseDto decoupleMbusDeviceResponseDto) throws FunctionalException {
if (osgpException == null) {
this.mBusGatewayService.handleDecoupleMbusDeviceResponse(messageMetadata, decoupleMbusDeviceResponseDto);
}
final DecoupleMbusDeviceByChannelResponse response = new DecoupleMbusDeviceByChannelResponse(decoupleMbusDeviceResponseDto.getMbusDeviceIdentification(), decoupleMbusDeviceResponseDto.getChannelElementValues().getChannel());
final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder().withMessageMetadata(messageMetadata).withResult(responseMessageResultType).withOsgpException(osgpException).withDataObject(response).build();
this.webServiceResponseMessageSender.send(responseMessage, messageMetadata.getMessageType());
}
Aggregations