use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringInstallationEndpoint method coupleMbusDevice.
/**
* @param organisationIdentification the organisation requesting the coupling of devices
* @param request the CoupleMbusDeviceRequest 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 = "CoupleMbusDeviceRequest", namespace = SMARTMETER_INSTALLATION_NAMESPACE)
@ResponsePayload
public CoupleMbusDeviceAsyncResponse coupleMbusDevice(@OrganisationIdentification final String organisationIdentification, @RequestPayload final CoupleMbusDeviceRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final CoupleMbusDeviceRequestData requestData = new CoupleMbusDeviceRequestData(request.getMbusDeviceIdentification());
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.COUPLE_MBUS_DEVICE).withMessageType(MessageType.COUPLE_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, CoupleMbusDeviceAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceAsyncResponse in project open-smart-grid-platform by OSGP.
the class CoupleDeviceSteps method theCoupleGMeterRequestIsReceivedForEMeter.
@When("^the Couple G-meter \"([^\"]*)\" request is received for E-meter \"([^\"]*)\"$")
public void theCoupleGMeterRequestIsReceivedForEMeter(final String gasMeter, final String eMeter) throws WebServiceSecurityException {
final CoupleMbusDeviceRequest request = CoupleMbusDeviceRequestFactory.forGatewayMbusDevice(eMeter, gasMeter);
final CoupleMbusDeviceAsyncResponse asyncResponse = this.smartMeteringInstallationClient.coupleMbusDevice(request);
this.checkAndSaveCorrelationId(asyncResponse.getCorrelationUid());
}
Aggregations