use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelAsyncResponse in project open-smart-grid-platform by OSGP.
the class SetDeviceLifecycleStatusByChannel method aSetDeviceLifecycleStatusByChannelRequestIsReceived.
@When("^a set device lifecycle status by channel request is received$")
public void aSetDeviceLifecycleStatusByChannelRequestIsReceived(final Map<String, String> settings) throws Throwable {
final SetDeviceLifecycleStatusByChannelRequest request = SetDeviceLifecycleStatusByChannelRequestFactory.fromParameterMap(settings);
final SetDeviceLifecycleStatusByChannelAsyncResponse asyncResponse = this.smManagementRequestClient.doRequest(request);
assertThat(asyncResponse).as("setDeviceCommunicationSettingsAsyncResponse should not be null").isNotNull();
ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, asyncResponse.getCorrelationUid());
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelAsyncResponse in project open-smart-grid-platform by OSGP.
the class SmartMeteringManagementEndpoint method setDeviceLifecycleStatusByChannel.
@PayloadRoot(localPart = "SetDeviceLifecycleStatusByChannelRequest", namespace = NAMESPACE)
@ResponsePayload
public SetDeviceLifecycleStatusByChannelAsyncResponse setDeviceLifecycleStatusByChannel(@OrganisationIdentification final String organisationIdentification, @RequestPayload final SetDeviceLifecycleStatusByChannelRequest 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.SetDeviceLifecycleStatusByChannelRequestData requestData = this.managementMapper.map(request.getSetDeviceLifecycleStatusByChannelRequestData(), org.opensmartgridplatform.domain.core.valueobjects.smartmetering.SetDeviceLifecycleStatusByChannelRequestData.class);
final RequestMessageMetadata requestMessageMetadata = RequestMessageMetadata.newBuilder().withOrganisationIdentification(organisationIdentification).withDeviceIdentification(request.getGatewayDeviceIdentification()).withDeviceFunction(DeviceFunction.SET_DEVICE_LIFECYCLE_STATUS_BY_CHANNEL).withMessageType(MessageType.SET_DEVICE_LIFECYCLE_STATUS_BY_CHANNEL).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, SetDeviceLifecycleStatusByChannelAsyncResponse.class);
}
Aggregations