Search in sources :

Example 1 with EncryptionKeyStatusType

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;
}
Also used : GetKeysResponseData(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysResponseData) ResponseData(org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData) EncryptionKeyStatusType(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.EncryptionKeyStatusType) GetMbusEncryptionKeyStatusByChannelResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetMbusEncryptionKeyStatusByChannelResponse) IOException(java.io.IOException) OsgpException(org.opensmartgridplatform.shared.exceptionhandling.OsgpException) ResponsePayload(org.springframework.ws.server.endpoint.annotation.ResponsePayload) PayloadRoot(org.springframework.ws.server.endpoint.annotation.PayloadRoot)

Example 2 with EncryptionKeyStatusType

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());
}
Also used : EncryptionKeyStatusType(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.EncryptionKeyStatusType) ResponseMessage(org.opensmartgridplatform.shared.infra.jms.ResponseMessage)

Example 3 with EncryptionKeyStatusType

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());
}
Also used : EncryptionKeyStatusType(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.EncryptionKeyStatusType) ResponseMessage(org.opensmartgridplatform.shared.infra.jms.ResponseMessage)

Example 4 with EncryptionKeyStatusType

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;
}
Also used : GetKeysResponseData(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysResponseData) ResponseData(org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData) EncryptionKeyStatusType(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.EncryptionKeyStatusType) GetMbusEncryptionKeyStatusResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetMbusEncryptionKeyStatusResponse) IOException(java.io.IOException) OsgpException(org.opensmartgridplatform.shared.exceptionhandling.OsgpException) ResponsePayload(org.springframework.ws.server.endpoint.annotation.ResponsePayload) PayloadRoot(org.springframework.ws.server.endpoint.annotation.PayloadRoot)

Aggregations

EncryptionKeyStatusType (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.EncryptionKeyStatusType)4 IOException (java.io.IOException)2 ResponseData (org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData)2 GetKeysResponseData (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysResponseData)2 OsgpException (org.opensmartgridplatform.shared.exceptionhandling.OsgpException)2 ResponseMessage (org.opensmartgridplatform.shared.infra.jms.ResponseMessage)2 PayloadRoot (org.springframework.ws.server.endpoint.annotation.PayloadRoot)2 ResponsePayload (org.springframework.ws.server.endpoint.annotation.ResponsePayload)2 GetMbusEncryptionKeyStatusByChannelResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetMbusEncryptionKeyStatusByChannelResponse)1 GetMbusEncryptionKeyStatusResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetMbusEncryptionKeyStatusResponse)1