Search in sources :

Example 1 with SetDeviceLifecycleStatusByChannelAsyncResponse

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());
}
Also used : SetDeviceLifecycleStatusByChannelRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelRequest) SetDeviceLifecycleStatusByChannelAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelAsyncResponse) When(io.cucumber.java.en.When)

Example 2 with SetDeviceLifecycleStatusByChannelAsyncResponse

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);
}
Also used : EnableDebuggingAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.EnableDebuggingAsyncResponse) FindEventsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindEventsAsyncResponse) SetDeviceCommunicationSettingsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceCommunicationSettingsAsyncResponse) SetDeviceLifecycleStatusByChannelAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelAsyncResponse) AsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse) DisableDebuggingAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.DisableDebuggingAsyncResponse) GetGsmDiagnosticAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.GetGsmDiagnosticAsyncResponse) ClearMBusStatusOnAllChannelsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.ClearMBusStatusOnAllChannelsAsyncResponse) FindMessageLogsAsyncResponse(org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindMessageLogsAsyncResponse) ResponsePayload(org.springframework.ws.server.endpoint.annotation.ResponsePayload) PayloadRoot(org.springframework.ws.server.endpoint.annotation.PayloadRoot)

Aggregations

SetDeviceLifecycleStatusByChannelAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelAsyncResponse)2 When (io.cucumber.java.en.When)1 AsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.AsyncResponse)1 ClearMBusStatusOnAllChannelsAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.ClearMBusStatusOnAllChannelsAsyncResponse)1 DisableDebuggingAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.DisableDebuggingAsyncResponse)1 EnableDebuggingAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.EnableDebuggingAsyncResponse)1 FindEventsAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindEventsAsyncResponse)1 FindMessageLogsAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.FindMessageLogsAsyncResponse)1 GetGsmDiagnosticAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.GetGsmDiagnosticAsyncResponse)1 SetDeviceCommunicationSettingsAsyncResponse (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceCommunicationSettingsAsyncResponse)1 SetDeviceLifecycleStatusByChannelRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.SetDeviceLifecycleStatusByChannelRequest)1 PayloadRoot (org.springframework.ws.server.endpoint.annotation.PayloadRoot)1 ResponsePayload (org.springframework.ws.server.endpoint.annotation.ResponsePayload)1