use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceByChannelAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringInstallationEndpoint method coupleMbusDeviceByChannel.
/**
* @param organisationIdentification the organization requesting the coupling of devices
* @param request the CoupleMbusDeviceByChannelRequest containing the gatewayDeviceIdentification
* 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 = "CoupleMbusDeviceByChannelRequest", namespace = SMARTMETER_INSTALLATION_NAMESPACE)
@ResponsePayload
public CoupleMbusDeviceByChannelAsyncResponse coupleMbusDeviceByChannel(@OrganisationIdentification final String organisationIdentification, @RequestPayload final CoupleMbusDeviceByChannelRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final CoupleMbusDeviceByChannelRequestData requestData = new CoupleMbusDeviceByChannelRequestData(request.getCoupleMbusDeviceByChannelRequestData().getChannel());
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.COUPLE_MBUS_DEVICE_BY_CHANNEL).withMessageType(MessageType.COUPLE_MBUS_DEVICE_BY_CHANNEL).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, CoupleMbusDeviceByChannelAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.CoupleMbusDeviceByChannelAsyncResponse in project open-smart-grid-platform by OSGP.
the class CoupleDeviceSteps method theCoupleMBusDeviceByChannelRequestIsReceived.
@When("^the Couple M-Bus Device By Channel request is received$")
public void theCoupleMBusDeviceByChannelRequestIsReceived(final Map<String, String> settings) throws Throwable {
final CoupleMbusDeviceByChannelRequest request = CoupleMbusDeviceByChannelRequestFactory.fromSettings(settings);
final CoupleMbusDeviceByChannelAsyncResponse asyncResponse = this.smartMeteringInstallationClient.coupleMbusDeviceByChannel(request);
this.checkAndSaveCorrelationId(asyncResponse.getCorrelationUid());
}
Aggregations