Search in sources :

Example 21 with ResponseData

use of org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData in project open-smart-grid-platform by OSGP.

the class SmartMeteringInstallationEndpoint method getDecoupleMbusDeviceByChannelResponse.

/**
 * @param request the request message containing the correlationUid
 * @return the response message containing the OsgpResultType and optional a message
 * @throws OsgpException
 */
@PayloadRoot(localPart = "DecoupleMbusDeviceByChannelAsyncRequest", namespace = SMARTMETER_INSTALLATION_NAMESPACE)
@ResponsePayload
public DecoupleMbusDeviceByChannelResponse getDecoupleMbusDeviceByChannelResponse(@RequestPayload final DecoupleMbusDeviceByChannelAsyncRequest request) throws OsgpException {
    DecoupleMbusDeviceByChannelResponse response = null;
    try {
        final ResponseData responseData = this.responseDataService.get(request.getCorrelationUid(), ComponentType.WS_SMART_METERING);
        this.throwExceptionIfResultNotOk(responseData, "Decouple Mbus Device By Channel");
        response = this.installationMapper.map(responseData.getMessageData(), DecoupleMbusDeviceByChannelResponse.class);
    } catch (final Exception e) {
        this.handleException(e);
    }
    return response;
}
Also used : ResponseData(org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData) DecoupleMbusDeviceByChannelResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelResponse) ValidationException(org.opensmartgridplatform.domain.core.exceptions.ValidationException) FunctionalException(org.opensmartgridplatform.shared.exceptionhandling.FunctionalException) OsgpException(org.opensmartgridplatform.shared.exceptionhandling.OsgpException) ConstraintViolationException(javax.validation.ConstraintViolationException) ResponsePayload(org.springframework.ws.server.endpoint.annotation.ResponsePayload) PayloadRoot(org.springframework.ws.server.endpoint.annotation.PayloadRoot)

Example 22 with ResponseData

use of org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData in project open-smart-grid-platform by OSGP.

the class SmartMeteringMonitoringEndpoint method getPeriodicMeterReadsResponse.

@PayloadRoot(localPart = "PeriodicMeterReadsAsyncRequest", namespace = SMARTMETER_MONITORING_NAMESPACE)
@ResponsePayload
public PeriodicMeterReadsResponse getPeriodicMeterReadsResponse(@OrganisationIdentification final String organisationIdentification, @RequestPayload final PeriodicMeterReadsAsyncRequest request) throws OsgpException {
    log.debug("Incoming PeriodicMeterReadsAsyncRequest for meter: {}.", request.getDeviceIdentification());
    PeriodicMeterReadsResponse response = null;
    try {
        final ResponseData responseData = this.responseDataService.get(request.getCorrelationUid(), PeriodicMeterReadsContainer.class, ComponentType.WS_SMART_METERING);
        this.throwExceptionIfResultNotOk(responseData, "retrieving the periodic meter reads");
        response = this.monitoringMapper.map(responseData.getMessageData(), org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.PeriodicMeterReadsResponse.class);
    } catch (final Exception e) {
        this.handleRetrieveException(e, request, organisationIdentification);
    }
    return response;
}
Also used : ResponseData(org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData) PeriodicMeterReadsResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.PeriodicMeterReadsResponse) FunctionalException(org.opensmartgridplatform.shared.exceptionhandling.FunctionalException) OsgpException(org.opensmartgridplatform.shared.exceptionhandling.OsgpException) ResponsePayload(org.springframework.ws.server.endpoint.annotation.ResponsePayload) PayloadRoot(org.springframework.ws.server.endpoint.annotation.PayloadRoot)

Example 23 with ResponseData

use of org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData in project open-smart-grid-platform by OSGP.

the class SmartMeteringMonitoringEndpoint method getPeriodicMeterReadsGasResponse.

@PayloadRoot(localPart = "PeriodicMeterReadsGasAsyncRequest", namespace = SMARTMETER_MONITORING_NAMESPACE)
@ResponsePayload
public PeriodicMeterReadsGasResponse getPeriodicMeterReadsGasResponse(@OrganisationIdentification final String organisationIdentification, @RequestPayload final PeriodicMeterReadsGasAsyncRequest request) throws OsgpException {
    log.debug("Incoming PeriodicMeterReadsGasAsyncRequest for meter: {}.", request.getDeviceIdentification());
    PeriodicMeterReadsGasResponse response = null;
    try {
        final ResponseData responseData = this.responseDataService.get(request.getCorrelationUid(), PeriodicMeterReadsContainerGas.class, ComponentType.WS_SMART_METERING);
        this.throwExceptionIfResultNotOk(responseData, "retrieving the periodic meter reads for gas");
        response = this.monitoringMapper.map(responseData.getMessageData(), org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.PeriodicMeterReadsGasResponse.class);
    } catch (final Exception e) {
        this.handleRetrieveException(e, request, organisationIdentification);
    }
    return response;
}
Also used : PeriodicMeterReadsGasResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.PeriodicMeterReadsGasResponse) ResponseData(org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData) FunctionalException(org.opensmartgridplatform.shared.exceptionhandling.FunctionalException) OsgpException(org.opensmartgridplatform.shared.exceptionhandling.OsgpException) ResponsePayload(org.springframework.ws.server.endpoint.annotation.ResponsePayload) PayloadRoot(org.springframework.ws.server.endpoint.annotation.PayloadRoot)

