Search in sources :

Example 1 with DecoupleMbusDeviceAsyncResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceAsyncResponse in project open-smart-grid-platform by OSGP.

the class DecoupleDeviceSteps method theDecoupleGMeterRequestIsReceived.

@When("^the Decouple G-meter \"([^\"]*)\" from E-meter \"([^\"]*)\" request is received$")
public void theDecoupleGMeterRequestIsReceived(final String gasMeter, final String eMeter) throws WebServiceSecurityException {
    final DecoupleMbusDeviceRequest request = DecoupleMbusDeviceRequestFactory.forGatewayAndMbusDevice(eMeter, gasMeter);
    final DecoupleMbusDeviceAsyncResponse asyncResponse = this.smartMeteringInstallationClient.decoupleMbusDevice(request);
    this.checkAndSaveCorrelationId(asyncResponse.getCorrelationUid());
}
Also used : DecoupleMbusDeviceRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceRequest) DecoupleMbusDeviceAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceAsyncResponse) When(io.cucumber.java.en.When)

Example 2 with DecoupleMbusDeviceAsyncResponse

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceAsyncResponse in project open-smart-grid-platform by OSGP.

the class SmartMeteringInstallationEndpoint method decoupleMbusDevice.

/**
 * @param organisationIdentification the organisation requesting the coupling of devices
 * @param request the DecoupleMbusDeviceRequest containing the deviceIdentification,
 *     mbusDeviceIdentification and channel
 * @param messagePriority the priority of the message
 * @param scheduleTime the time the request is scheduled for
 * @return a response containing a correlationUid and the deviceIdentification
 * @throws OsgpException
 */
@PayloadRoot(localPart = "DecoupleMbusDeviceRequest", namespace = SMARTMETER_INSTALLATION_NAMESPACE)
@ResponsePayload
public DecoupleMbusDeviceAsyncResponse decoupleMbusDevice(@OrganisationIdentification final String organisationIdentification, @RequestPayload final DecoupleMbusDeviceRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
    final DecoupleMbusDeviceRequestData requestData = new DecoupleMbusDeviceRequestData(request.getMbusDeviceIdentification());
    final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.DECOUPLE_MBUS_DEVICE).withMessageType(MessageType.DECOUPLE_MBUS_DEVICE).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
    final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, requestData);
    this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
    return this.installationMapper.map(asyncResponse, DecoupleMbusDeviceAsyncResponse.class);
}
Also used : DecoupleMbusDeviceRequestData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.DecoupleMbusDeviceRequestData) CoupleMbusDeviceByChannelAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceByChannelAsyncResponse) AsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse) AddDeviceAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceAsyncResponse) DecoupleMbusDeviceByChannelAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelAsyncResponse) DecoupleMbusDeviceAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceAsyncResponse) CoupleMbusDeviceAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceAsyncResponse) ResponsePayload(org.springframework.ws.server.endpoint.annotation.ResponsePayload) PayloadRoot(org.springframework.ws.server.endpoint.annotation.PayloadRoot)

Aggregations

DecoupleMbusDeviceAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceAsyncResponse)2 When (io.cucumber.java.en.When)1 AsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse)1 AddDeviceAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.AddDeviceAsyncResponse)1 CoupleMbusDeviceAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceAsyncResponse)1 CoupleMbusDeviceByChannelAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceByChannelAsyncResponse)1 DecoupleMbusDeviceByChannelAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelAsyncResponse)1 DecoupleMbusDeviceRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceRequest)1 DecoupleMbusDeviceRequestData (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.DecoupleMbusDeviceRequestData)1 PayloadRoot (org.springframework.ws.server.endpoint.annotation.PayloadRoot)1 ResponsePayload (org.springframework.ws.server.endpoint.annotation.ResponsePayload)1