use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.ScanMbusChannelsAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringAdhocEndpoint method scanMbusChannels.
@PayloadRoot(localPart = "ScanMbusChannelsRequest", namespace = SMARTMETER_ADHOC_NAMESPACE)
@ResponsePayload
public ScanMbusChannelsAsyncResponse scanMbusChannels(@OrganisationIdentification final String organisationIdentification, @RequestPayload final ScanMbusChannelsRequest request, @MessagePriority final String messagePriority, @ScheduleTime final String scheduleTime, @ResponseUrl final String responseUrl, @BypassRetry final String bypassRetry) throws OsgpException {
final org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ScanMbusChannelsRequest scanMbusChannelsRequest = this.adhocMapper.map(request, org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ScanMbusChannelsRequest.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.SCAN_MBUS_CHANNELS).withMessageType(MessageType.SCAN_MBUS_CHANNELS).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, scanMbusChannelsRequest);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.adhocMapper.map(asyncResponse, ScanMbusChannelsAsyncResponse.class);
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.adhoc.ScanMbusChannelsAsyncResponse in project open-smart-grid-platform by OSGP.
the class ScanMbusChannelsSteps method theScanMBusChannelsRequestIsReceived.
@When("^the scan M-Bus channels request is received$")
public void theScanMBusChannelsRequestIsReceived(final Map<String, String> settings) throws Throwable {
final ScanMbusChannelsRequest request = ScanMbusChannelsRequestFactory.fromParameterMap(settings);
final ScanMbusChannelsAsyncResponse asyncResponse = this.requestClient.doRequest(request);
assertThat(asyncResponse).as("AsyncResponse should not be null").isNotNull();
ScenarioContext.current().put(PlatformKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
Aggregations