Example 24 with ResponseData

use of org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData in project open-smart-grid-platform by OSGP.

the class SmartMeteringMonitoringEndpoint method getActualMeterReadsResponse.

@PayloadRoot(localPart = "ActualMeterReadsAsyncRequest", namespace = SMARTMETER_MONITORING_NAMESPACE)
@ResponsePayload
public ActualMeterReadsResponse getActualMeterReadsResponse(@OrganisationIdentification final String organisationIdentification, @RequestPayload final ActualMeterReadsAsyncRequest request) throws OsgpException {
    log.debug("Incoming ActualMeterReadsAsyncRequest for meter: {}", request.getDeviceIdentification());
    ActualMeterReadsResponse response = null;
    try {
        final ResponseData responseData = this.responseDataService.get(request.getCorrelationUid(), MeterReads.class, ComponentType.WS_SMART_METERING);
        this.throwExceptionIfResultNotOk(responseData, "retrieving the actual meter reads");
        response = this.monitoringMapper.map(responseData.getMessageData(), ActualMeterReadsResponse.class);
    } catch (final Exception e) {
        this.handleRetrieveException(e, request, organisationIdentification);
    }
    return response;
}
Also used : ActualMeterReadsResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.ActualMeterReadsResponse) ResponseData(org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData) FunctionalException(org.opensmartgridplatform.shared.exceptionhandling.FunctionalException) OsgpException(org.opensmartgridplatform.shared.exceptionhandling.OsgpException) ResponsePayload(org.springframework.ws.server.endpoint.annotation.ResponsePayload) PayloadRoot(org.springframework.ws.server.endpoint.annotation.PayloadRoot)

Example 25 with ResponseData

use of org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData in project open-smart-grid-platform by OSGP.

the class SmartMeteringMonitoringEndpoint method getSystemEventResponse.

@PayloadRoot(localPart = "GetSystemEventAsyncRequest", namespace = SMARTMETER_MONITORING_NAMESPACE)
@ResponsePayload
public GetSystemEventResponse getSystemEventResponse(@OrganisationIdentification final String organisationIdentification, @RequestPayload final GetSystemEventAsyncRequest request) throws OsgpException {
    log.debug("Incoming GetSystemEventAsyncRequest for meter: {}.", request.getDeviceIdentification());
    GetSystemEventResponse response = null;
    try {
        final ResponseData responseData = this.responseDataService.get(request.getCorrelationUid(), ComponentType.WS_SMART_METERING);
        this.throwExceptionIfResultNotOk(responseData, "retrieving system event data");
        response = this.monitoringMapper.map(responseData.getMessageData(), org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.GetSystemEventResponse.class);
    } catch (final Exception e) {
        this.handleRetrieveException(e, request, organisationIdentification);
    }
    return response;
}
Also used : ResponseData(org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData) GetSystemEventResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.monitoring.GetSystemEventResponse) FunctionalException(org.opensmartgridplatform.shared.exceptionhandling.FunctionalException) OsgpException(org.opensmartgridplatform.shared.exceptionhandling.OsgpException) ResponsePayload(org.springframework.ws.server.endpoint.annotation.ResponsePayload) PayloadRoot(org.springframework.ws.server.endpoint.annotation.PayloadRoot)

Aggregations

ResponseData (org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData)86 PayloadRoot (org.springframework.ws.server.endpoint.annotation.PayloadRoot)52 ResponsePayload (org.springframework.ws.server.endpoint.annotation.ResponsePayload)52 OsgpException (org.opensmartgridplatform.shared.exceptionhandling.OsgpException)51 IOException (java.io.IOException)23 GetKeysResponseData (org.opensmartgridplatform.adapter.ws.schema.smartmetering.configuration.GetKeysResponseData)23 FunctionalException (org.opensmartgridplatform.shared.exceptionhandling.FunctionalException)23 ConstraintViolationException (javax.validation.ConstraintViolationException)13 ValidationException (org.opensmartgridplatform.domain.core.exceptions.ValidationException)13 TechnicalException (org.opensmartgridplatform.shared.exceptionhandling.TechnicalException)11 Then (io.cucumber.java.en.Then)8 Serializable (java.io.Serializable)7 GetGsmDiagnosticResponseData (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.GetGsmDiagnosticResponseData)6 SetDeviceLifecycleStatusByChannelResponseData (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelResponseData)6 ScanMbusChannelsResponseData (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ScanMbusChannelsResponseData)5 Field (java.lang.reflect.Field)4 ResponseDataBuilder (org.opensmartgridplatform.cucumber.platform.glue.steps.database.ws.ResponseDataBuilder)4 Given (io.cucumber.java.en.Given)3 ResponseMessage (org.opensmartgridplatform.shared.infra.jms.ResponseMessage)3 Transactional (org.springframework.transaction.annotation.Transactional)3