use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.EncryptionKeyStatusType in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method getGetMBusEncryptionKeyStatusByChannelResponse.
@PayloadRoot(localPart = "GetMbusEncryptionKeyStatusByChannelAsyncRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public GetMbusEncryptionKeyStatusByChannelResponse getGetMBusEncryptionKeyStatusByChannelResponse(@RequestPayload final GetMbusEncryptionKeyStatusByChannelAsyncRequest request) throws OsgpException {
GetMbusEncryptionKeyStatusByChannelResponse response = null;
try {
final ResponseData responseData = this.responseDataService.get(request.getCorrelationUid(), ComponentType.WS_SMART_METERING);
this.throwExceptionIfResultNotOk(responseData, "retrieving the M-Bus encryption key status by channel.");
response = new GetMbusEncryptionKeyStatusByChannelResponse();
response.setResult(OsgpResultType.fromValue(responseData.getResultType().getValue()));
response.setEncryptionKeyStatus(EncryptionKeyStatus.fromValue(((EncryptionKeyStatusType) responseData.getMessageData()).name()));
} catch (final Exception e) {
this.handleException(e);
}
return response;
}
use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.EncryptionKeyStatusType in project open-smart-grid-platform by OSGP.
the class ConfigurationService method handleGetMbusEncryptionKeyStatusResponse.
public void handleGetMbusEncryptionKeyStatusResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType resultType, final OsgpException exception, final GetMbusEncryptionKeyStatusResponseDto getMbusEncryptionKeyStatusResponseDto) {
log.info("handleGetMbusEncryptionKeyStatusResponse for MessageType: {}", messageMetadata.getMessageType());
final String mbusDeviceIdentification = getMbusEncryptionKeyStatusResponseDto.getMbusDeviceIdentification();
final EncryptionKeyStatusType encryptionKeyStatusType = EncryptionKeyStatusType.valueOf(getMbusEncryptionKeyStatusResponseDto.getEncryptionKeyStatus().name());
final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder().withMessageMetadata(messageMetadata.builder().withDeviceIdentification(mbusDeviceIdentification).build()).withResult(resultType).withOsgpException(exception).withDataObject(encryptionKeyStatusType).build();
this.webServiceResponseMessageSender.send(responseMessage, messageMetadata.getMessageType());
}
use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.EncryptionKeyStatusType in project open-smart-grid-platform by OSGP.
the class ConfigurationService method handleGetMbusEncryptionKeyStatusByChannelResponse.
public void handleGetMbusEncryptionKeyStatusByChannelResponse(final MessageMetadata messageMetadata, final ResponseMessageResultType resultType, final OsgpException exception, final GetMbusEncryptionKeyStatusByChannelResponseDto getMbusEncryptionKeyStatusByChannelResponseDto) {
log.info("handleGetMbusEncryptionKeyStatusByChannelResponse for MessageType: {}", messageMetadata.getMessageType());
final EncryptionKeyStatusType encryptionKeyStatusType = EncryptionKeyStatusType.valueOf(getMbusEncryptionKeyStatusByChannelResponseDto.getEncryptionKeyStatus().name());
final ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder().withMessageMetadata(messageMetadata).withResult(resultType).withOsgpException(exception).withDataObject(encryptionKeyStatusType).build();
this.webServiceResponseMessageSender.send(responseMessage, messageMetadata.getMessageType());
}
use of org.opensmartgridplatform.domain.core.valueobjects.smartmetering.EncryptionKeyStatusType in project open-smart-grid-platform by OSGP.
the class SmartMeteringConfigurationEndpoint method getGetMBusEncryptionKeyStatusResponse.
@PayloadRoot(localPart = "GetMbusEncryptionKeyStatusAsyncRequest", namespace = SMARTMETER_CONFIGURATION_NAMESPACE)
@ResponsePayload
public GetMbusEncryptionKeyStatusResponse getGetMBusEncryptionKeyStatusResponse(@RequestPayload final GetMbusEncryptionKeyStatusAsyncRequest request) throws OsgpException {
GetMbusEncryptionKeyStatusResponse response = null;
try {
final ResponseData responseData = this.responseDataService.get(request.getCorrelationUid(), ComponentType.WS_SMART_METERING);
this.throwExceptionIfResultNotOk(responseData, "retrieving the M-Bus encryption key status.");
response = new GetMbusEncryptionKeyStatusResponse();
response.setResult(OsgpResultType.fromValue(responseData.getResultType().getValue()));
response.setEncryptionKeyStatus(EncryptionKeyStatus.fromValue(((EncryptionKeyStatusType) responseData.getMessageData()).name()));
} catch (final Exception e) {
this.handleException(e);
}
return response;
}
Aggregations