use of org.opensmartgridplatform.shared.infra.jms.ResponseMessage in project open-smart-grid-platform by OSGP.
the class ConfigurationService method handleSetMbusUserKeyByChannelResponse.
public void handleSetMbusUserKeyByChannelResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType responseMessageResultType, final OsgpException exception) {
log.info("handleSetMbusUserKeyByChannelResponse for MessageType: {}", messageMetadata.getMessageType());
ResponseMessageResultType result = responseMessageResultType;
if (exception != null) {
log.error("Set M-Bus User Key By Channel 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 handleSpecialDaysResponse.
public void handleSpecialDaysResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) {
log.info("handleSpecialDaysresponse 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 handleConfigureDefinableLoadProfileResponse.
public void handleConfigureDefinableLoadProfileResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) {
log.info("handleConfigureDefinableLoadProfileResponse for MessageType: {}", messageMetadata.getMessageType());
ResponseMessageResultType result = deviceResult;
if (exception != null) {
log.error("Configure Definable Load Profile 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 handleGetKeysResponse.
public void handleGetKeysResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType resultType, final OsgpException exception, final GetKeysResponseDto getKeysResponseDto) {
log.info("handleGetKeysResponse for MessageType: {}", messageMetadata.getMessageType());
final List<KeyDto> keys = getKeysResponseDto.getKeys();
final List<GetKeysResponseData> getKeysResponseData = keys.stream().map(key -> new GetKeysResponseData(SecretType.valueOf(key.getSecretType().name()), key.getSecret())).collect(Collectors.toList());
final GetKeysResponse getKeysResponse = new GetKeysResponse(getKeysResponseData);
final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder().withMessageMetadata(messageMetadata).withResult(resultType).withOsgpException(exception).withDataObject(getKeysResponse).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 handleReplaceKeysResponse.
public void handleReplaceKeysResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType deviceResult, final OsgpException exception) {
log.info("handleReplaceKeysResponse for MessageType: {}", messageMetadata.getMessageType());
ResponseMessageResultType result = deviceResult;
if (exception != null) {
log.error("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());
}
Aggregations