use of org.opensmartgridplatform.shared.infra.jms.ResponseMessage in project open-smart-grid-platform by OSGP.
the class ConfigurationService method handleGenerateAndReplaceKeysResponse.
public void handleGenerateAndReplaceKeysResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) {
log.info("Handle generate and replace keys response for MessageType: {}", messageMetadata.getMessageType());
ResponseMessageResultType result = deviceResult;
if (exception != null) {
log.error("Generate and replace keys 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 handleSetEncryptionKeyExchangeOnGMeterResponse.
public void handleSetEncryptionKeyExchangeOnGMeterResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType responseMessageResultType, final OsgpException exception) {
log.info("handleSetEncryptionKeyExchangeOnGMeterResponse for MessageType: {}", messageMetadata.getMessageType());
ResponseMessageResultType result = responseMessageResultType;
if (exception != null) {
log.error("Set Encryption Key Exchange On G-Meter 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 ManagementService method handleFindEventsResponse.
public void handleFindEventsResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType resultType, final OsgpException osgpException, final EventMessageDataResponseDto eventMessageDataContainerDto) throws FunctionalException {
this.eventService.enrichEvents(messageMetadata, eventMessageDataContainerDto);
final EventMessagesResponse eventMessageDataContainer = this.managementMapper.map(eventMessageDataContainerDto, EventMessagesResponse.class);
// Send the response containing the events to the webservice-adapter
final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder().withMessageMetadata(messageMetadata).withResult(resultType).withOsgpException(osgpException).withDataObject(eventMessageDataContainer).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 NotificationService method handlePushNotificationAlarm.
public void handlePushNotificationAlarm(final MessageMetadata messageMetadata, final PushNotificationAlarmDto pushNotificationAlarm) {
LOGGER.info("handlePushNotificationAlarm for MessageType: {}", messageMetadata.getMessageType());
final PushNotificationAlarm pushNotificationAlarmDomain = this.mapperFactory.getMapperFacade().map(pushNotificationAlarm, PushNotificationAlarm.class);
/*
* Send the push notification alarm as a response message to the web service, so
* it can be handled similar to response messages based on earlier web service
* requests.
*/
final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder().withMessageMetadata(messageMetadata).withResult(ResponseMessageResultType.OK).withDataObject(pushNotificationAlarmDomain).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 MonitoringService method handleGetPowerQualityProfileResponse.
public void handleGetPowerQualityProfileResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception, final GetPowerQualityProfileResponseDto getPowerQualityProfileResponseDto) {
LOGGER.info("GetPowerQualityProfileResponse for MessageType: {}", messageMetadata.getMessageType());
ResponseMessageResultType result = deviceResult;
if (exception != null) {
LOGGER.error(DEVICE_RESPONSE_NOT_OK_LOG_MSG, exception);
result = ResponseMessageResultType.NOT_OK;
}
final GetPowerQualityProfileResponse getPowerQualityProfileResponse = this.monitoringMapper.map(getPowerQualityProfileResponseDto, GetPowerQualityProfileResponse.class);
final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder().withMessageMetadata(messageMetadata).withResult(result).withOsgpException(exception).withDataObject(getPowerQualityProfileResponse).build();
this.webServiceResponseMessageSender.send(responseMessage, messageMetadata.getMessageType());
}
Aggregations