use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.ClearMBusStatusOnAllChannelsAsyncResponse in project open-smart-grid-platform by OSGP.
the class ClearMBusStatusOnAllChannelsSteps method theBundleRequestContainsAClearMBusStatusOnAllChannelsAction.
@When("^the clear M-Bus status on all channels request is received$")
public void theBundleRequestContainsAClearMBusStatusOnAllChannelsAction(final Map<String, String> requestData) throws Throwable {
final ClearMBusStatusOnAllChannelsRequest request = new ClearMBusStatusOnAllChannelsRequest();
request.setClearMBusStatusOnAllChannelsRequestData(new ClearMBusStatusOnAllChannelsRequestData());
request.setDeviceIdentification(requestData.get(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION));
final ClearMBusStatusOnAllChannelsAsyncResponse asyncResponse = this.managementRequestClient.doRequest(request);
assertThat(asyncResponse).as("AsyncResponse should not be null").isNotNull();
ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.ClearMBusStatusOnAllChannelsAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringManagementEndpoint method clearMBusStatusOnAllChannels.
@PayloadRoot(localPart = "ClearMBusStatusOnAllChannelsRequest", namespace = NAMESPACE)
@ResponsePayload
public ClearMBusStatusOnAllChannelsAsyncResponse clearMBusStatusOnAllChannels(@OrganisationIdentification final String organisationIdentification, @RequestPayload final ClearMBusStatusOnAllChannelsRequest 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.ClearMBusStatusOnAllChannelsRequestData requestData = this.managementMapper.map(request.getClearMBusStatusOnAllChannelsRequestData(), org.opensmartgridplatform.domain.core.valueobjects.smartmetering.ClearMBusStatusOnAllChannelsRequestData.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getDeviceIdentification()).withDeviceFunction(DeviceFunction.CLEAR_MBUS_STATUS_ON_ALL_CHANNELS).withMessageType(MessageType.CLEAR_MBUS_STATUS_ON_ALL_CHANNELS).withMessagePriority(messagePriority).withScheduleTime(scheduleTime).withBypassRetry(bypassRetry).build();
final AsyncResponse asyncResponse = this.requestService.enqueueAndSendRequest(requestMessageMetadata, requestData);
this.saveResponseUrlIfNeeded(asyncResponse.getCorrelationUid(), responseUrl);
return this.managementMapper.map(asyncResponse, ClearMBusStatusOnAllChannelsAsyncResponse.class);
}
Aggregations