use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringInstallationEndpoint method decoupleMbusDeviceByChannel.
/**
* @param organisationIdentification the organization requesting the coupling of devices
* @param request the DecoupleMbusDeviceByChannelRequest 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 = "DecoupleMbusDeviceByChannelRequest", namespace = SMARTMETER_INSTALLATION_NAMESPACE)
@ResponsePayload
public DecoupleMbusDeviceByChannelAsyncResponse decoupleMbusDeviceByChannel(@OrganisationIdentification final String organisationIdentification, @RequestPayload final DecoupleMbusDeviceByChannelRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final DecoupleMbusDeviceByChannelRequestData requestData = new DecoupleMbusDeviceByChannelRequestData(request.getDecoupleMbusDeviceByChannelRequestData().getChannel());
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.DECOUPLE_MBUS_DEVICE_BY_CHANNEL).withMessageType(MessageType.DECOUPLE_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, DecoupleMbusDeviceByChannelAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.installation.DecoupleMbusDeviceByChannelAsyncResponse in project open-smart-grid-platform by OSGP.
the class DecoupleMbusDeviceByChannelSteps method theDeCoupleMbusDeviceByChannelFromEmeterRequestIsReceived.
@When("^the Decouple M-Bus Device By Channel \"([^\"]*)\" from E-meter \"([^\"]*)\" request is received$")
public void theDeCoupleMbusDeviceByChannelFromEmeterRequestIsReceived(final String channel, final String eMeter) throws WebServiceSecurityException {
final DecoupleMbusDeviceByChannelRequest request = DecoupleMbusDeviceByChannelRequestFactory.fromGatewayAndChannel(eMeter, channel);
final DecoupleMbusDeviceByChannelAsyncResponse asyncResponse = this.smartMeteringInstallationClient.decoupleMbusDeviceByChannel(request);
this.checkAndSaveCorrelationId(asyncResponse.getCorrelationUid());
}
Aggregations